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

:root {
    --navy: #1D1A53;
    --navy-dk: #13104a;
    --orange: #F36B21;
    --teal: #16C19F;
    --blue: #0068E6;
    --sky: #6AB2E2;
    --white: #fff;
    --off: #F8F9FC;
    --muted: rgba(255,255,255,0.5);
    --subtle: rgba(255,255,255,0.07);
    --bg: #F4F5F8;
    --surface: #fff;
    --border: #E8E9EF;
    --text-primary: #1a1a2e;
    --text-secondary: #6b6b8a;
    --text-muted: #9999b3;
    --sidebar-w: 232px;
    --font: 'Outfit', sans-serif;
}

html, body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    background: var(--navy-dk);
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: 4px 0 20px rgba(19,16,74,0.2);
}

.sidebar-logo {
    padding: 20px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    cursor: pointer;
}

.sidebar-logo-text {
    font-size: 17px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.3px;
}

.sidebar-logo-text span { color: var(--orange); }

.portal-tag {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.05);
    padding: 2px 7px;
    border-radius: 4px;
}

.nav-cta {
    margin: 14px 12px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 16px;
    background: var(--orange);
    color: white;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    font-family: var(--font);
}

.nav-cta:hover {
    background: #e05a10;
    box-shadow: 0 4px 14px rgba(243,107,33,0.4);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0 12px;
}

.nav-section { padding: 16px 16px 4px; }

.nav-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(255,255,255,0.75);
}

.nav-section-label span { color: rgba(255,255,255,0.35); }

.nav-children {
    padding: 3px 0 6px;
    position: relative;
}

.nav-children::before {
    content: '';
    position: absolute;
    left: 20px; top: 0; bottom: 8px;
    width: 1px;
    background: rgba(255,255,255,0.08);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 8px 32px;
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.12s;
    border-left: 2px solid transparent;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.85);
}

.nav-item.active {
    color: var(--white);
    font-weight: 600;
    background: rgba(255,255,255,0.06);
    border-left-color: var(--orange);
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 6px 12px;
}

.sidebar-user {
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.12s;
    flex-shrink: 0;
}

.sidebar-user:hover { background: rgba(255,255,255,0.04); }

.signout-btn {
    margin-left: auto;
    color: rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    transition: color 0.15s;
    flex-shrink: 0;
}

.signout-btn:hover { color: rgba(255,255,255,0.8); }

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orange), var(--blue));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }

.user-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 10.5px;
    color: rgba(255,255,255,0.28);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── MAIN ── */
.main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: 64px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text-secondary);
    flex: 1;
}

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

.breadcrumb-current {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.12s;
}

.header-btn:hover {
    background: var(--bg);
    color: var(--text-primary);
}

/* ── CONTENT ── */
.content {
    flex: 1;
    padding: 24px 28px;
}

.page-title-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.pt-name { color: var(--navy); }
.pt-period { color: var(--orange); }

.page-title-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.period-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    font-family: var(--font);
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s;
}

.period-select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0,104,230,0.08);
}

/* ── TABLE CARD ── */
.table-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 18px;
}

.table-header {
    display: flex;
    align-items: center;
    padding: 13px 18px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
}

.tsl {
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tsl-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--teal);
    flex-shrink: 0;
}

.tc-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(22,193,159,0.1);
    color: #0a9e7f;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead tr {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

th {
    padding: 9px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    text-align: left;
    white-space: nowrap;
    font-family: var(--font);
    user-select: none;
}

td {
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
}

tbody tr { transition: background 0.1s; }

tbody tr:last-child td { border-bottom: none; }

tbody tr:hover { background: rgba(0,104,230,0.025); }

.rank-cell {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    width: 40px;
    text-align: center;
}

.tech-name {
    font-weight: 600;
    font-size: 13px;
}

.ticket-count {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.8px;
    color: var(--navy);
}

/* ── LOADING / ERROR ── */
.loading-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
    font-size: 13px;
}

.error-state {
    text-align: center;
    padding: 48px 24px;
    color: #d93025;
    font-size: 13px;
    background: rgba(217,48,37,0.04);
    border: 1px solid rgba(217,48,37,0.15);
    border-radius: 10px;
    margin-bottom: 16px;
}

/* ── TOAST ── */
.toast {
    position: fixed;
    bottom: 28px; right: 28px;
    background: var(--navy);
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 900;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.toast.show { opacity: 1; transform: translateY(0); }

/* ── UTILIZATION REPORT ── */
.hours-val {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.util-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.util-high {
    background: rgba(22,193,159,0.1);
    color: #0a9e7f;
}

.util-mid {
    background: rgba(243,107,33,0.1);
    color: var(--orange);
}

.util-low {
    background: rgba(217,48,37,0.08);
    color: #d93025;
}

.empty-home {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 60vh;
    gap: 16px;
    text-align: center;
    animation: fadeUp 0.5s ease both;
}

.empty-home-mascot {
    height: 120px;
    width: auto;
    opacity: 0.85;
    margin-bottom: 8px;
}

.empty-home-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

.empty-home-sub {
    font-size: 15px;
    color: var(--text-secondary);
}

.totals-row td {
    border-top: 2px solid var(--border);
}

.company-extra {
    display: none;
}

.show-more-link {
    margin-left: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.show-more-link:hover {
    color: var(--text-primary);
}

.show-more-cell {
    text-align: center;
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-top: 1px solid var(--border);
    user-select: none;
}

.show-more-cell:hover {
    color: var(--text-primary);
    background: var(--hover);
}

/* ── LOGIN PAGE ── */
.bg {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg,#13104a 0%,#1D1A53 50%,#0f2a4a 100%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.2;
    animation: drift 14s ease-in-out infinite alternate;
}

.o1 {
    width: 650px;
    height: 650px;
    background: var(--orange);
    top: -220px;
    left: -180px;
}

.o2 {
    width: 500px;
    height: 500px;
    background: var(--teal);
    bottom: -160px;
    right: -80px;
    animation-delay: -5s;
}

.o3 {
    width: 380px;
    height: 380px;
    background: var(--blue);
    top: 45%;
    right: 22%;
    transform: translateY(-50%);
    animation-delay: -9s;
}

.grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.025) 1px,transparent 1px), linear-gradient(90deg,rgba(255,255,255,0.025) 1px,transparent 1px);
    background-size: 44px 44px;
}

