:root {
    --bg: #f8f9fa;
    --sidebar-bg: #1a1d21;
    --sidebar-text: #a0a4a8;
    --sidebar-active: #ffffff;
    --card: #ffffff;
    --ink: #212529;
    --muted: #6c757d;
    --accent: #0f766e;
    --accent-hover: #0b5f59;
    --success: #198754;
    --success-bg: #d1e7dd;
    --error: #dc3545;
    --error-bg: #f8d7da;
    --border: #dee2e6;
    --shadow: rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Layout avec sidebar */
.app {
    display: flex;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    align-items: stretch;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand-icon {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.company-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.company-select:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.company-select:focus {
    outline: none;
    border-color: var(--accent);
}

.company-select option {
    background: var(--sidebar-bg);
    color: #fff;
}

.company-badge {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 13px;
    margin-top: 12px;
}

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

.nav-section {
    padding: 0 12px;
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    color: var(--sidebar-text);
    opacity: 0.6;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--sidebar-text);
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    text-decoration: none;
}

.nav-link.active {
    background: rgba(15, 118, 110, 0.2);
    color: var(--accent);
}

.nav-link-icon {
    font-size: 18px;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sidebar-text);
    font-size: 13px;
}

.logout-link:hover {
    color: #fff;
    text-decoration: none;
}

/* Main content */
.main-content {
    flex: 1;
    margin-left: 240px;
    min-height: 100vh;
    margin-top: 0;
    padding-top: 0;
}

.content-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 20px 32px;
    position: sticky;
    top: 0;
    z-index: 50;
    margin-top: 0;
}

.content-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.content-header-sub {
    color: var(--muted);
    margin: 4px 0 0;
}

.content-body {
    padding: 24px 32px;
}

/* Tabs navigation */
.tabs {
    display: flex;
    gap: 4px;
    background: #f1f3f4;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    padding: 10px 20px;
    border-radius: 8px;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--ink);
    text-decoration: none;
}

.tab.active {
    background: #fff;
    color: var(--ink);
    box-shadow: 0 1px 3px var(--shadow);
}

/* Month navigation */
.month-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.month-nav-arrows {
    display: flex;
    gap: 4px;
}

.month-nav-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--ink);
    text-decoration: none;
}

.month-nav-btn:hover {
    background: var(--bg);
    text-decoration: none;
}

.month-nav-current {
    font-size: 18px;
    font-weight: 600;
    min-width: 200px;
    text-align: center;
}

.month-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.month-pill {
    padding: 8px 18px;
    border-radius: 22px;
    font-size: 14px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--muted);
    transition: all 0.15s ease;
}

.month-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.month-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 1px 3px var(--shadow);
}

.card.narrow {
    max-width: 420px;
    margin: 0 auto;
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

/* KPI Grid */
.kpi-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: 24px;
}

.kpi-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.kpi-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}
.kpi-value .kpi-currency {
    font-size: 0.75em;
    letter-spacing: 0.02em;
}
.kpi-note {
    margin-top: -12px;
    font-size: 12px;
    color: var(--muted);
}

.kpi-sub {
    font-size: 13px;
    color: var(--muted);
    margin-top: 4px;
}

.kpi-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    margin-top: 8px;
}

.kpi-change.up {
    color: var(--success);
}

.kpi-change.down {
    color: var(--error);
}

/* Play cards */
.play-list {
    display: grid;
    gap: 16px;
}

.play-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.15s ease;
}

.play-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--shadow);
}

.play-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.play-header {
    cursor: pointer;
}

.play-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: var(--ink);
}
.play-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.play-info-badges {
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
}
.play-info-badge {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--muted);
    background: #f5f6f7;
}
.play-info-badge.is-active {
    border-color: #22c55e;
    color: #15803d;
    background: #ecfdf3;
}
.play-section-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--muted);
    margin: 8px 0 12px;
    font-weight: 700;
}
.rights-status-badge {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: #eef2ff;
    color: #4338ca;
}

.play-category {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 4px;
    background: #f1f3f4;
    color: var(--muted);
}

.play-authors {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.author-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f8f9fa;
    border-radius: 20px;
    font-size: 13px;
}

.author-badge-percent {
    font-weight: 600;
    color: var(--accent);
}

.play-stats {
    display: flex;
    gap: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.play-stat {
    display: flex;
    flex-direction: column;
}

.play-stat-label {
    font-size: 12px;
    color: var(--muted);
}

.play-stat-value {
    font-size: 16px;
    font-weight: 600;
}

.play-stat-value.accent {
    color: var(--accent);
}

.play-notes {
    padding-top: 12px;
    border-top: 1px dashed var(--border);
    margin-top: 12px;
}

/* Performance table */
.perf-table {
    width: 100%;
    border-collapse: collapse;
}

.perf-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--muted);
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
}

