/* Department Panel Styles */
:root {
  --dp-bg:        #111;
  --dp-surface:   #181818;
  --dp-border:    #262626;
  --dp-accent:    #ff6f1a;
  --dp-success:   #2ecc71;
  --dp-danger:    #e74c3c;
  --dp-warning:   #f39c12;
  --dp-info:      #3498db;
  --dp-text:      #e5e5e5;
  --dp-muted:     #888;
  --dp-radius:    10px;
  --sb-w:         220px;
}
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }
body { background:var(--dp-bg); color:var(--dp-text); font-family:'Inter',sans-serif; font-size:14px; min-height:100vh; }
a { color:var(--dp-accent); text-decoration:none; }
a:hover { text-decoration:underline; }
button { cursor:pointer; border:none; outline:none; font-family:inherit; font-size:inherit; }
input,select,textarea { font-family:inherit; font-size:inherit; background:#1e1e1e; border:1px solid var(--dp-border); color:var(--dp-text); border-radius:6px; padding:7px 10px; }
input:focus,select:focus,textarea:focus { border-color:var(--dp-accent); outline:none; }
select option { background:#1e1e1e; }

/* ── Layout ── */
.dp-wrap   { display:flex; height:100vh; overflow:hidden; }
.dp-sidebar { width:var(--sb-w); background:var(--dp-surface); border-right:1px solid var(--dp-border);
              display:flex; flex-direction:column; flex-shrink:0; overflow-y:auto; }
.dp-main   { flex:1; display:flex; flex-direction:column; overflow:hidden; }
.dp-topbar { height:52px; border-bottom:1px solid var(--dp-border); display:flex; align-items:center;
             padding:0 20px; gap:12px; flex-shrink:0; background:var(--dp-surface); }
.dp-content { flex:1; overflow-y:auto; padding:24px; }

/* ── Sidebar ── */
.dp-sb-header { padding:16px 14px 10px; display:flex; align-items:center; gap:10px; border-bottom:1px solid var(--dp-border); }
.dp-dept-icon { width:36px; height:36px; border-radius:8px; background:#222; display:flex; align-items:center; justify-content:center; overflow:hidden; flex-shrink:0; }
.dp-dept-icon img { width:100%; height:100%; object-fit:cover; }
.dp-dept-name { font-weight:700; font-size:.9rem; line-height:1.2; color:var(--dp-text); }
.dp-dept-short { font-size:.75rem; color:var(--dp-muted); }
.dp-sb-label { padding:14px 14px 5px; font-size:.68rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; color:var(--dp-muted); }
.dp-nav-item { display:flex; align-items:center; gap:9px; padding:8px 14px; border-radius:6px; margin:1px 6px; color:#ccc; transition:background .15s,color .15s; background:transparent; width:calc(100% - 12px); text-align:left; font-size:.83rem; }
.dp-nav-item:hover { background:#222; color:#fff; }
.dp-nav-item.active { background:#ff6f1a22; color:var(--dp-accent); }
.dp-nav-item svg { flex-shrink:0; opacity:.8; }
.dp-sb-bottom { margin-top:auto; border-top:1px solid var(--dp-border); padding:10px 6px; }

/* ── Topbar ── */
.dp-dept-selector { position:relative; }
.dp-dept-selector select { background:transparent; border:none; color:var(--dp-text); font-weight:700; font-size:.9rem; cursor:pointer; padding:4px 24px 4px 4px; appearance:none; }
.dp-topbar-title { font-weight:700; font-size:.95rem; }
.dp-topbar-actions { margin-left:auto; display:flex; align-items:center; gap:8px; }

/* ── Cards ── */
.dp-card { background:var(--dp-surface); border:1px solid var(--dp-border); border-radius:var(--dp-radius); padding:20px; }
.dp-card-title { font-weight:700; font-size:.82rem; margin-bottom:12px; color:#aaa; text-transform:uppercase; letter-spacing:.04em; }

/* ── Stats row ── */
.dp-stats { display:grid; grid-template-columns:repeat(auto-fill,minmax(160px,1fr)); gap:14px; margin-bottom:20px; }
.dp-stat  { background:var(--dp-surface); border:1px solid var(--dp-border); border-radius:var(--dp-radius); padding:16px; }
.dp-stat-val { font-size:1.6rem; font-weight:900; }
.dp-stat-lbl { font-size:.75rem; color:var(--dp-muted); margin-top:4px; }

/* ── Table ── */
.dp-tbl-wrap  { overflow-x:auto; }
.dp-tbl-card  { background:var(--dp-surface); border:1px solid var(--dp-border); border-radius:var(--dp-radius); overflow:hidden; }
.dp-tbl-hdr   { padding:12px 16px; border-bottom:1px solid var(--dp-border); display:flex; align-items:center; justify-content:space-between; }
.dp-tbl-hdr-title { font-weight:700; font-size:.82rem; }
table.dp-table { width:100%; border-collapse:collapse; }
table.dp-table th { padding:10px 14px; text-align:left; font-size:.73rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--dp-muted); border-bottom:1px solid var(--dp-border); white-space:nowrap; }
table.dp-table td { padding:10px 14px; border-bottom:1px solid #1e1e1e; font-size:.83rem; }
table.dp-table tr:last-child td { border-bottom:none; }
table.dp-table tr:hover td { background:#181818; }
.td-c { text-align:center; color:var(--dp-muted); padding:18px !important; }

/* ── Badges ── */
.badge { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:20px; font-size:.73rem; font-weight:700; }
.badge-active    { background:#2ecc7122; color:#2ecc71; }
.badge-loa       { background:#3498db22; color:#3498db; }
.badge-removed   { background:#e74c3c22; color:#e74c3c; }
.badge-pending   { background:#f39c1222; color:#f39c12; }
.badge-approved  { background:#2ecc7122; color:#2ecc71; }
.badge-denied    { background:#e74c3c22; color:#e74c3c; }
.badge-onshift   { background:#ff6f1a22; color:#ff6f1a; }
.badge-onbreak   { background:#f39c1222; color:#f39c12; }

/* ── Buttons ── */
.dp-btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:7px 14px; border-radius:6px; font-weight:600; font-size:.82rem; transition:opacity .15s; }
.dp-btn:disabled { opacity:.45; cursor:not-allowed; }
.dp-btn-primary { background:var(--dp-accent); color:#fff; }
.dp-btn-primary:hover { opacity:.88; }
.dp-btn-success { background:var(--dp-success); color:#fff; }
.dp-btn-success:hover { opacity:.88; }
.dp-btn-danger  { background:var(--dp-danger); color:#fff; }
.dp-btn-danger:hover { opacity:.88; }
.dp-btn-ghost   { background:transparent; color:#ccc; border:1px solid var(--dp-border); }
.dp-btn-ghost:hover { background:#222; color:#fff; }
.dp-btn-sm { padding:5px 10px; font-size:.78rem; }

/* ── Forms ── */
.dp-form-grid  { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.dp-form-field { display:flex; flex-direction:column; gap:5px; }
.dp-form-field.span2 { grid-column:1/-1; }
.dp-label { font-size:.8rem; font-weight:600; color:#bbb; }
.dp-input { width:100%; }
.dp-textarea { width:100%; resize:vertical; min-height:80px; }

/* ── Section ── */
.dp-section { display:none; }
.dp-section.active { display:block; }

/* ── Settings tabs ── */
.dp-settings-tabs { display:flex; gap:4px; margin-bottom:20px; border-bottom:1px solid var(--dp-border); }
.dp-stab { padding:9px 16px; border-radius:6px 6px 0 0; background:transparent; color:var(--dp-muted); font-size:.83rem; transition:background .15s,color .15s; border:1px solid transparent; border-bottom:none; }
.dp-stab.active { background:var(--dp-surface); color:var(--dp-text); border-color:var(--dp-border); }
.dp-stab-pane { display:none; }
.dp-stab-pane.active { display:block; }

/* ── Roster role badge ── */
.role-badge { display:inline-flex; align-items:center; gap:5px; font-size:.75rem; font-weight:700; padding:2px 8px; border-radius:20px; }
.role-dot   { width:8px; height:8px; border-radius:50%; }

/* ── Document editor ── */
.dp-editor-toolbar { display:flex; flex-wrap:wrap; gap:3px; padding:8px 10px; background:#1e1e1e; border:1px solid var(--dp-border); border-bottom:none; border-radius:8px 8px 0 0; }
.dp-editor-toolbar button { padding:4px 8px; border-radius:4px; background:transparent; color:#ccc; font-size:.82rem; border:1px solid transparent; }
.dp-editor-toolbar button:hover { background:#2a2a2a; color:#fff; }
.dp-editor-toolbar button.active { background:#ff6f1a33; color:var(--dp-accent); border-color:var(--dp-accent); }
.dp-editor-toolbar .divider { width:1px; background:var(--dp-border); margin:2px 3px; align-self:stretch; }
.dp-editor-body { min-height:320px; padding:16px; background:#1a1a1a; border:1px solid var(--dp-border); border-radius:0 0 8px 8px; outline:none; line-height:1.6; color:var(--dp-text); }
.dp-editor-body h1 { font-size:1.8rem; font-weight:800; margin-bottom:8px; }
.dp-editor-body h2 { font-size:1.3rem; font-weight:700; margin-bottom:6px; }
.dp-editor-body h3 { font-size:1.1rem; font-weight:700; margin-bottom:5px; }
.dp-editor-body ul,
.dp-editor-body ol { padding-left:24px; margin-bottom:8px; }

/* ── Form builder ── */
.fb-question { background:#1e1e1e; border:1px solid var(--dp-border); border-radius:8px; padding:14px; margin-bottom:10px; }
.fb-question-header { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.fb-q-handle { color:var(--dp-muted); cursor:grab; }
.fb-q-num { font-size:.75rem; font-weight:700; color:var(--dp-muted); width:20px; }
.fb-q-type { font-size:.75rem; padding:3px 8px; border-radius:4px; }
.fb-choice-list { display:flex; flex-direction:column; gap:5px; margin-top:6px; }
.fb-choice-row { display:flex; gap:6px; align-items:center; }
.fb-choice-row input { flex:1; }
.fb-choice-row button { padding:3px 8px; border-radius:4px; background:#2a2a2a; color:#888; border:1px solid var(--dp-border); font-size:.75rem; }

/* ── Sheet ── */
.dp-sheet-wrap { overflow:auto; }
.dp-sheet-table { border-collapse:collapse; min-width:100%; }
.dp-sheet-table th { background:#1e1e1e; padding:5px 10px; border:1px solid var(--dp-border); font-size:.75rem; color:var(--dp-muted); min-width:80px; text-align:center; }
.dp-sheet-table td { border:1px solid var(--dp-border); padding:0; }
.dp-sheet-cell { width:100%; min-width:80px; min-height:28px; padding:4px 7px; background:transparent; color:var(--dp-text); border:none; outline:none; font-size:.82rem; }
.dp-sheet-cell:focus { background:#1e1e1e; }

/* ── Application form ── */
.apply-q { margin-bottom:14px; }
.apply-q label { display:block; font-size:.83rem; font-weight:600; margin-bottom:5px; }
.apply-q input,
.apply-q textarea,
.apply-q select { width:100%; }

/* ── Shift status ── */
.shift-card { text-align:center; padding:28px 20px; }
.shift-timer { font-size:2.2rem; font-weight:900; font-variant-numeric:tabular-nums; }

/* ── Join screen ── */
#joinScreen { max-width:440px; margin:80px auto; }
.join-dept-list { display:flex; flex-direction:column; gap:8px; margin-bottom:16px; }
.join-dept-row { display:flex; align-items:center; gap:12px; background:var(--dp-surface); border:1px solid var(--dp-border); border-radius:8px; padding:12px 14px; cursor:pointer; transition:border-color .15s; }
.join-dept-row:hover { border-color:var(--dp-accent); }
.join-dept-row .dept-icon-sm { width:32px; height:32px; border-radius:6px; background:#222; flex-shrink:0; }
.join-dept-row .dept-row-name { font-weight:700; font-size:.88rem; }

/* ── Modal ── */
.dp-modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.65); z-index:1000; display:flex; align-items:center; justify-content:center; }
.dp-modal { background:var(--dp-surface); border:1px solid var(--dp-border); border-radius:var(--dp-radius); padding:24px; min-width:320px; max-width:560px; width:90%; max-height:80vh; overflow-y:auto; }
.dp-modal-title { font-weight:800; font-size:1rem; margin-bottom:16px; }
.dp-modal-footer { margin-top:18px; display:flex; justify-content:flex-end; gap:8px; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width:6px; height:6px; }
::-webkit-scrollbar-track { background:transparent; }
::-webkit-scrollbar-thumb { background:#333; border-radius:3px; }

/* ── Responsive ── */
@media (max-width:768px) {
  .dp-sidebar { position:fixed; left:-240px; top:0; bottom:0; z-index:200; transition:left .2s; }
  .dp-sidebar.open { left:0; }
  .dp-form-grid { grid-template-columns:1fr; }
}
