:root {
    --lm-navy: #1a2744;
    --lm-navy-light: #243352;
    --lm-navy-dark: #111b30;
    --lm-gold: #c5a55a;
    --lm-gold-light: #d4b96e;
    --lm-cream: #faf8f4;
    --lm-green: #22c55e;
    --lm-red: #ef4444;
    --lm-orange: #f59e0b;
    --lm-blue: #3b82f6;
    --g50: #f9fafb;
    --g100: #f3f4f6;
    --g200: #e5e7eb;
    --g300: #d1d5db;
    --g400: #9ca3af;
    --g500: #6b7280;
    --g600: #4b5563;
    --g700: #374151;
    --g800: #1f2937;
    --sidebar-w: 250px;
    --topbar-h: 56px;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.04);
    --shadow-lg: 0 10px 20px rgba(0,0,0,.08), 0 4px 8px rgba(0,0,0,.04);
    --ease: .2s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: var(--g800);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--lm-gold); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--lm-gold-light); }

/* =========== LOGIN =========== */
.login-page { min-height: 100vh; display: flex; background: var(--lm-navy); }

.login-left {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    padding: 40px;
    background: linear-gradient(135deg, var(--lm-navy-dark) 0%, var(--lm-navy) 50%, var(--lm-navy-light) 100%);
    position: relative; overflow: hidden;
}

.login-left::before {
    content: '';
    position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(197,165,90,.08) 0%, transparent 50%);
}

.login-brand { position: relative; z-index: 1; text-align: center; color: #fff; max-width: 420px; }
.login-brand .logo-img { max-height: 40px; margin-bottom: 20px; }
.login-brand h1 { font-size: 2.2rem; font-weight: 700; margin-bottom: 8px; }
.login-brand h1 span { color: var(--lm-gold); }
.login-brand > p { color: var(--g400); font-size: 1.05rem; }

.login-features { margin-top: 48px; text-align: left; }
.login-features .feat { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 28px; }
.login-features .feat-icon {
    width: 44px; height: 44px; border-radius: 10px;
    background: rgba(197,165,90,.15);
    display: flex; align-items: center; justify-content: center;
    color: var(--lm-gold); font-size: 1.1rem; flex-shrink: 0;
}
.login-features .feat h4 { color: #fff; font-size: .95rem; font-weight: 600; margin-bottom: 2px; }
.login-features .feat p { color: var(--g400); font-size: .85rem; margin: 0; }

.login-right {
    width: 480px;
    display: flex; align-items: center; justify-content: center;
    padding: 40px; background: #fff;
}

.login-form { width: 100%; max-width: 360px; }
.login-form h2 { font-size: 1.5rem; font-weight: 700; color: var(--lm-navy); margin-bottom: 6px; }
.login-form .sub { color: var(--g500); font-size: .95rem; margin-bottom: 32px; }

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: .8rem; font-weight: 600; color: var(--g700); margin-bottom: 6px; }

.form-input {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--g200); border-radius: var(--radius-sm);
    font-size: .9rem; color: var(--g800); background: #fff;
    transition: border-color var(--ease), box-shadow var(--ease);
    outline: none; font-family: inherit;
}
.form-input:focus { border-color: var(--lm-blue); box-shadow: 0 0 0 3px rgba(59,130,246,.1); }
.form-input::placeholder { color: var(--g400); }

.form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--g600); cursor: pointer; }
.form-check input[type="checkbox"] { accent-color: var(--lm-blue); width: 16px; height: 16px; }
.forgot-link { font-size: .85rem; color: var(--lm-blue); }

.btn-login {
    width: 100%; padding: 12px; background: var(--lm-blue); color: #fff;
    border: none; border-radius: var(--radius-sm);
    font-size: .95rem; font-weight: 600; cursor: pointer;
    transition: background var(--ease), transform var(--ease); font-family: inherit;
}
.btn-login:hover { background: #2563eb; transform: translateY(-1px); }

.login-footer { text-align: center; margin-top: 24px; font-size: .9rem; color: var(--g500); }
.login-footer a { font-weight: 600; }

.divider { display: flex; align-items: center; gap: 16px; margin: 24px 0; color: var(--g400); font-size: .85rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--g200); }

.btn-social {
    width: 100%; padding: 10px; background: #fff;
    border: 1.5px solid var(--g200); border-radius: var(--radius-sm);
    font-size: .9rem; color: var(--g700); cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    transition: background var(--ease), border-color var(--ease); font-family: inherit;
}
.btn-social:hover { background: var(--g50); border-color: var(--g300); }

