/* ============================================
   LotterLaw Team Hub Stylesheet
   Brand: Professional Legal — Navy + Teal
   ============================================ */

:root {
    --navy: #1b2a4a;
    --navy-deep: #0f1b33;
    --teal: #2a9d8f;
    --teal-light: #40b4a6;
    --teal-dark: #21867a;
    --slate: #e8ecf1;
    --slate-dim: rgba(232, 236, 241, 0.7);
    --steel: #7c8db0;
    --steel-dim: rgba(124, 141, 176, 0.3);
    --steel-faint: rgba(124, 141, 176, 0.15);
    --white: #ffffff;
    --red-alert: #e74c3c;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
    color: var(--slate);
    min-height: 100vh;
    line-height: 1.6;
}

/* ============================================
   APP LAYOUT (sidebar + main)
   ============================================ */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 240px;
    min-width: 240px;
    background: var(--navy-deep);
    border-right: 1px solid var(--steel-dim);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
}

.sidebar .logo-area {
    padding: 0 20px;
    margin-bottom: 30px;
}

.sidebar .logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    display: block;
}

.sidebar .logo-text .brand { color: var(--teal); }

.sidebar .logo-sub {
    font-size: 0.7rem;
    color: var(--steel);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 2px;
}

.sidebar-nav { flex: 1; }

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--slate-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.7;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    opacity: 1;
    background: rgba(42, 157, 143, 0.08);
}

.sidebar-nav a.active {
    opacity: 1;
    border-left-color: var(--teal);
    background: rgba(42, 157, 143, 0.1);
    color: var(--teal-light);
}

.sidebar-nav a svg { width: 18px; height: 18px; fill: currentColor; }

.sidebar-user {
    padding: 16px 20px;
    border-top: 1px solid var(--steel-dim);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-user .user-info { font-size: 0.82rem; }
.sidebar-user .user-name { color: var(--white); font-weight: 600; }
.sidebar-user .user-firm { color: var(--steel); font-size: 0.75rem; }

.sidebar-user .logout-btn {
    background: none;
    border: none;
    color: var(--steel);
    font-size: 0.75rem;
    cursor: pointer;
}
.sidebar-user .logout-btn:hover { color: var(--teal); }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--steel);
    font-size: 0.95rem;
    margin-bottom: 30px;
}

/* ============================================
   CARDS
   ============================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.card {
    background: var(--navy);
    border: 1px solid var(--steel-dim);
    border-radius: 10px;
    padding: 20px;
    transition: all 0.2s;
}

.card:hover {
    border-color: var(--teal);
    box-shadow: 0 0 20px rgba(42, 157, 143, 0.12);
}

.card h3 {
    color: var(--white);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.card p {
    color: var(--steel);
    font-size: 0.88rem;
    line-height: 1.5;
}

.card-icon {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    margin-top: 30px;
}

.section-header h2 {
    color: var(--white);
    font-size: 1.15rem;
}

.section-header:first-child { margin-top: 0; }

/* ============================================
   LINK LISTS
   ============================================ */
.link-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--navy);
    border: 1px solid var(--steel-dim);
    border-radius: 8px;
    text-decoration: none;
    color: var(--slate);
    transition: all 0.2s;
}

.link-item:hover {
    border-color: var(--teal);
    background: rgba(42, 157, 143, 0.05);
}

.link-item .link-icon { font-size: 1.2rem; }

.link-item .link-text {
    flex: 1;
}

.link-item .link-title {
    color: var(--white);
    font-weight: 500;
    font-size: 0.92rem;
}

.link-item .link-desc {
    color: var(--steel);
    font-size: 0.78rem;
    margin-top: 2px;
}

