/* ═══ MAIN CONTENT ═══ */
.main-content {
    margin-left: var(--sidebar-w);
    margin-top: 52px;
    min-height: calc(100vh - 52px);
}
.content-area {
    max-width: 1100px;
    padding: 28px 36px 48px;
}

/* ═══ OVERVIEW ═══ */
.overview { }
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 22px;
    text-align: center;
    border-radius: 4px;
}
.stat-card .stat-num {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--black);
}
.stat-card .stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--light-text);
    margin-top: 4px;
}
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.chart-panel {
    background: var(--white);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 4px;
}
.chart-panel h3 {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}
.bar-item { display: flex; align-items: center; margin-bottom: 7px; }
.bar-lbl {
    width: 130px;
    font-size: 12px;
    color: var(--mid);
    text-align: right;
    padding-right: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bar-bg { flex: 1; height: 18px; background: var(--border-light); position: relative; border-radius: 2px; }
.bar-fg { height: 100%; background: var(--accent); transition: width 0.5s; border-radius: 2px; }
.bar-n { width: 36px; padding-left: 10px; font-size: 12px; font-weight: 600; }

/* ═══ SECTION HEADER ═══ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0 0 14px;
    border-bottom: 2px solid var(--black);
    margin-bottom: 0;
}
.section-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-weight: 700;
}
.section-header .sub { font-size: 13px; color: var(--light-text); }

/* ═══ CASE DIGEST ═══ */
.digest { }
.case-item {
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.1s;
}
.case-item:hover { background: var(--accent-light); margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.case-row-1 {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
}
.c-citation {
    font-family: 'Lora', Georgia, serif;
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
}
.c-court-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--light-text);
    background: var(--border-light);
    padding: 2px 8px;
    border-radius: 2px;
}
.c-date { font-size: 13px; color: var(--light-text); margin-left: auto; }
.c-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 6px;
    line-height: 1.4;
}
.c-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.c-tag {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 2px 8px;
    border-radius: 2px;
}
.t-area { background: var(--accent-light); color: var(--accent); }
.t-type { background: var(--gold-light); color: var(--gold); }
.t-outcome { background: var(--border-light); color: var(--mid); }
.c-summary {
    font-family: 'Lora', Georgia, serif;
    font-size: 13.5px;
    line-height: 1.7;
    color: #444;
}
.c-damages {
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
    margin-top: 4px;
}
.c-judge {
    font-size: 12px;
    color: var(--light-text);
    margin-top: 2px;
}

/* ═══ HEADNOTES ═══ */
.headnotes { }
.hn-item {
    background: var(--white);
    border: 1px solid var(--border);
    margin-bottom: 20px;
    cursor: pointer;
    transition: box-shadow 0.15s;
    border-radius: 4px;
    overflow: hidden;
}
.hn-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.hn-top {
    padding: 20px 28px 14px;
    border-bottom: 1px solid var(--border-light);
}
.hn-citation {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 2px;
}
.hn-casename {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}
.hn-meta { font-size: 12px; color: var(--light-text); }
.hn-fields {
    display: flex;
    gap: 20px;
    padding: 12px 28px;
    background: var(--bg);
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}
.hn-fld label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--light-text);
    margin-bottom: 2px;
}
.hn-fld span { font-size: 13px; font-weight: 500; color: var(--dark); }
.hn-body {
    padding: 22px 28px;
    font-family: 'Lora', Georgia, serif;
    font-size: 14px;
    line-height: 1.85;
    color: #333;
    text-align: justify;
}

/* ═══ QUANTUM DATABASE ═══ */
.quantum { }
.q-controls {
    display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
    padding: 16px 0; border-bottom: 1px solid var(--border); margin-bottom: 0;
}
.q-controls label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--light-text); }
.q-select {
    padding: 7px 10px; border: 1px solid var(--border); font-size: 13px;
    font-family: inherit; background: white; border-radius: 4px;
}
.q-stats {
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
    background: var(--white); border: 1px solid var(--border); margin: 20px 0;
    border-radius: 4px; overflow: hidden;
}
.q-stat {
    padding: 18px 20px; text-align: center;
    border-right: 1px solid var(--border-light);
}
.q-stat:last-child { border-right: none; }
.q-stat .qs-num {
    font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: var(--green);
}
.q-stat .qs-label {
    font-size: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.8px; color: var(--light-text); margin-top: 4px;
}
.q-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.q-table thead { background: var(--black); color: white; }
.q-table th {
    padding: 11px 14px; text-align: left; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600;
}
.q-table td {
    padding: 12px 14px; border-bottom: 1px solid var(--border-light);
    font-size: 13px; vertical-align: top;
}
.q-table tr:hover td { background: var(--accent-light); }
.q-table .q-amount { font-weight: 600; color: var(--green); white-space: nowrap; }
.q-table .q-cite {
    font-family: 'Lora', serif; font-weight: 600; color: var(--accent); cursor: pointer;
}
.q-table .q-cite:hover { text-decoration: underline; }
.q-table .q-detail { font-size: 12px; color: var(--mid); max-width: 280px; }
.q-range-bar {
    background: var(--white); border: 1px solid var(--border); padding: 22px 28px; margin: 20px 0;
    border-radius: 4px;
}
.q-range-bar h4 {
    font-family: 'Playfair Display', serif; font-size: 14px; margin-bottom: 16px;
}
.q-range-visual { position: relative; height: 40px; margin: 0 60px; }
.q-range-track { position: absolute; top: 16px; left: 0; right: 0; height: 8px; background: var(--border-light); border-radius: 4px; }
.q-range-fill { position: absolute; top: 16px; height: 8px; background: var(--accent); border-radius: 4px; }
.q-range-marker {
    position: absolute; top: 0;
    font-size: 11px; font-weight: 600; color: var(--dark);
    transform: translateX(-50%); text-align: center; white-space: nowrap;
}
.q-range-marker .q-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--black); margin: 4px auto; }
.q-empty { padding: 60px; text-align: center; color: var(--light-text); font-size: 15px; background: var(--white); border: 1px solid var(--border); border-radius: 4px; }