/* =========== APP LAYOUT =========== */
.app-layout { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
    width: var(--sidebar-w); background: #fff; color: var(--g700);
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
    display: flex; flex-direction: column; transition: transform .3s ease;
    border-right: 1px solid var(--g200);
}

.sidebar-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--g100);
    display: flex; align-items: center;
}

.sidebar-logo { display: flex; align-items: center; gap: 10px; }
.sidebar-logo img { max-height: 28px; filter: brightness(0) saturate(100%) invert(14%) sepia(25%) saturate(1400%) hue-rotate(188deg) brightness(95%) contrast(95%); }

.sidebar-org {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--g100);
    cursor: pointer;
    transition: background var(--ease);
}
.sidebar-org:hover { background: var(--g50); }

.sidebar-org-avatar {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--lm-blue); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .75rem; flex-shrink: 0;
}

.sidebar-org-name { font-size: .85rem; font-weight: 700; color: var(--g800); }
.sidebar-org-plan { font-size: .7rem; color: var(--g400); }

.sidebar-nav { flex: 1; padding: 8px 8px; overflow-y: auto; }

.nav-section { margin-bottom: 16px; }
.nav-label {
    font-size: .65rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1.2px; color: var(--g400); padding: 8px 12px 4px;
}

.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; border-radius: var(--radius-sm);
    color: var(--g600); font-size: .85rem; font-weight: 500;
    cursor: pointer; transition: all var(--ease); text-decoration: none;
}

.nav-item:hover { background: var(--g50); color: var(--g800); }
.nav-item.active { background: rgba(59,130,246,.08); color: var(--lm-blue); font-weight: 600; }
.nav-item i { width: 18px; text-align: center; font-size: .9rem; }

.nav-badge {
    margin-left: auto; background: var(--lm-blue); color: #fff;
    font-size: .65rem; font-weight: 700; padding: 2px 7px; border-radius: 10px;
    min-width: 20px; text-align: center;
}

.sidebar-footer {
    padding: 8px 12px 12px;
    border-top: 1px solid var(--g100);
}

.sidebar-help {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 8px; border-radius: var(--radius-sm);
    font-size: .8rem; color: var(--g500); cursor: pointer;
    transition: all var(--ease); margin-bottom: 4px;
}
.sidebar-help:hover { background: var(--g50); color: var(--g700); }
.sidebar-help i { font-size: .85rem; }

.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 8px; border-radius: var(--radius-sm);
    cursor: pointer; transition: background var(--ease);
}
.sidebar-user:hover { background: var(--g50); }

.user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--lm-gold); display: flex; align-items: center; justify-content: center;
    color: var(--lm-navy); font-weight: 700; font-size: .75rem; flex-shrink: 0;
}
.user-name { font-size: .8rem; font-weight: 600; color: var(--g800); }
.user-role { font-size: .7rem; color: var(--g400); }

/* =========== MAIN =========== */
.main-content { flex: 1; margin-left: var(--sidebar-w); min-height: 100vh; background: #f0f2f5; }

/* =========== TOPBAR =========== */
.topbar {
    height: var(--topbar-h); background: #fff;
    border-bottom: 1px solid var(--g200);
    display: flex; align-items: center;
    padding: 0 24px; position: sticky; top: 0; z-index: 50; gap: 12px;
}

.topbar-toggle { display: none; background: none; border: none; font-size: 1.2rem; color: var(--g600); cursor: pointer; padding: 4px; }
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--g800); }

.topbar-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.topbar-divider { width: 1px; height: 24px; background: var(--g200); margin: 0 4px; }

/* Topbar Timer */
.topbar-timer-wrap {
    display: flex; align-items: center; gap: 6px;
    position: relative;
}

.topbar-timer-icon {
    font-size: 1rem; color: var(--g400); transition: color var(--ease);
}
.topbar-timer-icon.running { color: var(--lm-green); }
.topbar-timer-icon.paused { color: var(--lm-gold); }

.topbar-timer-display {
    font-size: 1.1rem; font-weight: 700; color: var(--g700);
    font-variant-numeric: tabular-nums; cursor: pointer;
    padding: 4px 6px; border-radius: var(--radius-sm);
    transition: background var(--ease);
}
.topbar-timer-display:hover { background: var(--g50); }
.topbar-timer-display.running { color: var(--lm-navy); }
.topbar-timer-display.paused { color: var(--lm-gold); }

