:root {
    --green: #0f6b46;
    --green2: #0a4c34;
    --mint: #eaf5ef;
    --line: #dfe8e2;
    --text: #17322a;
    --muted: #687a73;
    --bg: #f5f7f6;
    --panel: #ffffff;
    --soft: #f8faf8;
    --danger: #a93434;
    --shadow: 0 8px 22px rgba(15,107,70,.08);
}

* { box-sizing: border-box; }
html, body, table, tr, th, td, .cal-event, .compact-print-event, .planner-shift, .shift-legend i, .print-legend i, .legend-dot, .legend-swatch, .row-alert, .row-warning {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
}
body { margin: 0; background: var(--bg); color: var(--text); font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.35; }
h1, h2, h3 { line-height: 1.18; margin: 0 0 10px; }
h1 { font-size: 26px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0 0 10px; }
.topbar { background: linear-gradient(135deg,var(--green),var(--green2)); color: #fff; padding: 10px 16px; display: flex; justify-content: space-between; gap: 12px; align-items: center; box-shadow: 0 3px 14px rgba(6,45,31,.14); }
.brand { display: flex; gap: 10px; align-items: center; min-width: 230px; }
.brand strong { display: block; line-height: 1.1; }
.brand-mark { width: 36px; height: 36px; border-radius: 8px; border: 1px solid rgba(255,255,255,.9); display: grid; place-items: center; font-weight: 900; }
.brand-logo { width: 36px; height: 36px; object-fit: contain; background: #fff; border-radius: 8px; padding: 3px; }
.brand span { display: block; font-size: 11px; opacity: .85; }
.nav { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { color: #fff; text-decoration: none; background: rgba(255,255,255,.13); padding: 6px 8px; border-radius: 6px; font-size: 13px; line-height: 1.1; }
.nav a:hover { background: rgba(255,255,255,.24); }
.top-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.notification-menu { position: relative; }
.notification-toggle { position: relative; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.35); border-radius: 7px; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; display: grid; place-items: center; }
.notification-toggle:hover { background: rgba(255,255,255,.24); }
.bell-icon { font-size: 16px; line-height: 1; }
.notification-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #fff7e6; color: #7a4a00; border: 1px solid #f2c36b; font-size: 11px; font-weight: 900; display: grid; place-items: center; }
.notification-dropdown { position: absolute; right: 0; top: 40px; width: min(360px, calc(100vw - 24px)); background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 10px; box-shadow: var(--shadow); z-index: 50; }
.notification-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.notification-head span { color: var(--muted); font-size: 12px; font-weight: 800; }
.notification-list { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; max-height: 340px; overflow: auto; }
.notification-item { display: flex; flex-direction: column; gap: 2px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--text); text-decoration: none; }
.notification-item:hover { background: var(--mint); }
.notification-item span { color: var(--muted); font-size: 12px; line-height: 1.3; }
.notification-item em { color: var(--muted); font-style: normal; font-size: 11px; }
.notification-empty { color: var(--muted); padding: 10px 4px; }
.container { max-width: 1360px; margin: 16px auto; padding: 0 14px; }
.footer { text-align: center; color: var(--muted); padding: 14px; font-size: 12px; }
.card, .login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.login-card { max-width: 420px; margin: 36px auto; }
.page-title { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.page-title h1 { margin-bottom: 0; }
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.grid.four { grid-template-columns: repeat(4,minmax(0,1fr)); }
.form-stack { display: flex; flex-direction: column; gap: 10px; }
label { font-weight: 800; font-size: 13px; }
input, select, textarea { width: 100%; padding: 8px 9px; margin-top: 4px; border: 1px solid #cfdcd5; border-radius: 6px; font: inherit; background: #fff; }
textarea { min-height: 86px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(15,107,70,.18); border-color: var(--green); }
.toolbar, .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.compact { background: var(--mint); padding: 10px; border-radius: 8px; border: 1px solid var(--line); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; background: #fff; color: var(--green2); font-size: 13px; font-weight: 800; text-decoration: none; cursor: pointer; line-height: 1.15; min-height: 32px; }
.btn:hover { border-color: #b7c9c0; background: #f9fbfa; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover { background: var(--green2); }
.btn.small { font-size: 12px; padding: 5px 7px; min-height: 28px; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #8d2929; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.flash { padding: 10px; border-radius: 8px; margin-bottom: 12px; border: 1px solid transparent; }
.flash.success { background: #edf8f1; }
.flash.error { background: #fff0f0; color: #7b2222; }
.flash.warning { background: #fff7e6; color: #7a4a00; }
.admin-card { display: flex; flex-direction: column; gap: 5px; min-height: 76px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-decoration: none; color: var(--text); box-shadow: var(--shadow); }
.admin-card:hover { border-color: #b7c9c0; background: #fbfdfc; transform: translateY(-1px); }
.admin-card strong { font-size: 15px; line-height: 1.1; }
.admin-card span { color: var(--muted); font-size: 12px; line-height: 1.25; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 7px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--soft); color: #456259; font-size: 11px; text-transform: uppercase; letter-spacing: 0; }
tbody tr:hover { background: #fbfdfc; }
.inline { display: inline; }
.muted { color: var(--muted); }
.color-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: middle; }
.brand-preview { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 8px; background: linear-gradient(135deg,var(--green),var(--green2)); color: #fff; }
.apple-month-calendar { display: grid !important; grid-template-columns: repeat(7,minmax(0,1fr)) !important; border: 1px solid #d1d5db; background: #d1d5db; border-radius: 8px; overflow: hidden; }
.apple-calendar-head { height: 30px; background: #f8fafc; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900; }
.apple-calendar-cell { min-height: 104px; background: #fff; border: 1px solid #d1d5db; padding: 4px; overflow: hidden; }
.apple-calendar-cell.outside { background: #f3f4f6; color: #9ca3af; }
.apple-cell-date { text-align: right; font-size: 12px; font-weight: 900; margin-bottom: 3px; }
.cal-event.month-min { display: flex; gap: 3px; align-items: center; padding: 2px 4px; margin: 2px 0; border-left: 3px solid var(--svc,var(--green)); border-radius: 4px; background: var(--svc-bg,var(--mint)); font-size: 9px; line-height: 1; min-height: 15px; overflow: hidden; }
.cal-code { font-weight: 900; }
.cal-event em { font-size: 8px; font-style: normal; }
.stat-card span { display: block; color: var(--muted); font-weight: 800; }
.stat-card strong { display: block; font-size: 26px; color: var(--green2); margin-top: 4px; line-height: 1; }
.row-alert { background: #fff5f5; }
.row-warning { background: #fffaf0; }
.notification-pop { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: #fff7e6; border: 1px solid #f2c36b; border-left: 4px solid #f2994a; border-radius: 8px; padding: 12px; margin-bottom: 12px; box-shadow: var(--shadow); }
.notification-pop strong { font-size: 15px; color: #7a4a00; }
.notification-pop span { color: #7a4a00; font-size: 12px; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 7px; font-size: 11px; line-height: 1.35; font-weight: 800; background: var(--mint); color: var(--green2); }
.badge.danger { background: #fff0f0; color: #a93434; border: 1px solid #e2b8b8; }
.badge.warning { background: #fff7e6; color: #7a4a00; border: 1px solid #f2c36b; }
.stats-grid { margin-bottom: 12px; }
.stats-grid .stat-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--soft); }
.schedule-note { margin-top: 0; }
.field-help { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.calendar-filters label { min-width: 145px; }
.shift-legend, .print-legend { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.shift-legend span, .print-legend span { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; background: #fff; padding: 4px 8px; font-size: 12px; font-weight: 800; }
.shift-legend i, .print-legend i, .legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); flex: 0 0 auto; }
.legend-dot { margin-right: 5px; vertical-align: -1px; }
.legend-swatch { display: inline-block; width: 42px; height: 18px; border-radius: 4px; border: 1px solid rgba(0,0,0,.12); }
.check { display: flex; align-items: center; gap: 7px; }
.check input { width: auto; margin-top: 0; }
.check-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin-top: 6px; }
.overtime-warning { display: flex; flex-direction: column; gap: 4px; border: 1px solid #f2c36b; border-left: 4px solid #f2994a; background: #fff7e6; color: #7a4a00; border-radius: 8px; padding: 10px 12px; }
.overtime-warning[hidden] { display: none; }
.overtime-warning span { font-weight: 600; }
.print-table { width: 100%; border-collapse: collapse; }
.print-table th, .print-table td { border: 1px solid var(--line); padding: 6px; }
.print-actions { margin-bottom: 10px; }
.print-logo { max-width: 48px; max-height: 48px; }
.print-brand-mark { width: 48px; height: 48px; border-radius: 8px; border: 1px solid var(--green); color: var(--green2); display: grid; place-items: center; font-weight: 900; margin-bottom: 4px; }
.print-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.legend-table { max-width: 760px; }
.planner-wrap { width: 100%; overflow: auto; }
.planner-table { width: 100%; min-width: 1120px; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
.planner-table th, .planner-table td { border: 1px solid var(--line); padding: 4px; text-align: center; vertical-align: top; }
.planner-table thead th { background: var(--soft); }
.planner-table thead th span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.planner-table .planner-name { width: 160px; text-align: left; background: #fff; font-weight: 900; }
.planner-shift { display: block; border-left: 3px solid var(--svc,var(--green)); border-radius: 4px; background: var(--svc-bg,var(--mint)); padding: 2px 3px; margin: 1px 0; line-height: 1.05; }
.planner-shift b { display: block; }
.planner-shift em { display: block; font-size: 8px; font-style: normal; color: var(--muted); }
.privacy-doc { background: #fff; border-radius: 8px; padding: 22px; }
.privacy-data-table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.privacy-data-table th { width: 210px; }
.privacy-data-table th, .privacy-data-table td { border: 1px solid var(--line); padding: 8px; text-align: left; }
.privacy-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 28px; }
.privacy-signatures div { border-top: 1px solid #9aa; padding-top: 10px; }
.data-list { display: grid; grid-template-columns: 160px 1fr; gap: 8px 12px; }
.data-list dd { margin: 0; }
.compact-print-event { display: flex; gap: 2px; align-items: center; font-size: 7px; line-height: 1; padding: 1px 2px; border-left: 3px solid var(--svc,var(--green)); background: var(--svc-bg,var(--mint)); margin: 1px 0; border-radius: 3px; }
.compact-print-event span { font-weight: 900; margin-right: 2px; }
.compact-print-event strong { font-weight: 900; }
.compact-print-event em { font-size: 6px; font-style: normal; }
.table-wrap { width: 100%; overflow: auto; }
.steps { margin: 0; padding-left: 22px; }
.steps li { margin: 6px 0; }
.soft-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--soft); }
.soft-box summary { cursor: pointer; font-weight: 900; color: var(--green2); }
.role-qty-list label { display: grid; gap: 4px; }

@media (max-width: 900px) {
    .grid.two, .grid.three, .grid.four { grid-template-columns: 1fr; }
    .topbar, .page-title { flex-direction: column; }
    .topbar { align-items: stretch; }
    .brand { min-width: 0; }
    .top-actions { width: 100%; align-items: flex-start; justify-content: space-between; }
    .nav { justify-content: flex-start; }
    .check-list { grid-template-columns: 1fr; }
    .apple-month-calendar { grid-template-columns: repeat(7,146px) !important; overflow-x: auto; }
    .notification-pop { align-items: flex-start; flex-direction: column; }
}

@media print {
    @page { size: A4 landscape; margin: 5mm; }
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }
    body.print-page { background: #fff !important; }
    .no-print, .topbar, .footer { display: none !important; }
    .print-shell { height: auto; overflow: visible; background: #fff !important; }
    .print-header { margin-bottom: 3mm; }
    .apple-calendar-head { height: 7mm; font-size: 8px; }
    .apple-calendar-cell { min-height: 0; height: 25mm; padding: 1mm; }
    .apple-cell-date { font-size: 8px; }
    .cal-event.month-min, .compact-print-event, .planner-shift {
        background: var(--svc-bg,var(--mint)) !important;
        border-left-color: var(--svc,var(--green)) !important;
    }
    .compact-print-event { font-size: 6px; }
    .print-legend { gap: 2mm; margin-top: 3mm; }
    .print-legend span { padding: 1mm 2mm; font-size: 7px; }
    .print-legend i, .legend-dot {
        box-shadow: inset 0 0 0 20px currentColor;
    }
    .legend-swatch {
        box-shadow: inset 0 0 0 30px currentColor;
    }
    .legend-table th, .legend-table td { font-size: 10px; }
    .privacy-print-page { page: privacy; }
    .privacy-print-page .privacy-doc { padding: 0; }
    .privacy-print-page .print-shell { height: auto; overflow: visible; }
    @page privacy { size: A4 portrait; margin: 10mm; }
    .planner-print-page { page: planner; }
    .planner-print-page .print-shell { height: auto; overflow: visible; }
    .planner-table { min-width: 0; font-size: 6px; }
    .planner-table th, .planner-table td { padding: .7mm .5mm; }
    .planner-table .planner-name { width: 32mm; }
    .planner-table thead th span { font-size: 5px; }
    .planner-shift { border-left-width: 1.5px; border-radius: 2px; padding: .3mm; }
    .planner-shift em { font-size: 5px; }
    @page planner { size: A4 landscape; margin: 5mm; }
}