.slash {
    position: absolute;
    top: 0;
    right: 0;
    width: 42%;
    height: 100%;
    background: linear-gradient(135deg,transparent 0%,rgba(243,107,33,0.05) 100%);
    clip-path: polygon(28% 0%,100% 0%,100% 100%,0% 100%);
}

@keyframes drift {
    from { transform: translate(0,0) scale(1); }
    to   { transform: translate(28px,18px) scale(1.04); }
}

.page {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand {
    flex: 1;
    max-width: 540px;
    padding: 64px 56px;
    animation: fadeUp 0.7s ease both;
}

.brand-logo {
    width: 210px;
    margin-bottom: 44px;
    opacity: 0.96;
}

.brand-tagline {
    font-size: 38px;
    font-weight: 700;
    color: var(--white);
    line-height: 1.12;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.brand-tagline em {
    font-style: normal;
    color: var(--orange);
}

.davism-wrap {
    margin-top: 40px;
    padding: 24px 28px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-left: 3px solid var(--orange);
    border-radius: 0 12px 12px 0;
    position: relative;
    min-height: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}

.davism-quote-mark {
    font-size: 52px;
    line-height: 1;
    color: var(--orange);
    opacity: 0.35;
    font-family: Georgia, serif;
    position: absolute;
    top: 8px;
    left: 20px;
}

.davism-text {
    font-size: 15px;
    font-style: italic;
    color: rgba(255,255,255,0.82);
    line-height: 1.6;
    padding-left: 8px;
    transition: opacity 0.4s ease;
}

.davism-attr {
    font-size: 11px;
    color: var(--orange);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding-left: 8px;
    opacity: 0.8;
}

.davism-refresh {
    position: absolute;
    bottom: 12px;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.2);
    font-size: 10px;
    font-family: monospace;
    letter-spacing: 0.05em;
    transition: color 0.2s;
    padding: 4px;
}

.davism-refresh:hover {
    color: var(--orange);
}

.vr {
    width: 1px;
    align-self: stretch;
    margin: 80px 0;
    flex-shrink: 0;
    background: linear-gradient(to bottom,transparent,rgba(255,255,255,0.1) 25%,rgba(243,107,33,0.45) 50%,rgba(255,255,255,0.1) 75%,transparent);
}

.card {
    width: 420px;
    padding: 52px 44px;
    background: linear-gradient(135deg,rgba(255,255,255,0.08),rgba(255,255,255,0.04));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    animation: fadeUp 0.7s 0.15s ease both;
}

.card-greeting {
    font-size: 28px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.card-sub {
    font-size: 14px;
    color: var(--muted);
    margin-bottom: 32px;
    line-height: 1.5;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    margin-bottom: 8px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-family: var(--font);
    transition: all 0.2s;
}

.form-input::placeholder {
    color: rgba(255,255,255,0.3);
}

.form-input:focus {
    outline: none;
    background: rgba(255,255,255,0.08);
    border-color: var(--orange);
}

.error-message {
    display: none;
    padding: 12px 16px;
    background: rgba(255,87,87,0.1);
    border: 1px solid rgba(255,87,87,0.3);
    border-radius: 8px;
    color: #ff9999;
    font-size: 13px;
    margin-bottom: 20px;
}

.signin-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--orange), #e05515);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 15px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.02em;
}

.signin-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(243,107,33,0.3);
}

.signin-btn:active {
    transform: translateY(0);
}

.signin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ms-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    color: #1a1a1a;
    border: 1px solid #ddd;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
}

.ms-btn:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.divider {
    margin: 32px 0 24px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.3);
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
}

.divider::before {
    left: 0;
    background: linear-gradient(to right,rgba(255,255,255,0),rgba(255,255,255,0.08));
}

.divider::after {
    right: 0;
    background: linear-gradient(to left,rgba(255,255,255,0),rgba(255,255,255,0.08));
}

.features {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.feat {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 6px;
}

.dot.o { background: var(--orange); }
.dot.t { background: var(--teal); }
.dot.s { background: var(--sky); }

.feat-text {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255,255,255,0.7);
}

.feat-text strong {
    color: rgba(255,255,255,0.92);
    font-weight: 600;
}

.card-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.06);
    text-align: center;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    line-height: 1.6;
}

.card-footer a {
    color: var(--orange);
    text-decoration: none;
    transition: opacity 0.2s;
}

.card-footer a:hover {
    opacity: 0.7;
}

.version {
    position: fixed;
    bottom: 20px;
    left: 20px;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255,255,255,0.25);
    letter-spacing: 0.05em;
    z-index: 10;
    font-family: monospace;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