.topbar-timer-btn {
    width: 32px; height: 32px; border: none; border-radius: 50%;
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: .75rem; transition: all var(--ease); flex-shrink: 0;
}
.topbar-timer-btn:hover { transform: scale(1.1); }

.topbar-timer-start { background: var(--lm-green); }
.topbar-timer-start.active { display: none; }

.topbar-timer-pause {
    background: #2563eb; font-size: .7rem;
}
.topbar-timer-pause:hover { background: #1d4ed8; }

.topbar-timer-stop {
    background: var(--g400); font-size: .65rem;
}
.topbar-timer-stop:hover { background: var(--g600); }

@keyframes pulse-red {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
    50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

/* Timer Panel Dropdown */
.timer-panel {
    position: absolute; top: calc(100% + 8px); right: 0;
    width: 340px; background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow-lg); border: 1px solid var(--g200);
    display: none; z-index: 200;
}
.timer-panel.open { display: block; }

.timer-panel-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--g100);
    font-size: .9rem;
}

.timer-panel-close-btn {
    width: 28px; height: 28px; border: none; background: var(--g100);
    border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
    color: var(--g500); font-size: .75rem; transition: all var(--ease);
}
.timer-panel-close-btn:hover { background: var(--g200); color: var(--g700); }

.timer-panel-body { padding: 16px; }

.timer-panel-row { margin-bottom: 12px; }

.timer-panel-label { font-size: .7rem; font-weight: 600; color: var(--g500); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }

.timer-panel-matter-row {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.timer-panel-matter-name { font-size: .9rem; font-weight: 600; color: var(--lm-navy); }

.timer-panel-time {
    text-align: center; padding: 12px 0 8px;
}

.timer-time {
    font-size: 2.8rem; font-weight: 800; color: var(--lm-navy);
    font-variant-numeric: tabular-nums; letter-spacing: 1px; line-height: 1;
    margin-bottom: 4px;
}
.timer-time .secs { font-size: 1.8rem; color: var(--lm-blue); }

.timer-status { font-size: .8rem; color: var(--g400); }
.timer-status.running { color: var(--lm-green); font-weight: 600; }

.timer-panel-btns {
    display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--g100);
}
.timer-panel-btns .btn { flex: 1; justify-content: center; }

.topbar-btn {
    width: 34px; height: 34px; border: none; background: none;
    border-radius: var(--radius-sm); color: var(--g500); font-size: 1rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all var(--ease); position: relative;
}
.topbar-btn:hover { background: var(--g100); color: var(--g700); }

.topbar-btn .dot {
    position: absolute; top: 6px; right: 6px;
    width: 7px; height: 7px; background: var(--lm-red); border-radius: 50%; border: 2px solid #fff;
}

.topbar-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--lm-gold); color: var(--lm-navy);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .7rem; cursor: pointer;
    transition: opacity var(--ease);
}
.topbar-avatar:hover { opacity: .8; }

.page-content { padding: 24px; }

/* =========== DASHBOARD CALENDAR LAYOUT =========== */
.dash-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}

.dash-main { min-width: 0; }

.cal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}

.cal-title {
    display: flex; align-items: center; gap: 10px;
}
.cal-title h2 { font-size: 1.2rem; font-weight: 700; color: var(--g800); }

.cal-nav { display: flex; gap: 8px; }

.cal-nav-btn {
    padding: 6px 14px; border: 1px solid var(--g200); border-radius: var(--radius-sm);
    background: #fff; color: var(--g600); font-size: .8rem; font-weight: 500;
    cursor: pointer; transition: all var(--ease); font-family: inherit;
    display: flex; align-items: center; gap: 4px;
}
.cal-nav-btn:hover { background: var(--g50); border-color: var(--g300); color: var(--g800); }

.cal-card {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow); border: 1px solid var(--g200);
    overflow: hidden;
}