.link-item .link-arrow {
    color: var(--steel);
    font-size: 0.8rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-brand {
    display: inline-block;
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    border: none;
    color: var(--white);
    font-weight: 600;
    padding: 14px 36px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-brand:hover {
    background: linear-gradient(135deg, var(--teal-light) 0%, var(--teal) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(42, 157, 143, 0.3);
}

.btn-secondary {
    display: inline-block;
    background: transparent;
    border: 1px solid var(--teal);
    color: var(--teal);
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(42, 157, 143, 0.1);
    color: var(--teal-light);
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.content-block {
    background: var(--navy);
    border: 1px solid var(--steel-dim);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
}

.content-block h3 {
    color: var(--teal-light);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.8rem;
}

.content-block p,
.content-block li {
    color: var(--slate);
    font-size: 0.9rem;
    line-height: 1.7;
}

.content-block ol,
.content-block ul {
    padding-left: 20px;
}

.content-block li {
    margin-bottom: 6px;
}

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--navy);
    border: 1px solid var(--teal);
    border-radius: 16px;
    padding: 3rem;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 60px rgba(42, 157, 143, 0.12);
}

.login-card .logo-text { font-size: 24px; margin-bottom: 4px; }
.login-card .tagline {
    color: var(--steel);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.login-card h2 {
    color: var(--white);
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
}

.login-card p {
    color: var(--steel);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.form-group { margin-bottom: 1.25rem; text-align: left; }

.form-group label {
    display: block;
    color: var(--slate);
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(27, 42, 74, 0.8);
    border: 1px solid var(--steel);
    color: var(--white);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
}

.form-input::placeholder { color: rgba(232, 236, 241, 0.4); }

.form-input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(42, 157, 143, 0.2);
}

.login-btn { width: 100%; padding: 14px; margin-top: 0.5rem; }

.login-message {
    margin-top: 1.25rem;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    display: none;
}

.login-message.success {
    display: block;
    background: rgba(42, 157, 143, 0.15);
    color: var(--teal-light);
    border: 1px solid rgba(42, 157, 143, 0.3);
}

.login-message.error {
    display: block;
    background: rgba(231, 76, 60, 0.15);
    color: #f5a5a5;
    border: 1px solid rgba(231, 76, 60, 0.3);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .app-layout { flex-direction: column; }
    .sidebar {
        width: 100%;
        min-width: auto;
        flex-direction: row;
        padding: 10px;
        overflow-x: auto;
    }
    .sidebar .logo-area { margin-bottom: 0; padding: 0 10px; }
    .sidebar .logo-sub { display: none; }
    .sidebar-nav { display: flex; }
    .sidebar-nav a {
        padding: 8px 14px;
        border-left: none;
        border-bottom: 2px solid transparent;
        white-space: nowrap;
    }
    .sidebar-nav a.active { border-bottom-color: var(--teal); border-left-color: transparent; }
    .sidebar-user { display: none; }
    .main-content { padding: 20px; }
    .card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 375px) {
    .main-content { padding: 15px; }
    .page-title { font-size: 1.4rem; }
}

/* ============================================
   SIDEBAR SECTION LABELS
   ============================================ */
.sidebar-section-label {
    padding: 20px 20px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--steel);
    opacity: 0.6;
}

/* ============================================
   OPS — SHARED STYLES
   ============================================ */
.ops-loading, .ops-empty, .ops-error {
    padding: 40px;
    text-align: center;
    color: var(--steel);
    font-size: 0.9rem;
}

.ops-error { color: var(--red-alert); }

.ops-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.82rem;
}

.legend-item { display: flex; align-items: center; gap: 6px; color: var(--steel); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-lotterlaw { background: var(--teal); }
.dot-ai { background: #e6a817; }
.dot-conflict { background: var(--red-alert); }

/* ============================================
   OPS — STATS BAR
   ============================================ */
.ops-stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--navy);
    border: 1px solid var(--steel-dim);
    border-radius: 10px;
    padding: 16px 20px;
    min-width: 140px;
    flex: 1;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
}

.stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--steel);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-alert .stat-value { color: var(--red-alert); }
.stat-good .stat-value { color: var(--teal-light); }
.stat-warn .stat-value { color: #e6a817; }

/* ============================================
   OPS — CALENDAR TIMELINE (2-Week)
   ============================================ */
.ops-timeline { display: flex; flex-direction: column; gap: 8px; }

.ops-day {
    background: var(--navy);
    border: 1px solid var(--steel-dim);
    border-radius: 10px;
    padding: 16px;
}

.ops-day-today { border-color: var(--teal); box-shadow: 0 0 12px rgba(42, 157, 143, 0.15); }
.ops-day-weekend { opacity: 0.7; }

.ops-day-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.ops-day-name { color: var(--white); font-weight: 600; font-size: 0.95rem; }
.ops-day-date { color: var(--steel); font-size: 0.85rem; }
.ops-day-count {
    margin-left: auto;
    background: var(--steel-faint);
    color: var(--slate);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
}

.ops-day-empty { color: var(--steel); font-size: 0.82rem; opacity: 0.5; }

.ops-events { display: flex; flex-direction: column; gap: 6px; }

.ops-event-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border-left: 3px solid;
}