.perf-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.perf-table tbody tr {
    transition: background 0.1s ease;
}

.perf-table tbody tr:hover {
    background: #f8f9fa;
}

.row-link {
    cursor: pointer;
}

.row-link:hover {
    background: #f5f6f7;
}

.detail-card {
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.15);
    background: #fffaf4;
}

.perf-date {
    font-weight: 600;
}

.perf-time {
    color: var(--muted);
    font-size: 13px;
}

.perf-play {
    font-weight: 500;
}

.perf-spectators {
    display: flex;
    align-items: center;
    gap: 8px;
}

.perf-spectators-paid {
    font-weight: 600;
}

.perf-spectators-inv {
    color: var(--muted);
    font-size: 13px;
}

.perf-revenue {
    font-weight: 600;
    color: var(--success);
}

.perf-rights {
    color: var(--accent);
    font-weight: 500;
}

.perf-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    background: #f0f0f0;
    color: #666;
}

.perf-status.ok {
    background: var(--success-bg);
    color: var(--success);
}

.perf-status.attente {
    background: #fff3cd;
    color: #856404;
}

.perf-status.annule {
    background: var(--error-bg);
    color: var(--error);
}

.perf-actions {
    display: flex;
    gap: 8px;
}

/* Inline editable */
.editable {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    transition: all 0.15s ease;
    cursor: pointer;
    min-width: 60px;
}

.editable:hover {
    background: #f1f3f4;
    border-color: var(--border);
}

.editable:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
}

.editable-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Forms */
.form {
    display: grid;
    gap: 20px;
}

.form-row {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
}

.form-label .required {
    color: var(--error);
}

input, select, textarea {
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
}

input[type="number"] {
    font-variant-numeric: tabular-nums;
}

/* Payment fields grid */
.payment-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    padding: 20px;
    background: #f8f9fa;
    border-radius: var(--radius);
}

.payment-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.payment-field label {
    font-size: 12px;
    color: var(--muted);
}

.payment-field input {
    padding: 8px 10px;
    font-size: 13px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: var(--ink);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg);
}

.btn-ghost {
    background: transparent;
    color: var(--accent);
}

.btn-ghost:hover {
    background: rgba(15, 118, 110, 0.1);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 6px;
}

.btn-danger {
    background: var(--error);
    color: #fff;
}

.btn-danger:hover {
    background: #c82333;
    color: #fff;
}

/* Actions row */
.actions-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.actions-row.right {
    justify-content: flex-end;
}

/* Alert messages */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-sticky {
    position: sticky;
    top: 8px;
    z-index: 90;
}

.alert.success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #a3cfbb;
}

.alert.error {
    background: var(--error-bg);
    color: var(--error);
    border: 1px solid #f1aeb5;
}

/* Table wrapper */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

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

thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--muted);
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

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

tbody tr:hover {
    background: #f8f9fa;
}

.table-actions {
    display: flex;
    gap: 8px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 8px;
}

/* Grid layouts */
.grid-2 {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(3, 1fr);
}

.grid-auto {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Summary section */
.summary-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
    border-radius: var(--radius);
    color: #fff;
    margin-bottom: 24px;
}

.summary-item {
    text-align: center;
}

.summary-label {
    font-size: 12px;
    opacity: 0.85;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
}

/* Rights breakdown */
.rights-breakdown {
    background: #fffbf5;
    border: 1px solid #ffecd1;
    border-radius: var(--radius);
    padding: 20px;
}

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

.rights-total {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
}

.rights-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rights-author {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.rights-author-name {
    font-weight: 500;
}

.rights-author-share {
    color: var(--muted);
    font-size: 13px;
}

.rights-author-amount {
    font-weight: 600;
    color: var(--accent);
}

.rights-author-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rights-share-form {
    display: flex;
    align-items: center;
    gap: 4px;
}

.share-input {
    width: 70px;
    padding: 4px 8px;
    font-size: 13px;
    text-align: right;
}

.share-suffix {
    font-size: 13px;
    color: var(--muted);
}

.authors-select-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.author-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s ease;
}