.cal-section-label {
    padding: 12px 16px; font-size: .75rem; font-weight: 600;
    color: var(--g500); text-transform: uppercase; letter-spacing: .5px;
    border-bottom: 1px solid var(--g100);
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.cal-day-header {
    padding: 8px 4px; text-align: center;
    font-size: .7rem; font-weight: 700; color: var(--g400);
    text-transform: uppercase; letter-spacing: .5px;
    background: var(--g50); border-bottom: 1px solid var(--g200);
    border-right: 1px solid var(--g100);
}
.cal-day-header:last-child { border-right: none; }

.cal-day {
    padding: 8px 6px; text-align: center;
    border-right: 1px solid var(--g100);
    border-bottom: 1px solid var(--g100);
    min-height: 64px;
    display: flex; flex-direction: column;
    align-items: center; gap: 6px;
    transition: background var(--ease);
    cursor: default;
}
.cal-day:nth-child(7n+14) { border-right: none; }
.cal-day:hover { background: var(--g50); }

.cal-date {
    font-size: .85rem; font-weight: 600; color: var(--g700);
    line-height: 1;
}

.cal-hours {
    font-size: .8rem; font-weight: 700; color: var(--lm-blue);
    line-height: 1;
}

.cal-day.today {
    background: rgba(59,130,246,.06);
}
.cal-day.today .cal-date {
    background: var(--lm-blue); color: #fff;
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem;
}

.cal-day.has-hours .cal-hours { color: var(--lm-blue); }

.cal-day.other-month .cal-date { color: var(--g300); }
.cal-day.other-month .cal-hours { color: var(--g300); }

.cal-footer {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-top: 1px solid var(--g100);
}

.cal-total { font-size: .85rem; color: var(--lm-blue); font-weight: 600; }

.cal-link {
    font-size: .85rem; color: var(--lm-blue); font-weight: 600;
    display: flex; align-items: center; gap: 4px;
    transition: color var(--ease);
}
.cal-link:hover { color: #2563eb; }

/* =========== DASHBOARD SIDE PANEL =========== */
.dash-side { display: flex; flex-direction: column; gap: 16px; }

.side-card {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow); border: 1px solid var(--g200);
    overflow: hidden;
}

.side-card-title {
    padding: 14px 16px; font-size: .85rem; font-weight: 700; color: var(--g800);
    border-bottom: 1px solid var(--g100);
}

.side-tabs {
    display: flex; border-bottom: 1px solid var(--g100);
}

.side-tab {
    flex: 1; padding: 10px 12px; border: none; background: none;
    font-size: .75rem; font-weight: 600; color: var(--g400);
    cursor: pointer; transition: all var(--ease); font-family: inherit;
    border-bottom: 2px solid transparent; text-align: center;
}
.side-tab:hover { color: var(--g700); }
.side-tab.active { color: var(--lm-blue); border-bottom-color: var(--lm-blue); }

/* Weekly Totals */
.weekly-list { padding: 8px 16px; }

.weekly-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--g100);
}
.weekly-row:last-child { border-bottom: none; }

.weekly-ring {
    width: 42px; height: 42px; border-radius: 50%;
    background: conic-gradient(var(--lm-blue) calc(var(--pct) * 3.6deg), var(--g100) calc(var(--pct) * 3.6deg));
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.weekly-ring-inner {
    width: 30px; height: 30px; border-radius: 50%; background: #fff;
}

.weekly-info { flex: 1; }
.weekly-day { font-size: .8rem; font-weight: 600; color: var(--g600); }
.weekly-hours { font-size: .85rem; font-weight: 700; color: var(--g800); }

/* Work List */
.work-list { padding: 4px 0; }

.work-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px;
    transition: background var(--ease);
    cursor: pointer;
}
.work-item:hover { background: var(--g50); }

.work-dot {
    width: 10px; height: 10px; border-radius: 3px;
    flex-shrink: 0;
}

