

:root {
    --bg: #f5f5f7;
    --card: #ffffff;
    --card-border: rgba(0,0,0,0.06);
    --text: #111827;
    --muted: #6b7280;
    --primary: #007aff;
    --primary-soft: rgba(0,122,255,0.12);
    --danger: #ff3b30;
    --radius-lg: 18px;
    --radius-md: 14px;
    --shadow-soft: 0 8px 30px rgba(0,0,0,0.06);
    --shadow-tiny: 0 1px 2px rgba(0,0,0,0.05);
    --sidebar: #ffffff;
    --sidebar-border: rgba(0,0,0,0.08);
    --sidebar-active: rgba(0,122,255,0.10);
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}


.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
      radial-gradient(1200px circle at top, #ffffff 0%, #f5f5f7 45%, #ececf1 100%);
}

.auth-wrapper { width: 100%; max-width: 420px; padding: 1.2rem; }

.auth-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-soft);
}

.brand-title {
    font-weight: 700;
    color: var(--primary);
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: .95rem;
}

.auth-heading {
    font-size: 1.9rem;
    margin: .4rem 0 .2rem;
    font-weight: 700;
}

.auth-subtitle {
    color: var(--muted);
    font-size: .95rem;
    margin-bottom: 1.4rem;
}


.app-body { background: var(--bg); min-height: 100vh; }

.app-shell {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}


.app-sidebar {
    background: var(--sidebar);
    border-right: 1px solid var(--sidebar-border);
    padding: 1.3rem 1rem;
    display: flex;
    flex-direction: column;
    gap: .7rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.app-sidebar-brand {
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: .5rem;
}

.app-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .8rem;
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
}

.app-sidebar-nav a:hover {
    background: rgba(0,0,0,0.04);
}

.app-sidebar-nav a.active {
    background: var(--sidebar-active);
    color: var(--primary);
}

.sidebar-email { color: var(--muted); font-size: .85rem; }
.sidebar-logout { color: var(--danger); font-size: .9rem; }


.app-main {
    padding: 1.4rem 1.6rem;
}


.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.app-menu-toggle {
    display: none;
    border: none;
    background: transparent;
    padding: .35rem .45rem;
    border-radius: 999px;
    cursor: pointer;
    line-height: 0;
}

.app-menu-toggle-icon {
    width: 18px;
    height: 14px;
    position: relative;
    display: inline-block;
}

.app-menu-toggle-icon span {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    border-radius: 999px;
    background: var(--text);
    opacity: 0.9;
    transition: transform .2s ease, top .2s ease, bottom .2s ease, opacity .2s ease;
}

.app-menu-toggle-icon span:nth-child(1) { top: 0; }
.app-menu-toggle-icon span:nth-child(2) { top: 6px; }
.app-menu-toggle-icon span:nth-child(3) { bottom: 0; }

.app-shell.has-sidebar-open .app-menu-toggle-icon span:nth-child(1) {
    top: 6px;
    transform: rotate(45deg);
}

.app-shell.has-sidebar-open .app-menu-toggle-icon span:nth-child(2) {
    opacity: 0;
}

.app-shell.has-sidebar-open .app-menu-toggle-icon span:nth-child(3) {
    bottom: 6px;
    transform: rotate(-45deg);
}


.app-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.32);
    z-index: 1040;
}


.app-topbar-title {
    font-size: 1.6rem;
    font-weight: 700;
}

.app-topbar-user {
    color: var(--muted);
    font-size: .95rem;
}


.card-surface {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 1.15rem 1.2rem;
    box-shadow: var(--shadow-tiny);
}

.card-surface-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .6rem;
}

.card-surface-title {
    font-size: .95rem;
    color: var(--muted);
    font-weight: 600;
}

.card-surface-value {
    font-size: 1.6rem;
    font-weight: 700;
}

.text-muted-soft { color: var(--muted); }


.badge-soft {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    font-size: .75rem;
    padding: .18rem .55rem;
    border-radius: 999px;
}


.form-label { font-weight: 600; font-size: .9rem; }

.form-control, select.form-control {
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 12px;
    padding: .65rem .8rem;
    font-size: .95rem;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.btn {
    border-radius: 999px !important;
    font-weight: 600;
    padding: .6rem 1rem;
}

.btn-primary {
    background: var(--primary);
    border: none;
    box-shadow: 0 6px 16px rgba(0,122,255,0.25);
}
.btn-primary:hover { filter: brightness(1.03); }

.btn-light {
    background: #f3f4f6;
    border: none;
}


.btn-secondary-soft {
    background: rgba(0,0,0,0.05);
    color: var(--text);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 10px;
    padding: 0.35rem 0.7rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s ease;
}
.btn-secondary-soft:hover {
    background: rgba(0,0,0,0.08);
    transform: translateY(-1px);
}


.btn-danger-soft {
    background: rgba(255,59,48,0.10);
    color: var(--danger);
    border: 1px solid rgba(255,59,48,0.35);
    border-radius: 10px;
    padding: 0.35rem 0.7rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s ease;
}
.btn-danger-soft:hover {
    background: rgba(255,59,48,0.16);
    color: #fff;
    transform: translateY(-1px);
}


.table-dark-custom {
    color: var(--text);
    background: transparent;
}
.table-dark-custom thead th {
    color: var(--muted);
    font-weight: 700;
    font-size: .85rem;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}
.table-dark-custom td, .table-dark-custom th {
    border-color: rgba(0,0,0,0.06);
}


.alert-soft {
    background: #f3f4f6;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 12px;
    color: var(--text);
}


.profile-avatar {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 999px;
    border: 2px solid rgba(0,0,0,0.08);
    box-shadow: var(--shadow-tiny);
}


@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-right: .2rem;
    }

    .app-topbar {
        gap: .75rem;
    }

    .app-topbar-title {
        font-size: 1.45rem;
    }

    .app-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        max-width: 80%;
        height: 100vh;
        padding-top: 1.2rem;
        padding-bottom: 1.2rem;
        box-shadow: var(--shadow-md);
        transform: translateX(-100%);
        transition: transform .25s ease, box-shadow .25s ease;
        z-index: 1050;
    }

    .app-shell.has-sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .app-main {
        padding-top: 1.2rem;
    }

    .app-sidebar-backdrop {
        display: block;
    }

    .app-shell:not(.has-sidebar-open) .app-sidebar-backdrop {
        display: none;
    }
}