.author-checkbox:hover {
    border-color: var(--accent);
}
.cachets-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.cachets-indicator {
    font-size: 13px;
    color: var(--text-secondary);
    background: #f8f9fa;
    border: 1px solid var(--border);
    padding: 6px 10px;
    border-radius: 20px;
}
.cachets-play-block {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 12px;
    background: #fff;
}
.cachets-play-title {
    font-weight: 600;
    margin-bottom: 8px;
}
.cachets-perf-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px dashed var(--border);
}
.cachets-perf-row:first-of-type {
    border-top: none;
}
.cachets-perf-date {
    font-weight: 600;
}
.cachets-perf-sub {
    font-size: 12px;
    color: var(--text-secondary);
}
.cachets-comediens {
    display: grid;
    gap: 8px;
}
.cachets-comedien-row {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cachets-comedien-name {
    min-width: 160px;
    font-weight: 600;
}
.cachets-alternant {
    max-width: 220px;
}
.cachets-comedien-block {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
    background: #fff;
}
.cachets-comedien-title {
    font-weight: 600;
    margin-bottom: 8px;
}
.cachets-line {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
    background: #fdfdfd;
}
.cachets-line.is-drop {
    border-color: var(--accent);
    background: #f6fbff;
}
.cachets-line-title {
    font-weight: 600;
    margin-bottom: 6px;
}
.cachets-tokens {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}
.cachets-token {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: grab;
    border: 1px solid var(--border);
    background: #fff;
}
.cachets-token.is-adulte {
    border-color: #22c55e;
    color: #15803d;
    background: #ecfdf3;
}
.cachets-token.is-enfant {
    border-color: #f59e0b;
    color: #b45309;
    background: #fff7ed;
}
.cachets-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}
.cachets-chip {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 12px;
    background: #f3f4f6;
    color: var(--text-secondary);
}
.cachets-chip.is-plus {
    background: #ecfdf3;
    color: #15803d;
}
.cachets-chip.is-minus {
    background: #f3f4f6;
    color: #6b7280;
}
.cachets-line-total {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
}
.cachets-comedien-totals {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    border-top: 1px dashed var(--border);
    padding-top: 8px;
}
.cachets-total-card {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
}
.cachets-total-label {
    font-weight: 600;
    margin-bottom: 4px;
}
.cachets-total-values {
    font-size: 13px;
    color: var(--text-secondary);
}
@media (max-width: 900px) {
    .cachets-perf-row {
        grid-template-columns: 1fr;
    }
}

.author-checkbox input:checked + span {
    color: var(--accent);
    font-weight: 500;
}

.calc-hierarchy .calc-level-0 td {
    padding-top: 12px;
    padding-bottom: 12px;
}

.calc-hierarchy .calc-level-1 td {
    padding-left: 16px;
    font-size: 12px;
}

.summary-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Filters */
.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: 24px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-label {
    font-size: 12px;
    color: var(--muted);
}

/* Year tabs */
.year-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.year-tab {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--muted);
    transition: all 0.15s ease;
}

.year-tab:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
}

.year-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Detail view */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.detail-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    margin-bottom: 16px;
}

.detail-back:hover {
    color: var(--ink);
    text-decoration: none;
}

.detail-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
}

.detail-meta {
    display: flex;
    gap: 20px;
    color: var(--muted);
}

/* Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #fff;
    border-radius: var(--radius);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.2s ease;
}

.modal-backdrop.active .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--muted);
}

.modal-close:hover {
    background: var(--bg);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px var(--shadow);
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo-icon {
    width: 56px;
    height: 56px;
    background: var(--accent);
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    margin-bottom: 16px;
}

.login-logo h1 {
    font-size: 24px;
    margin: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }

    .main-content {
        margin-left: 200px;
    }
}

@media (max-width: 768px) {
    .app {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
    }

    .sidebar-nav {
        display: none;
    }

    .sidebar.open .sidebar-nav {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .content-body {
        padding: 16px;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .summary-bar {
        flex-wrap: wrap;
        gap: 16px;
    }

    .month-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Utility classes */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-right { text-align: right; }
.text-center { text-align: center; }

.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

.hidden { display: none; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Collapsible card */
.collapsible-card {
    overflow: hidden;
}
.card-header-collapsible {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 16px 24px;
    margin: -24px -24px 0;
    background: #f8f9fa;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s ease;
}
.card-header-collapsible:hover {
    background: #f0f1f2;
}
.card-header-collapsible .card-title {
    margin: 0;
}
.collapse-icon {
    font-size: 24px;
    font-weight: 300;
    color: var(--accent);
    transition: transform 0.2s ease;
}
.collapsible-card.open .collapse-icon {
    transform: rotate(45deg);
}
.card-content-collapsible {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding: 0;
}
.collapsible-card.open .card-content-collapsible {
    max-height: 2000px;
    padding: 24px 0 0;
}

/* Color input */
.color-input {
    width: 50px;
    height: 38px;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border);
    cursor: pointer;
}
.color-input::-webkit-color-swatch-wrapper {
    padding: 2px;
}
.color-input::-webkit-color-swatch {
    border-radius: 4px;
    border: none;
}

/* Play color dot */
.play-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
}