.work-info { flex: 1; min-width: 0; }
.work-name { font-size: .8rem; font-weight: 600; color: var(--g700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.work-meta { font-size: .7rem; color: var(--g400); }

.work-play {
    width: 26px; height: 26px; border-radius: 50%;
    border: 1px solid var(--g200); background: none;
    color: var(--g400); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: .55rem; transition: all var(--ease); flex-shrink: 0;
    opacity: 0;
}
.work-item:hover .work-play { opacity: 1; }
.work-play:hover { border-color: var(--lm-blue); color: var(--lm-blue); background: rgba(59,130,246,.05); }

/* =========== STATS GRID =========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: #fff; border-radius: var(--radius);
    padding: 18px 20px; box-shadow: var(--shadow);
    border: 1px solid var(--g200);
}
.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }

.stat-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: .9rem; }
.stat-icon.blue { background: rgba(59,130,246,.08); color: var(--lm-blue); }
.stat-icon.green { background: rgba(34,197,94,.08); color: var(--lm-green); }
.stat-icon.gold { background: rgba(197,165,90,.08); color: var(--lm-gold); }
.stat-icon.orange { background: rgba(245,158,11,.08); color: var(--lm-orange); }

.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--g800); line-height: 1; }
.stat-label { font-size: .75rem; color: var(--g500); margin-top: 2px; }

/* =========== CARDS =========== */
.card {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow); border: 1px solid var(--g200);
    margin-bottom: 20px;
}

.card-header {
    padding: 16px 20px; border-bottom: 1px solid var(--g100);
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 12px;
}
.card-title { font-size: .9rem; font-weight: 700; color: var(--g800); }
.card-body { padding: 20px; }

/* =========== ENTRIES TABLE =========== */
.entries-table { width: 100%; border-collapse: collapse; }

.entries-table th {
    text-align: left; padding: 10px 14px;
    font-size: .7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .5px; color: var(--g500);
    border-bottom: 1px solid var(--g200); background: var(--g50);
}

.entries-table td {
    padding: 12px 14px; border-bottom: 1px solid var(--g100);
    font-size: .85rem; vertical-align: middle;
}

.entries-table tr:last-child td { border-bottom: none; }
.entries-table tr:hover td { background: var(--g50); }

.entry-matter { font-weight: 600; color: var(--g800); }
.entry-desc { font-size: .75rem; color: var(--g500); margin-top: 2px; }

.entry-duration {
    font-weight: 700; font-variant-numeric: tabular-nums;
    color: var(--lm-blue); font-size: .9rem;
}

.status-badge {
    display: inline-block; padding: 3px 10px;
    border-radius: 20px; font-size: .65rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .5px;
}

.status-badge.draft { background: var(--g100); color: var(--g600); }
.status-badge.submitted { background: rgba(59,130,246,.08); color: var(--lm-blue); }
.status-badge.approved { background: rgba(34,197,94,.08); color: var(--lm-green); }
.status-badge.billed { background: rgba(197,165,90,.08); color: var(--lm-gold); }

/* =========== MATTERS =========== */
.matters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.matter-card {
    background: #fff; border-radius: var(--radius);
    padding: 20px; box-shadow: var(--shadow);
    border: 1px solid var(--g200); border-left: 4px solid var(--lm-blue);
    transition: box-shadow var(--ease); cursor: pointer;
}
.matter-card:hover { box-shadow: var(--shadow-md); }

.matter-name { font-size: .95rem; font-weight: 700; color: var(--g800); margin-bottom: 4px; }
.matter-client { font-size: .8rem; color: var(--g500); margin-bottom: 14px; }

.matter-stats { display: flex; gap: 20px; }
.matter-stat-label { font-size: .65rem; color: var(--g400); text-transform: uppercase; letter-spacing: .5px; }
.matter-stat-value { font-size: 1rem; font-weight: 700; color: var(--g800); }

/* =========== REPORTS =========== */
.chart-bar-group { margin-bottom: 14px; }
.chart-bar-label { font-size: .8rem; color: var(--g600); margin-bottom: 4px; display: flex; justify-content: space-between; }
.chart-bar-track { height: 22px; background: var(--g100); border-radius: 4px; overflow: hidden; }
.chart-bar-fill { height: 100%; background: var(--lm-blue); border-radius: 4px; transition: width .8s ease; min-width: 2px; }

/* =========== TEAM TABLE =========== */
.team-table { width: 100%; border-collapse: collapse; }

.team-table th {
    text-align: left; padding: 10px 14px;
    font-size: .7rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .5px; color: var(--g500);
    border-bottom: 1px solid var(--g200); background: var(--g50);
}

.team-table td {
    padding: 14px; border-bottom: 1px solid var(--g100);
    font-size: .85rem; vertical-align: middle;
}

.team-table tr:last-child td { border-bottom: none; }
.team-table tr:hover td { background: var(--g50); }

.team-member { display: flex; align-items: center; gap: 10px; }

.team-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .75rem; flex-shrink: 0;
}

.member-name { font-weight: 600; color: var(--g800); }
.member-email { font-size: .75rem; color: var(--g500); }