/* ═══ PRACTICE DIGEST ═══ */
.practice-digest { }
.pd-controls {
    display: flex; justify-content: flex-end; padding: 0 0 16px;
}
.pd-period-select { padding: 7px 10px; border: 1px solid var(--border); font-size: 13px; font-family: inherit; border-radius: 4px; }
.pd-section { margin-bottom: 24px; border-radius: 4px; overflow: hidden; }
.pd-section-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 20px; background: var(--black); color: white;
    font-size: 14px; font-weight: 600;
}
.pd-section-count { font-size: 12px; opacity: 0.6; }
.pd-case {
    padding: 14px 20px; border: 1px solid var(--border); border-top: none;
    background: var(--white); cursor: pointer; transition: background 0.1s;
}
.pd-case:hover { background: var(--accent-light); }
.pd-case-top { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.pd-cite { font-family: 'Lora', serif; font-weight: 600; color: var(--accent); font-size: 14px; }
.pd-date { font-size: 12px; color: var(--light-text); margin-left: auto; }
.pd-case-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.pd-case-summary { font-size: 13px; color: var(--mid); line-height: 1.5; }
.pd-case-outcome { font-size: 12px; font-weight: 600; margin-top: 4px; }

/* ═══ LEGISLATION & TESTS ═══ */
.leg-view { }
.leg-controls {
    display: flex; justify-content: flex-end; padding: 0 0 16px;
}
.leg-search {
    padding: 8px 14px; border: 1px solid var(--border); border-radius: 4px;
    font-size: 13px; font-family: inherit; width: 280px;
}
.leg-search:focus { outline: none; border-color: var(--black); }
.leg-grid { display: grid; grid-template-columns: 320px 1fr; gap: 0; background: var(--white); border: 1px solid var(--border); min-height: 500px; border-radius: 4px; overflow: hidden; }
.leg-list {
    border-right: 1px solid var(--border); overflow-y: auto; max-height: 700px;
}
.leg-item {
    padding: 11px 18px; border-bottom: 1px solid var(--border-light);
    cursor: pointer; transition: background 0.1s;
    display: flex; justify-content: space-between; align-items: center;
}
.leg-item:hover { background: var(--accent-light); }
.leg-item.active { background: var(--accent-light); border-left: 3px solid var(--accent); }
.leg-item-name { font-size: 13px; font-weight: 500; color: var(--dark); flex: 1; }
.leg-item-count {
    font-size: 11px; font-weight: 700; color: var(--white); background: var(--accent);
    padding: 2px 8px; border-radius: 10px; margin-left: 10px; min-width: 24px; text-align: center;
}
.leg-detail { padding: 24px; overflow-y: auto; max-height: 700px; }
.leg-detail-title {
    font-family: 'Playfair Display', serif; font-size: 17px; font-weight: 700;
    margin-bottom: 4px; color: var(--black);
}
.leg-detail-count { font-size: 13px; color: var(--light-text); margin-bottom: 20px; }
.leg-case {
    padding: 12px 0; border-bottom: 1px solid var(--border-light); cursor: pointer;
}
.leg-case:hover { background: var(--accent-light); margin: 0 -12px; padding-left: 12px; padding-right: 12px; }
.leg-case-cite { font-family: 'Lora', serif; font-weight: 600; color: var(--accent); font-size: 14px; }
.leg-case-title { font-size: 13px; font-weight: 500; margin-top: 2px; }
.leg-case-meta { font-size: 12px; color: var(--light-text); margin-top: 2px; }
.leg-case-summary { font-size: 13px; color: var(--mid); margin-top: 4px; line-height: 1.5; }
.leg-empty { padding: 40px; text-align: center; color: var(--light-text); font-size: 14px; }

/* ═══ JUDGE PROFILES ═══ */
.judges { }
.judge-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px;
    margin-top: 16px;
}
.judge-card {
    background: var(--white); border: 1px solid var(--border); border-radius: 4px;
    padding: 20px 24px; cursor: pointer; transition: box-shadow 0.15s;
}
.judge-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.judge-name {
    font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 700;
    color: var(--black); margin-bottom: 8px;
}
.judge-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.judge-stat {
    font-size: 12px; color: var(--mid);
}
.judge-stat strong { color: var(--black); font-size: 14px; }
.judge-areas { margin-top: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.judge-area-tag { font-size: 10px; padding: 2px 6px; background: var(--accent-light); color: var(--accent); border-radius: 2px; font-weight: 600; }