.ops-event-card.event-ai {
    border-left-color: #e6a817;
    background: rgba(230, 168, 23, 0.06);
}

.ops-event-card.event-lotterlaw {
    border-left-color: var(--teal);
    background: rgba(42, 157, 143, 0.06);
}

.event-time {
    color: var(--teal-light);
    font-size: 0.82rem;
    font-weight: 500;
    min-width: 80px;
    white-space: nowrap;
}

.event-title { color: var(--white); font-size: 0.9rem; font-weight: 500; }
.event-case-number {
    font-size: 0.8rem;
    color: var(--steel);
    font-family: 'Courier New', monospace;
    font-weight: 500;
    margin-top: 4px;
}
.event-location { color: var(--steel); font-size: 0.78rem; margin-top: 2px; }
.event-source {
    display: inline-block;
    background: rgba(230, 168, 23, 0.2);
    color: #e6a817;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 6px;
}

/* ============================================
   OPS — HEAT MAP (90-Day)
   ============================================ */
.ops-heatmap { margin-bottom: 24px; }

.heatmap-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.heat-cell {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    cursor: default;
}

.heat-0 { background: var(--steel-faint); }
.heat-1 { background: rgba(42, 157, 143, 0.3); }
.heat-2 { background: rgba(42, 157, 143, 0.5); }
.heat-3 { background: rgba(42, 157, 143, 0.7); }
.heat-4 { background: var(--teal); }
.heat-conflict { outline: 2px solid var(--red-alert); outline-offset: -1px; }
.heat-weekend { opacity: 0.5; }

/* ============================================
   OPS — WEEK CARDS (90-Day)
   ============================================ */
.ops-weeks { display: flex; flex-direction: column; gap: 12px; }

.ops-week-card {
    background: var(--navy);
    border: 1px solid var(--steel-dim);
    border-radius: 10px;
    padding: 16px;
}

.ops-week-card.week-has-conflicts { border-color: rgba(231, 76, 60, 0.4); }

.week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.week-range { color: var(--white); font-weight: 600; font-size: 0.95rem; }
.week-summary { color: var(--steel); font-size: 0.82rem; }
.week-conflict-badge {
    background: rgba(231, 76, 60, 0.2);
    color: var(--red-alert);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 8px;
}

.week-days { display: flex; flex-direction: column; gap: 6px; }
.week-empty { color: var(--steel); font-size: 0.82rem; opacity: 0.5; }

.week-day { padding: 8px 12px; border-radius: 6px; background: var(--steel-faint); }
.week-day-conflict { background: rgba(231, 76, 60, 0.08); border-left: 3px solid var(--red-alert); }

.week-day-label { color: var(--white); font-size: 0.85rem; font-weight: 500; }
.week-day-count {
    background: var(--steel-dim);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.7rem;
    margin-left: 6px;
}

.week-day-types { margin-top: 4px; }

.event-type {
    display: inline-block;
    color: var(--steel);
    font-size: 0.75rem;
    margin-right: 8px;
}

.event-type-major { color: var(--teal-light); font-weight: 600; }

/* ============================================
   OPS — AUDIT MONITOR
   ============================================ */