.role-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .7rem; font-weight: 600; }
.role-badge.partner { background: rgba(197,165,90,.1); color: var(--lm-gold); }
.role-badge.associate { background: rgba(59,130,246,.08); color: var(--lm-blue); }
.role-badge.paralegal { background: rgba(34,197,94,.08); color: var(--lm-green); }
.role-badge.admin { background: rgba(197,165,90,.1); color: var(--lm-gold); }

/* =========== BUTTONS =========== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius-sm);
    font-size: .85rem; font-weight: 600; cursor: pointer;
    transition: all var(--ease); border: 1px solid transparent; font-family: inherit;
}

.btn-primary { background: var(--lm-blue); color: #fff; border-color: var(--lm-blue); }
.btn-primary:hover { background: #2563eb; }

.btn-outline { background: #fff; color: var(--g700); border-color: var(--g200); }
.btn-outline:hover { border-color: var(--g300); background: var(--g50); }

.btn-sm { padding: 5px 12px; font-size: .75rem; }
.btn-icon { padding: 6px 8px; }

/* =========== SETTINGS =========== */
.settings-section { margin-bottom: 28px; }
.settings-title { font-size: 1rem; font-weight: 700; color: var(--g800); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--g200); }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--g100); }
.settings-row:last-child { border-bottom: none; }
.settings-label { font-size: .85rem; font-weight: 600; color: var(--g700); }
.settings-desc { font-size: .75rem; color: var(--g500); margin-top: 2px; }

.toggle { position: relative; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; inset: 0; background: var(--g300);
    border-radius: 11px; cursor: pointer; transition: background var(--ease);
}
.toggle-slider::before {
    content: ''; position: absolute; width: 16px; height: 16px;
    border-radius: 50%; background: #fff; top: 3px; left: 3px;
    transition: transform var(--ease);
}
.toggle input:checked + .toggle-slider { background: var(--lm-blue); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* =========== MODAL =========== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.4);
    z-index: 200; display: flex; align-items: center; justify-content: center;
    padding: 20px; opacity: 0; visibility: hidden; transition: all .3s ease;
    backdrop-filter: blur(2px);
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-box {
    background: #fff; border-radius: var(--radius);
    width: 100%; max-width: 520px; box-shadow: var(--shadow-lg);
    transform: translateY(20px); transition: transform .3s ease;
    max-height: 90vh; overflow-y: auto;
}
.modal-overlay.active .modal-box { transform: translateY(0); }

.modal-header { padding: 20px 20px 0; display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--g800); }

.modal-close {
    width: 30px; height: 30px; border: none; background: var(--g100);
    border-radius: 50%; color: var(--g500); cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: .8rem;
    transition: all var(--ease);
}
.modal-close:hover { background: var(--g200); color: var(--g700); }

.modal-body { padding: 20px; }
.modal-footer { padding: 0 20px 20px; display: flex; gap: 10px; justify-content: flex-end; }

/* =========== TOAST =========== */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }

.toast {
    padding: 12px 18px; background: var(--g800); color: #fff;
    border-radius: var(--radius-sm); font-size: .8rem;
    box-shadow: var(--shadow-lg); display: flex; align-items: center;
    gap: 8px; animation: toast-in .3s ease; max-width: 340px;
}
.toast.success { border-left: 3px solid var(--lm-green); }
.toast.error { border-left: 3px solid var(--lm-red); }
.toast.info { border-left: 3px solid var(--lm-blue); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========== VIEW PANELS =========== */
.view-panel { display: none; }
.view-panel.active { display: block; }

/* =========== GRID HELPERS =========== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99; }

/* =========== RESPONSIVE =========== */
@media (max-width: 1200px) {
    .dash-layout { grid-template-columns: 1fr 280px; }
}

@media (max-width: 1024px) {
    .dash-layout { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .matters-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-backdrop.active { display: block; }
    .main-content { margin-left: 0; }
    .topbar-toggle { display: block; }
    .topbar { padding: 0 12px; }
    .page-content { padding: 16px 12px; }
    .stats-grid { grid-template-columns: 1fr; }
    .timer-time { font-size: 2.2rem; }
    .timer-time .secs { font-size: 1.4rem; }
    .login-page { flex-direction: column; }
    .login-left { display: none; }
    .login-right { width: 100%; min-height: 100vh; }
    .topbar-timer-display { font-size: .9rem; }
    .timer-panel { width: 300px; right: -40px; }
    .cal-day { min-height: 52px; padding: 6px 4px; }
    .cal-date { font-size: .75rem; }
    .cal-hours { font-size: .7rem; }
}
