    /* VAALEA TEEMA (Oletus) */
    :root {
        --accent: #E14D2A; --accent-hover: #C2410C; --accent2: #F59E0B; --teal: #0D9488;
        --bg: #F4F7F9; --surface: #FFFFFF; --surface2: #F8FAFC; --border: #E2E8F0; --border2: #CBD5E1;
        --text: #0F172A; --text2: #475569; --text3: #64748B;
        --own: #0D9488; --own-bg: rgba(13, 148, 136, 0.1);
        --shift-other: #3B82F6; --shift-other-bg: rgba(59, 130, 246, 0.1);
        --event-color: #E14D2A; --radius: 16px; --radius-sm: 8px; --shadow-sm: 0 2px 8px rgba(0,0,0,0.02);
    }

    /* TUMMA TEEMA (Dark Mode) */
    [data-theme="dark"] {
        --bg: #0B0F19; --surface: #151A2A; --surface2: #1E2538; --border: #2A314A; --border2: #3E4765;
        --text: #F8FAFC; --text2: #CBD5E1; --text3: #8B98AD; --shadow-sm: 0 4px 12px rgba(0,0,0,0.3);
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }
    body { font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; padding-bottom: 72px; transition: background 0.3s, color 0.3s; }

    ::-webkit-scrollbar { width: 8px; height: 8px; }
    ::-webkit-scrollbar-track { background: transparent; }
    ::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }

    .app-container { display: flex; flex-direction: column; min-height: 100vh; }
    .main-content { flex: 1; padding: 24px 20px; max-width: 1400px; margin: 0 auto; width: 100%; overflow-x: hidden; }

    .top-bar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1100; }
    .user-info-badge { font-size: 12px; font-weight: 700; color: var(--accent); background: rgba(225, 77, 42, 0.08); padding: 6px 12px; border-radius: 100px; }

    .nav-bar { background: var(--surface); border-top: 1px solid var(--border); display: flex; position: fixed; bottom: 0; width: 100%; height: 72px; z-index: 1000; }
    .nav-btn { position: relative; background: none; border: none; color: var(--text3); flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; cursor: pointer; gap: 6px; }
    .nav-btn i { font-size: 22px; transition: transform 0.2s; }
    .nav-btn.active { color: var(--accent); }
    .nav-btn.active i { transform: scale(1.15); }

    .nav-logo { display: none; }
    .content-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
    .top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
    .top-actions .btn { text-decoration: none; }
    .top-actions .top-active { color: var(--accent); border-color: var(--accent); background: rgba(225, 77, 42, 0.08); }
    .top-actions .top-logout:hover { color: #E11D48; border-color: #E11D48; }
    .top-logo { display: block; }
    @media (max-width: 520px) { .top-bar { padding: 10px 12px; } .top-badge { display: none; } .top-actions { gap: 6px; } }
    .nav-logo-text { font-family: 'Syne', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 22px; font-weight: 800; color: var(--text); }
    .nav-logo-text span { color: var(--accent); }

    .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
    .card-sm { padding: 16px; }

    .page-header { margin-bottom: 24px; }
    .page-title { font-family: 'Syne', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 28px; font-weight: 800; color: var(--text); }
    
    .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-sm); border: none; font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
    .btn-primary { background: var(--accent); color: #fff; }
    .btn-primary:hover { background: var(--accent-hover); }
    .btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
    .btn-danger { background: rgba(225, 29, 72, 0.1); color: #E11D48; border: 1px solid rgba(225, 29, 72, 0.2); }
    .btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
    .btn-icon { padding: 8px; width: 36px; height: 36px; }

    .form-group { display: flex; flex-direction: column; gap: 6px; }
    .form-label { font-size: 11px; font-weight: 700; color: var(--text3); text-transform: uppercase; }
    .form-input { width: 100%; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border2); border-radius: var(--radius-sm); color: var(--text); font-family: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 14px; }
    .form-input:focus { outline: none; border-color: var(--accent); }
    
    .form-row { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
    .form-row .form-group { flex: 1; min-width: 140px; }

    .filter-bar { display: flex; gap: 8px; margin-bottom: 20px; align-items: center; flex-wrap: wrap; }
    .leave-box { background: var(--surface2); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 4px 0 12px; font-size: 13px; }
    .leave-box.warn { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.45); }
    .leave-box a { color: var(--accent); font-weight: 600; }
    .leave-title { font-weight: 700; font-size: 13px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .leave-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 100px; background: rgba(225, 77, 42, 0.1); color: var(--accent); }
    .leave-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 8px; }
    .leave-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; text-align: center; }
    .leave-num { font-size: 17px; font-weight: 800; }
    .leave-lbl { font-size: 11px; color: var(--text3); font-weight: 600; margin-top: 1px; }
    .leave-stat.strong { border-color: var(--accent); }
    .leave-stat.good .leave-num { color: #0D9488; }
    .leave-stat.bad .leave-num { color: #E11D48; }
    .leave-line { margin-top: 8px; color: var(--text2); line-height: 1.45; }
    .leave-line.bad { color: #E11D48; }
    .leave-line.muted { color: var(--text3); font-size: 12px; }
    .sl-filters { margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
    .sl-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
    .sl-lbl { font-size: 12px; font-weight: 700; color: var(--text3); text-transform: uppercase; min-width: 74px; }
    .sl-stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text2); margin: 0 2px 10px; }
    .sl-stats .warn { color: #b45309; }
    .sl-week { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text3); margin: 22px 2px 8px; display: flex; gap: 10px; align-items: baseline; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
    .sl-week span { font-weight: 600; letter-spacing: 0; text-transform: none; }
    .sl-day { display: flex; gap: 12px; margin-bottom: 8px; }
    .sl-date { flex: 0 0 62px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 4px; text-align: center; align-self: flex-start; display: flex; flex-direction: column; line-height: 1.25; }
    .sl-date b { font-size: 15px; } .sl-date span { font-size: 12px; color: var(--text2); } .sl-date em { font-style: normal; font-size: 10px; font-weight: 700; color: var(--accent); margin-top: 2px; }
    .sl-day.is-today .sl-date { border-color: var(--accent); background: rgba(225, 77, 42, 0.06); }
    .sl-entries { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
    .sl-entry { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border2); border-radius: 12px; padding: 10px 12px; flex-wrap: wrap; }
    .sl-entry.is-own { border-left-color: var(--accent); background: rgba(225, 77, 42, 0.04); }
    .sl-entry.is-open { border-left-color: #F59E0B; background: rgba(245, 158, 11, 0.07); }
    .sl-entry.is-past { opacity: .65; }
    .sl-time { flex: 0 0 92px; display: flex; flex-direction: column; font-size: 14px; } .sl-time span { font-size: 11px; color: var(--text3); }
    .sl-main { flex: 1; min-width: 150px; } .sl-who { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
    .sl-role { font-size: 12px; color: var(--text2); margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
    .sl-badge { font-size: 10px; font-weight: 700; padding: 1px 8px; border-radius: 100px; }
    .sl-badge.draft { background: rgba(100,116,139,0.18); color: #475569; }
    .shift-block.draft { opacity: .65; border-style: dashed; }
    .tpl-chip { display:inline-flex; align-items:center; gap:4px; padding:4px 6px 4px 12px; border-radius:100px; background:var(--surface2); border:1px solid var(--border); font-size:12px; font-weight:600; cursor:pointer; margin:0 6px 6px 0; }
    .tpl-chip button { border:0; background:none; color:var(--text3); cursor:pointer; padding:0 4px; font-size:14px; line-height:1; }
    .warn-box { background:rgba(245,158,11,0.12); border:1px solid rgba(245,158,11,0.4); color:#92400e; border-radius:10px; padding:10px 12px; font-size:13px; margin-bottom:12px; }
    .warn-box ul { margin:4px 0 0 18px; padding:0; }
    .sl-badge.open { background: rgba(245, 158, 11, 0.18); color: #b45309; } .sl-badge.own { background: rgba(225, 77, 42, 0.12); color: var(--accent); } .sl-badge.trade { background: rgba(13, 148, 136, 0.15); color: #0D9488; }
    .sl-actions { display: flex; gap: 6px; align-items: center; margin-left: auto; }
    @media (max-width: 520px) { .sl-day { flex-direction: column; gap: 6px; } .sl-date { flex-direction: row; gap: 8px; align-items: baseline; justify-content: flex-start; padding: 6px 12px; flex-basis: auto; align-self: stretch; } .sl-lbl { min-width: 100%; } .sl-time { flex-basis: 84px; } }
    .dash-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; align-items: start; }
    @media (min-width: 992px) { .dash-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
    .dash-col { min-width: 0; }
    .dash-h { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text3); margin: 0 2px 8px; display: flex; gap: 8px; align-items: center; }
    .att-list { display: flex; flex-direction: column; gap: 8px; }
    .att-group { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--att, var(--border2)); border-radius: 12px; overflow: hidden; }
    .att-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: none; border: none; color: var(--text); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; text-align: left; }
    .att-head > i:first-child { color: var(--att, var(--text2)); font-size: 18px; }
    .att-title { flex: 1; }
    .att-count { min-width: 26px; text-align: center; font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 100px; background: var(--att, var(--surface2)); color: #fff; }
    .att-chev { color: var(--text3); transition: transform .2s; font-size: 14px; }
    .att-group.open .att-chev { transform: rotate(180deg); }
    .att-body { padding: 0 14px 12px; display: flex; flex-direction: column; gap: 6px; }
    .att-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface2); border-radius: 10px; font-size: 14px; }
    .att-row small { color: var(--text3); font-size: 12px; }
    .att-cta { align-self: flex-start; margin-top: 4px; }
    .att-body .card { margin-bottom: 0; }
    .att-empty { padding: 16px; text-align: center; color: var(--text3); font-size: 14px; background: var(--surface); border: 1px dashed var(--border2); border-radius: 12px; }
    .att-empty i { color: var(--teal); font-size: 18px; vertical-align: -2px; margin-right: 4px; }
    .tools-card { padding-top: 0; margin-bottom: 0; }
    .tools-tabs { margin-bottom: 12px; }
    .tools-tabs .admin-tab { flex: 1; justify-content: center; }
    @media (max-width: 520px) { .tools-tabs .admin-tab { padding: 12px 6px; gap: 5px; font-size: 13px; } .tools-tabs .admin-tab > i { display: none; } }
    .admin-tab-count.warn { background: rgba(245, 158, 11, 0.2); color: #b45309; }
    .rt-row { display: flex; align-items: center; gap: 12px; padding: 9px 8px; border-radius: 10px; cursor: pointer; }
    .rt-row:hover { background: var(--surface2); }
    .rt-box { width: 24px; height: 24px; border-radius: 6px; border: 2px solid var(--border2); display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; transition: all .15s; }
    .rt-row.done .rt-box { background: var(--teal); border-color: var(--teal); }
    .rt-box i { font-size: 18px; }
    .rt-label { font-size: 14px; }
    .rt-row.done .rt-label { color: var(--text3); text-decoration: line-through; }
    .tool-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; padding-right: 2px; }
    .tool-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface2); padding: 10px 12px; border-radius: 10px; border-left: 3px solid var(--border2); }
    .tool-text { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
    .tool-meta { font-size: 11px; color: var(--text3); margin-top: 2px; }
    .tool-btns { display: flex; gap: 4px; flex-shrink: 0; }
    .tool-empty { text-align: center; color: var(--text3); font-size: 13px; padding: 18px 8px; }
    .geo { font-size: 13px; color: var(--text2); background: var(--surface2); border-radius: 10px; padding: 8px 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
    .geo.ok { color: #0f766e; background: rgba(13, 148, 136, 0.1); }
    .geo.bad { color: #b91c1c; background: rgba(225, 29, 72, 0.08); }
    .abs-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
    .abs-pill-count { margin-left: 6px; font-size: 11px; opacity: .75; }
    .abs-banner { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 14px; border-radius: 12px; background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.4); color: #b45309; font-weight: 600; font-size: 14px; cursor: pointer; }
    .abs-banner span { margin-left: auto; font-weight: 700; }
    .abs-card { display: flex; flex-direction: column; gap: 10px; }
    .abs-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
    .abs-who { display: flex; align-items: center; gap: 10px; }
    .abs-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
    .abs-name { font-weight: 700; font-size: 15px; }
    .abs-you { font-weight: 500; color: var(--text3); font-size: 12px; }
    .abs-sub { font-size: 12px; color: var(--text3); margin-top: 1px; }
    .abs-dates { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
    .abs-days { font-size: 11px; font-weight: 700; color: var(--text2); background: var(--surface2); border-radius: 100px; padding: 2px 8px; }
    .abs-desc { font-size: 14px; color: var(--text2); background: var(--surface2); border-radius: 8px; padding: 8px 12px; }
    .abs-notes { display: flex; flex-wrap: wrap; gap: 6px; }
    .abs-note { font-size: 12px; font-weight: 600; color: var(--text2); background: var(--surface2); border-radius: 100px; padding: 3px 10px; }
    .abs-note.warn { color: #b45309; background: rgba(245, 158, 11, 0.14); }
    .abs-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--border); }
    .abs-decide, .abs-manage { display: flex; gap: 8px; flex-wrap: wrap; }
    .abs-approve { background: #0D9488; border-color: #0D9488; color: #fff; }
    .abs-reject { background: #E11D48; border-color: #E11D48; color: #fff; }
    .abs-modal-sum { background: var(--surface2); border-radius: 10px; padding: 10px 14px; font-size: 14px; margin-bottom: 14px; }
    .abs-choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; font-size: 14px; }
    .abs-choice input { margin-top: 4px; }
    .abs-choice small { color: var(--text3); }
    .admin-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; padding-bottom: 2px; border-bottom: 1px solid var(--border); scrollbar-width: none; }
    .admin-tabs::-webkit-scrollbar { display: none; }
    .admin-tab { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: none; border: none; border-bottom: 3px solid transparent; margin-bottom: -1px; color: var(--text3); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
    .admin-tab:hover { color: var(--text); }
    .admin-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
    .admin-tab-count { font-size: 11px; font-weight: 700; background: var(--surface2); color: var(--text2); border-radius: 100px; padding: 1px 8px; }
    .admin-tab.active .admin-tab-count { background: rgba(225, 77, 42, 0.12); color: var(--accent); }
    .pill { padding: 8px 16px; border-radius: 100px; border: 1px solid var(--border2); background: var(--surface); color: var(--text2); font-size: 13px; font-weight: 600; cursor: pointer; }
    .pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
    .week-nav { display: flex; align-items: center; gap: 10px; }
    .week-label { font-size: 15px; font-weight: 700; color: var(--text); min-width: 90px; text-align: center; }

    .icon-selector { font-size:24px; padding:6px 10px; border-radius:8px; cursor:pointer; border:2px solid transparent; background:var(--surface2); transition:all 0.2s; user-select:none; }
    .icon-selector.active { border-color: var(--accent); background: rgba(225, 77, 42, 0.1); }

    /* ===================== SHIFT GRID STYLES ===================== */
    .shift-grid-cell { vertical-align: top; padding: 6px !important; min-width: 110px; border-right: 1px solid var(--border); position: relative; }
    .shift-grid-cell:hover { background: var(--surface2); }
    .shift-grid-item { background: var(--shift-other-bg); border-left: 3px solid var(--shift-other); color: var(--text); padding: 8px; border-radius: 4px; font-size: 11px; margin-bottom: 4px; transition: all 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
    .shift-grid-item.own { background: var(--own-bg); border-left-color: var(--own); }
    .shift-grid-item.avoin { background: rgba(245, 158, 11, 0.1); border-left-color: var(--accent2); color: #b45309; border-style: dashed; }
    .shift-grid-item:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); filter: brightness(0.95); }
    .shift-grid-item strong { display: block; font-size: 13px; margin-bottom: 2px; }
    .add-shift-hint { display: none; text-align: center; font-size: 11px; color: var(--text3); padding: 4px; border: 1px dashed var(--border2); border-radius: 4px; margin-top: 4px; }
    .shift-grid-cell:hover .add-shift-hint { display: block; }

    /* ===================== CALENDAR ===================== */
    .cal-wrapper { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
    .cal-grid { display: grid; grid-template-columns: 60px repeat(7, minmax(120px, 1fr)); min-width: 900px; }
    .cal-header { background: var(--surface2); padding: 14px 8px; text-align: center; font-size: 12px; font-weight: 700; color: var(--text2); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); position: sticky; top: 0; z-index: 10; transition: background 0.2s; }
    .cal-header.today { color: var(--accent); background: rgba(225, 77, 42, 0.05); }
    .cal-header .day-num { font-family: 'Syne', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 20px; font-weight: 800; display: block; color: var(--text); margin-top: 4px; pointer-events: none; }
    .cal-header.today .day-num { color: var(--accent); }
    
    .cal-header.avail-yes { background: rgba(13, 148, 136, 0.15) !important; border-bottom: 3px solid #0D9488 !important; }
    .cal-header.avail-no { background: rgba(225, 29, 72, 0.15) !important; border-bottom: 3px solid #E11D48 !important; }

    .time-header-corner { background: var(--surface2); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); position: sticky; top: 0; left: 0; z-index: 11; }
    .time-label { padding: 0 8px; text-align: right; font-size: 11px; color: var(--text3); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); background: var(--surface); position: sticky; left: 0; z-index: 5; display: flex; align-items: flex-start; justify-content: flex-end; padding-top: 6px; font-weight: 600; }
    .time-cell { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); position: relative; height: 48px; }

    .shift-block, .event-block { position: absolute; border-radius: 8px; font-size: 11px; padding: 6px 8px; overflow: hidden; border: 1px solid rgba(0,0,0,0.04); min-width: 30px; }
    .shift-block.own { background: var(--own-bg); border-left: 3px solid var(--own); color: var(--own); }
    .shift-block.others { background: var(--shift-other-bg); border-left: 3px solid var(--shift-other); color: var(--shift-other); }
    .shift-block.avoin-vuoro { background: rgba(245, 158, 11, 0.15); border-left: 3px solid var(--accent2); color: #b45309; border-style: dashed; cursor: pointer; }
    
    .event-block { background: rgba(225, 77, 42, 0.1); border-left: 3px solid var(--event-color); color: var(--accent); z-index: 3; }
    .shift-block strong, .event-block strong { font-size: 11px; display: block; margin-bottom: 2px; }
    .shift-block .shift-name { font-weight: 700; font-size: 12px; }

    /* ===================== TABLE ===================== */
    .bs-table { width: 100%; border-collapse: collapse; }
    .bs-table thead tr th { padding: 14px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text3); border-bottom: 1px solid var(--border); text-align: left; background: var(--surface2); }
    .bs-table tbody tr td { padding: 16px; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text2); }
    .bs-table tbody tr.own-row td { color: var(--text); background: var(--surface2); }
    .bs-table tbody tr.avoin-row td { background: rgba(245, 158, 11, 0.05); }

    .badge { display: inline-block; padding: 4px 12px; border-radius: 100px; font-size: 11px; font-weight: 700; }
    .badge-teal { background: rgba(13, 148, 136, 0.12); color: var(--teal); }
    .badge-blue { background: rgba(59, 130, 246, 0.12); color: var(--shift-other); }
    .badge-orange { background: rgba(245, 158, 11, 0.12); color: var(--accent2); }

    /* ===================== COMPONENTS ===================== */
    .event-card { display: flex; justify-content: space-between; align-items: center; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); margin-bottom: 12px; }
    .event-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 4px; }
    
    .stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
    .stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
    .stat-value { font-family: 'Syne', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 24px; font-weight: 800; color: var(--text); }
    .stat-value.accent { color: var(--accent); }
    
    .section-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
    .section-title { font-family: 'Syne', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 18px; font-weight: 700; color: var(--text); white-space: nowrap; }
    .section-line { flex: 1; height: 1px; background: var(--border); }

    #toast { position: fixed; bottom: 88px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--text); color: var(--surface); padding: 14px 24px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; z-index: 9999; opacity: 0; transition: all 0.3s; pointer-events: none; }
    #toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
    #toast.error { background: #E11D48; }

    .empty-state { text-align: center; padding: 60px 20px; color: var(--text3); border: 1px dashed var(--border); border-radius: var(--radius); }
    .empty-state i { font-size: 48px; margin-bottom: 16px; display: block; opacity: 0.4; }
    .notice-card { background: rgba(225, 77, 42, 0.05); border: 1px solid rgba(225, 77, 42, 0.2); border-left: 4px solid var(--accent); padding: 16px; border-radius: var(--radius-sm); margin-bottom: 20px; display: flex; gap: 16px; align-items: center; }

    /* ===================== MODAL SYSTEM ===================== */
    .modal-overlay {
        position: fixed; inset: 0; background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(4px);
        z-index: 5000; display: flex; align-items: center; justify-content: center;
        padding: 20px; opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
    }
    .modal-overlay.open { opacity: 1; pointer-events: all; }
    .modal {
        background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
        box-shadow: 0 24px 60px rgba(0,0,0,0.18); width: 100%; max-width: 560px;
        max-height: 90vh; overflow-y: auto; transform: translateY(16px) scale(0.98);
        transition: transform 0.25s cubic-bezier(0.16,1,0.3,1); display: flex; flex-direction: column;
    }
    .modal-overlay.open .modal { transform: translateY(0) scale(1); }
    .modal-header {
        display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 18px;
        border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1;
        border-radius: var(--radius) var(--radius) 0 0;
    }
    .modal-title { font-family: 'Syne', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 20px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 10px; }
    .modal-close {
        background: none; border: none; cursor: pointer; color: var(--text3); padding: 6px; border-radius: 8px;
        font-size: 20px; line-height: 1; transition: all 0.15s; display: flex; align-items: center; justify-content: center;
    }
    .modal-close:hover { background: var(--surface2); color: var(--text); }
    .modal-body { padding: 24px; overflow-y: auto; }
    .modal-footer {
        padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px;
        position: sticky; bottom: 0; background: var(--surface); border-radius: 0 0 var(--radius) var(--radius);
    }
    .modal-footer .btn { min-width: 110px; }

    /* ===================== RESPONSIVE ===================== */
    @media (max-width: 600px) {
        .bs-table td { padding: 12px 8px; font-size: 13px; }
        .pill { padding: 6px 12px; font-size: 11px; }
        .stat-row { grid-template-columns: 1fr; }
    }
    @media (min-width: 992px) {
        body { padding-bottom: 0; }
        .app-container { flex-direction: row; }
        .top-logo { display: none; }
        .top-bar { padding: 10px 32px; }
        .nav-bar { position: sticky; top: 0; height: 100vh; width: 260px; flex-direction: column; justify-content: flex-start; padding: 32px 0; border-top: none; border-right: 1px solid var(--border); box-shadow: none; }
        .nav-btn { flex: none; height: 56px; width: 100%; flex-direction: row; justify-content: flex-start; padding: 0 32px; font-size: 15px; border-radius: 0; }
        .nav-btn.active { background: rgba(225, 77, 42, 0.06); border-right: 3px solid var(--accent); }
        .nav-btn.logout { margin-top: auto; }
        .nav-logo { display: block; padding: 0 32px 32px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
    }
    .login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--bg); }
    .login-logo { font-family: 'Syne', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 42px; font-weight: 800; text-align: center; margin-bottom: 8px; color: var(--text); }
    .login-logo span { color: var(--accent); }

/* Raportin tulostus / PDF: näytetään vain raportti */
.print-only { display: none; }
@media print {
    body * { visibility: hidden; }
    #report-print, #report-print * { visibility: visible; }
    #report-print { position: absolute; left: 0; top: 0; width: 100%; color: #000; background: #fff; }
    #report-print .print-only { display: block; }
    #report-print .bs-table { font-size: 11px; }
    #report-print .badge { border: 1px solid #999; background: none; color: #000; }
}

/* Poissaolokalenteri */
.ac-table { border-collapse: separate; border-spacing: 0; font-size: 12px; min-width: 100%; }
.ac-name { position: sticky; left: 0; background: var(--surface); padding: 6px 10px 6px 0; white-space: nowrap; font-weight: 600; z-index: 1; min-width: 110px; }
.ac-day { font-weight: 600; color: var(--text2); padding: 4px 0; min-width: 24px; text-align: center; }
.ac-day.wk { color: var(--text3); } .ac-day.today { color: var(--accent); }
.ac-cell { height: 26px; min-width: 24px; border-bottom: 1px solid var(--border); border-left: 1px solid var(--border); background: var(--c); }
.ac-cell.empty { background: transparent; } .ac-cell.empty.wk { background: var(--surface2); }
.ac-cell.pending { background: repeating-linear-gradient(45deg, var(--c) 0 4px, transparent 4px 8px); }
.ac-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--c); vertical-align: -1px; }
.ac-key.pending { background: repeating-linear-gradient(45deg, var(--c) 0 3px, transparent 3px 6px); }

/* Baarin vaihto (usean baarin jäsen) */
.pub-switch { margin-top: 8px; width: 100%; max-width: 200px; padding: 6px 8px; border: 1px solid var(--border2); border-radius: 100px; background: var(--surface); color: var(--text); font: inherit; font-size: 12px; font-weight: 600; }
.pub-switch.top { margin-top: 0; width: auto; max-width: 160px; }

.offline-banner { background:#FEF3C7; color:#92400E; border-bottom:1px solid #FCD34D; padding:8px 16px; font-size:13px; font-weight:600; }