.audit-section { margin-bottom: 30px; }
.section-title { color: var(--white); font-size: 1.1rem; font-weight: 600; margin-bottom: 12px; }
.section-desc { color: var(--steel); font-size: 0.85rem; margin-bottom: 12px; }

.source-grid {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.source-card {
    background: var(--navy);
    border: 1px solid var(--steel-dim);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.source-tag {
    background: rgba(230, 168, 23, 0.2);
    color: #e6a817;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: monospace;
}

.source-count { color: var(--white); font-weight: 700; font-size: 1.1rem; }
.source-label { color: var(--steel); font-size: 0.78rem; }

.audit-list { display: flex; flex-direction: column; gap: 6px; }

.audit-event-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    border-left: 3px solid;
}

.audit-event-card.event-ai {
    border-left-color: #e6a817;
    background: rgba(230, 168, 23, 0.06);
}

.audit-event-card.event-lotterlaw {
    border-left-color: var(--teal);
    background: rgba(42, 157, 143, 0.06);
}

.audit-match-card {
    background: var(--navy);
    border: 1px solid var(--steel-dim);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 8px;
}

.audit-match-card.audit-time-mismatch {
    border-color: rgba(230, 168, 23, 0.4);
}

.match-row { display: flex; gap: 16px; align-items: center; }

.match-side {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
}

.match-ai { background: rgba(230, 168, 23, 0.06); border-left: 3px solid #e6a817; }
.match-ll { background: rgba(42, 157, 143, 0.06); border-left: 3px solid var(--teal); }

.match-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--steel);
    margin-bottom: 4px;
}

.match-title { color: var(--white); font-size: 0.88rem; font-weight: 500; }
.match-time { color: var(--steel); font-size: 0.78rem; margin-top: 2px; }

.match-connector {
    color: var(--steel);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 70px;
    text-align: center;
}

/* ============================================
   OPS — SQUARE INVOICES
   ============================================ */
.invoice-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.invoice-panel {
    background: var(--navy);
    border: 1px solid var(--steel-dim);
    border-radius: 10px;
    padding: 16px;
}

.invoice-panel.panel-red { border-top: 3px solid var(--red-alert); }
.invoice-panel.panel-yellow { border-top: 3px solid #e6a817; }
.invoice-panel.panel-green { border-top: 3px solid var(--teal); }
.invoice-panel.panel-gray { border-top: 3px solid var(--steel); }

.panel-title {
    color: var(--white);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.panel-count { color: var(--steel); font-weight: 400; }
.panel-empty { color: var(--steel); font-size: 0.85rem; opacity: 0.5; padding: 12px 0; }

.invoice-card {
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--steel-faint);
    margin-bottom: 8px;
}

.invoice-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.invoice-customer { color: var(--white); font-weight: 500; font-size: 0.9rem; }
.invoice-amount { color: var(--teal-light); font-weight: 700; font-size: 0.95rem; }

.invoice-bottom {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 6px;
    font-size: 0.78rem;
}

.invoice-number { color: var(--steel); }
.invoice-due { color: var(--steel); }

.invoice-overdue {
    color: var(--red-alert);
    font-weight: 600;
    margin-left: auto;
}

.invoice-upcoming {
    color: #e6a817;
    margin-left: auto;
}

.invoice-paid {
    color: var(--teal);
    margin-left: auto;
}

.invoice-stale {
    color: var(--steel);
    margin-left: auto;
}

/* ============================================
   OPS — RESPONSIVE OVERRIDES
   ============================================ */
@media (max-width: 768px) {
    .ops-stats-bar { flex-direction: column; }
    .stat-card { min-width: auto; }
    .invoice-panels { grid-template-columns: 1fr; }
    .match-row { flex-direction: column; }
    .match-connector { min-width: auto; }
    .heatmap-grid { gap: 2px; }
    .heat-cell { width: 10px; height: 10px; }
    .ops-event-card { flex-direction: column; gap: 4px; }
    .event-time { min-width: auto; }
    .source-grid { flex-direction: column; }
}
