:root {
    --bg-color: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --panel-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --brand-primary: #3b82f6;
    --brand-hover: #2563eb;
    
    --green-status: #10b981;
    --yellow-status: #f59e0b;
    --red-status: #ef4444;
    
    --font-main: 'Inter', sans-serif;
    --transition: all 0.3s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
                      radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.1), transparent 25%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, h4 { color: var(--text-primary); font-weight: 600; margin-bottom: 0.5rem; }
p { color: var(--text-secondary); line-height: 1.5; }
.mt-4 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }

.app-container { display: flex; min-height: 100vh; }
.main-content { flex: 1; padding: 2rem; display: flex; flex-direction: column; }

.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--panel-border); border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.sidebar { width: 250px; padding: 2rem 1rem; margin: 1rem; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 3rem; padding: 0 1rem; }
.brand h2 { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.5px; }
.brand h2 span { color: var(--brand-primary); }
.icon-logo { font-size: 1.5rem; color: var(--brand-primary); }
.nav-links { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.nav-links li { padding: 1rem; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 12px; color: var(--text-secondary); font-weight: 500; transition: var(--transition); }
.nav-links li:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.nav-links li.active { background: var(--brand-primary); color: white; }
.nav-links li i { width: 20px; text-align: center; }

.top-bar { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 2rem; margin-bottom: 2rem; }
header h1 { font-size: 1.5rem; margin: 0;}
header p { font-size: 0.875rem; margin: 0;}
.user-profile { display: flex; align-items: center; gap: 1rem; font-weight: 500; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-primary); display: flex; align-items: center; justify-content: center; }

.view { display: none; animation: fadeIn 0.4s ease forwards; }
.view.active-view { display: block; transform: translateY(0); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Form Controls */
.input-group { display: flex; flex-direction: column; gap: 0.5rem; }
.input-group label { font-size: 0.875rem; color: var(--text-secondary); font-weight: 500; }
.input-group input, .input-group select {
    background: rgba(15, 23, 42, 0.6); border: 1px solid var(--panel-border); border-radius: 8px;
    padding: 0.5rem 1rem; color: var(--text-primary); font-family: inherit; transition: var(--transition);
}
.input-group input[type="time"] { cursor: pointer; }
.input-group input[type="checkbox"] { width: 1.25rem; height: 1.25rem; cursor:pointer;}
.input-group input:focus, .input-group select:focus { outline: none; border-color: var(--brand-primary); box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2); }

.btn { border: none; padding: 0.75rem 1.5rem; border-radius: 8px; font-weight: 500; cursor: pointer; transition: var(--transition); display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; font-family: inherit; }
.btn-primary { background: var(--brand-primary); color: white; }
.btn-primary:hover { background: var(--brand-hover); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4); transform: translateY(-1px); }

/* Dashboard */
.dashboard-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2rem; margin-top: 2rem; }
.controls { padding: 1.5rem; }
.input-group-row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.panel-header { margin-bottom: 1rem; border-bottom: 1px solid var(--panel-border); padding-bottom: 1rem; }
.panel-header h3 { margin: 0; display: flex; align-items: center; gap: 0.5rem; font-size: 1.1rem; }
.badge { background: rgba(59, 130, 246, 0.2); color: #60a5fa; padding: 0.25rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; display:inline-block; }
.forecast-panel, .results-panel { padding: 1.5rem; }
.task-inputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.helper-text { font-size: 0.875rem; color: var(--text-secondary); }

.status-message { padding: 1rem; border-radius: 8px; display: flex; gap: 0.75rem; align-items: center; background: rgba(255,255,255,0.05); font-size: 0.875rem; }
.status-message.green { background: rgba(16, 185, 129, 0.1); border-left: 4px solid var(--green-status); color: #a7f3d0;}
.status-message.yellow { background: rgba(245, 158, 11, 0.1); border-left: 4px solid var(--yellow-status); color: #fde68a;}
.status-message.red { background: rgba(239, 68, 68, 0.1); border-left: 4px solid var(--red-status); color: #fecaca;}

/* Task Results Cards */
.file-input { background: rgba(15,23,42,0.5); padding: 0.5rem; border-radius: 8px; font-family: inherit; font-size: 0.875rem; border: 1px solid var(--panel-border); }
.file-input::-webkit-file-upload-button { background: var(--brand-primary); color: white; border: none; padding: 0.5rem 1rem; border-radius: 6px; cursor: pointer; transition: var(--transition); }
.file-input::-webkit-file-upload-button:hover { background: var(--brand-hover); }

.task-cards-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.5rem; margin-top: 1rem; }
.task-card { background: rgba(255,255,255,0.03); border: 1px solid var(--panel-border); border-radius: 12px; padding: 1.25rem; transition: var(--transition); }
.task-card:hover { border-color: rgba(255,255,255,0.2); }
.task-card h4 { display: flex; justify-content: space-between; align-items: center; font-size: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 0.75rem; margin-bottom: 1rem; }
.card-stats { display: flex; flex-direction: column; gap: 0.75rem; }
.c-stat-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.875rem; }
.c-stat-label { color: var(--text-secondary); }
.c-stat-val { font-weight: 600; }
.c-stat-val.req { color: #f8fafc; }
.c-stat-val.plan { color: #60a5fa; }
.card-diff { margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid rgba(255,255,255,0.05); display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size:0.9rem;}
.card-diff.green { color: var(--green-status); }
.card-diff.yellow { color: var(--yellow-status); }
.card-diff.red { color: var(--red-status); }

.fixed-staffing-list { list-style: none; background: rgba(15, 23, 42, 0.5); border-radius: 8px; padding: 1rem; }
.fixed-staffing-list li { margin-bottom: 0.5rem; font-size: 0.875rem; color: var(--text-secondary); }
.fixed-staffing-list li:last-child { margin-bottom: 0; }
.fixed-staffing-list i { color: var(--brand-primary); width: 20px; }

/* Calendar Element */
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.5rem; margin-top:1rem; }
.cal-header { text-align: center; font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; padding:0.5rem; }
.cal-day {
    aspect-ratio: 1; border-radius: 8px; padding: 0.5rem; display: flex; flex-direction: column;
    justify-content: space-between; border: 1px solid transparent; cursor: pointer; transition: var(--transition);
}
.cal-day span.date { font-weight: 700; font-size: 1rem; }
.cal-day span.type { font-size: 0.65rem; text-transform: uppercase; font-weight: 600; }
.cal-day.empty { background: transparent; cursor: default; }

.cal-day.wday { background: rgba(51, 65, 85, 0.5); border-color: rgba(51, 65, 85, 0.8); color:#f8fafc;}
.cal-day.fri  { background: rgba(59, 130, 246, 0.25); border-color: rgba(59, 130, 246, 0.55); color:#bfdbfe;}
.cal-day.wend { background: rgba(202, 138, 4, 0.2); border-color: rgba(202, 138, 4, 0.5); color:#fef08a;}
.cal-day.holi { background: rgba(153, 27, 27, 0.3); border-color: rgba(153, 27, 27, 0.5); color:#fecaca;}

.cal-day:hover:not(.empty) { transform: scale(1.05); filter: brightness(1.2); }

/* Coverage Gaps List */
.gaps-container { display: flex; flex-direction: column; gap: 0.75rem; max-height: 400px; overflow-y: auto; padding-right: 0.5rem; }
.gaps-container::-webkit-scrollbar { width: 6px; }
.gaps-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.gap-item { padding: 1rem; border-radius: 8px; display: flex; flex-direction: column; gap: 0.5rem; font-size: 0.875rem; border-left: 4px solid var(--red-status); background: rgba(239, 68, 68, 0.05);}
.gap-head { display: flex; justify-content: space-between; align-items: center; font-weight:600;}
.gap-time { color: var(--text-secondary); font-size:0.75rem;}

/* Rules Configurator */
.rules-container { display: flex; flex-direction: column; gap: 1rem; }
.rule-row { padding: 1rem; border-radius: 8px; background: rgba(255,255,255,0.03); border: 1px solid var(--panel-border); display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.rule-row .input-group { min-width: 120px; }
.btn-danger { background: rgba(239, 68, 68, 0.2); color:#fca5a5; padding: 0.5rem; border-radius: 6px; cursor: pointer; border:none; transition: var(--transition); }
.btn-danger:hover { background: var(--red-status); color:white; }

.settings-container { padding: 1.5rem; }
.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.channel-settings-card {
    padding: 1rem;
    min-width: 0;
}
.settings-save-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.slot-editor-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.slot-editor-card {
    padding: 1rem;
}
.slot-editor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}
.slot-editor-table th,
.slot-editor-table td {
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    text-align: left;
}
.slot-editor-table input {
    width: 100%;
    min-width: 0;
}
.slot-editor-day {
    margin-bottom: 1rem;
}

/* History View */
.history-insight { padding: 1.5rem; border-radius: 12px; background: rgba(255,255,255,0.05); display: flex; gap: 1rem; align-items: flex-start; border: 1px solid var(--panel-border); margin-bottom: 1.5rem; }
.insight-icon { font-size: 1.5rem; color: var(--brand-primary); background: rgba(59, 130, 246, 0.2); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.insight-text { font-size: 1rem; line-height: 1.5; padding-top: 0.25rem;}
.history-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.h-stat { background: rgba(0,0,0,0.2); padding: 1rem; border-radius: 8px; display: flex; flex-direction: column; gap: 0.5rem; }
.h-stat span { font-size: 0.75rem; color: var(--text-secondary); text-transform: uppercase; }
.h-stat strong { font-size: 1.5rem; }
.hidden { display: none !important; }

/* Planner Specifics */
#overrides-list { display: flex; flex-direction: column; gap: 0.75rem; }
#overrides-list div { animation: slideIn 0.3s ease forwards; }
@keyframes slideIn { from { opacity:0; transform:translateX(-10px); } to { opacity:1; transform:translateX(0); } }

/* Forecast Heatmap Tables */
#forecast-phone-heatmap table, #forecast-chat-heatmap table { width: 100%; border-collapse: separate; border-spacing: 2px; }
#forecast-phone-heatmap th, #forecast-chat-heatmap th { font-weight: 600; font-size: 0.65rem; color: var(--text-secondary); border-bottom: 1px solid var(--panel-border); padding: 4px; }

/* Plan Preview Table */
#plan-preview td { transition: var(--transition); cursor: default; }
#plan-preview td:hover { filter: brightness(1.4); transform: scale(1.05); }

/* Buttons & Inputs in Planner */
.btn-secondary { background: rgba(255, 255, 255, 0.08); color: white; }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.15); transform: translateY(-1px); }

#planner-gen-status { font-weight: 500; min-height: 1.2rem; }

/* Skills Table Styles */
#skills-table { table-layout: auto; min-width: 100%; font-size: 0.78rem; }
#skills-table th, #skills-table td { padding: 5px 6px !important; }
#skills-table-head th {
    position: sticky; top: 0; z-index: 10;
    background: rgba(15, 20, 35, 0.95);
    backdrop-filter: blur(10px);
    writing-mode: vertical-rl; transform: rotate(180deg);
    white-space: nowrap; min-width: 30px; max-width: 38px; height: 130px;
    font-size: 0.72rem;
}
#skills-table-head th:nth-child(1),
#skills-table-head th:nth-child(2) {
    writing-mode: horizontal-tb; transform: none; height: auto; max-width: none;
}
#skills-table-head th:nth-child(1) { left: 0; z-index: 11; min-width: 150px; }
#skills-table-head th:nth-child(2) { left: 150px; z-index: 11; min-width: 90px; }

#skills-table-body td:nth-child(1),
#skills-table-body td:nth-child(2) { position: sticky; z-index: 1; }
#skills-table-body td:nth-child(1) { left: 0; min-width: 150px; }
#skills-table-body td:nth-child(2) { left: 150px; min-width: 90px; }

#skills-table-body tr { transition: background 0.15s; }
#skills-table-body tr:nth-child(odd)  { background: rgba(255,255,255,0.00); }
#skills-table-body tr:nth-child(even) { background: rgba(255,255,255,0.035); }
#skills-table-body tr:nth-child(odd)  td:nth-child(1),
#skills-table-body tr:nth-child(odd)  td:nth-child(2) { background: rgb(15,23,42); }
#skills-table-body tr:nth-child(even) td:nth-child(1),
#skills-table-body tr:nth-child(even) td:nth-child(2) { background: rgb(22,31,54); }
#skills-table-body tr:hover { background: rgba(99,102,241,0.14); }
#skills-table-body tr:hover td:nth-child(1),
#skills-table-body tr:hover td:nth-child(2) { background: rgb(40,45,85); }

.skill-checkbox-cell { transition: background 0.15s; }
.skill-checkbox-cell:hover { background: rgba(99,102,241,0.28); }

/* Column highlight via :has() — for up to 40 columns */
#skills-table:has(td:nth-child(3):hover)  th:nth-child(3),  #skills-table:has(td:nth-child(3):hover)  td:nth-child(3)  { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(4):hover)  th:nth-child(4),  #skills-table:has(td:nth-child(4):hover)  td:nth-child(4)  { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(5):hover)  th:nth-child(5),  #skills-table:has(td:nth-child(5):hover)  td:nth-child(5)  { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(6):hover)  th:nth-child(6),  #skills-table:has(td:nth-child(6):hover)  td:nth-child(6)  { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(7):hover)  th:nth-child(7),  #skills-table:has(td:nth-child(7):hover)  td:nth-child(7)  { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(8):hover)  th:nth-child(8),  #skills-table:has(td:nth-child(8):hover)  td:nth-child(8)  { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(9):hover)  th:nth-child(9),  #skills-table:has(td:nth-child(9):hover)  td:nth-child(9)  { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(10):hover) th:nth-child(10), #skills-table:has(td:nth-child(10):hover) td:nth-child(10) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(11):hover) th:nth-child(11), #skills-table:has(td:nth-child(11):hover) td:nth-child(11) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(12):hover) th:nth-child(12), #skills-table:has(td:nth-child(12):hover) td:nth-child(12) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(13):hover) th:nth-child(13), #skills-table:has(td:nth-child(13):hover) td:nth-child(13) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(14):hover) th:nth-child(14), #skills-table:has(td:nth-child(14):hover) td:nth-child(14) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(15):hover) th:nth-child(15), #skills-table:has(td:nth-child(15):hover) td:nth-child(15) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(16):hover) th:nth-child(16), #skills-table:has(td:nth-child(16):hover) td:nth-child(16) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(17):hover) th:nth-child(17), #skills-table:has(td:nth-child(17):hover) td:nth-child(17) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(18):hover) th:nth-child(18), #skills-table:has(td:nth-child(18):hover) td:nth-child(18) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(19):hover) th:nth-child(19), #skills-table:has(td:nth-child(19):hover) td:nth-child(19) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(20):hover) th:nth-child(20), #skills-table:has(td:nth-child(20):hover) td:nth-child(20) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(21):hover) th:nth-child(21), #skills-table:has(td:nth-child(21):hover) td:nth-child(21) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(22):hover) th:nth-child(22), #skills-table:has(td:nth-child(22):hover) td:nth-child(22) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(23):hover) th:nth-child(23), #skills-table:has(td:nth-child(23):hover) td:nth-child(23) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(24):hover) th:nth-child(24), #skills-table:has(td:nth-child(24):hover) td:nth-child(24) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(25):hover) th:nth-child(25), #skills-table:has(td:nth-child(25):hover) td:nth-child(25) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(26):hover) th:nth-child(26), #skills-table:has(td:nth-child(26):hover) td:nth-child(26) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(27):hover) th:nth-child(27), #skills-table:has(td:nth-child(27):hover) td:nth-child(27) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(28):hover) th:nth-child(28), #skills-table:has(td:nth-child(28):hover) td:nth-child(28) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(29):hover) th:nth-child(29), #skills-table:has(td:nth-child(29):hover) td:nth-child(29) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(30):hover) th:nth-child(30), #skills-table:has(td:nth-child(30):hover) td:nth-child(30) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(31):hover) th:nth-child(31), #skills-table:has(td:nth-child(31):hover) td:nth-child(31) { background: rgba(99,102,241,0.12); }
#skills-table:has(td:nth-child(32):hover) th:nth-child(32), #skills-table:has(td:nth-child(32):hover) td:nth-child(32) { background: rgba(99,102,241,0.12); }

/* ------ TIDSLINJE ------ */
.tidslinje-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin: 8px 0 18px;
    color: var(--text-secondary);
    font-size: 0.78rem;
}
.tl-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tl-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}
.tidslinje-shell {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    background: rgba(15, 23, 42, 0.4);
}
.tl-grid {
    min-width: 980px;
}
.tl-hour-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--panel-border);
}
.tl-hour-corner {
    border-right: 1px solid var(--panel-border);
}
.tl-hour-cells {
    display: grid;
}
.tl-hour-label {
    padding: 8px 6px;
    border-right: 1px solid var(--panel-border);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}
.tl-hour-label:last-child {
    border-right: 0;
}
.tl-body {
    display: flex;
    flex-direction: column;
}
.tl-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    min-height: 44px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.tl-row:last-child {
    border-bottom: 0;
}
.tl-agent {
    padding: 8px 12px;
    border-right: 1px solid var(--panel-border);
    min-width: 0;
}
.tl-agent-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tl-agent-team {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.tl-blocks {
    position: relative;
    min-height: 44px;
    background-image: linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: calc(100% / 14) 100%;
    overflow: hidden;
}
.tl-block {
    position: absolute;
    top: 7px;
    height: 30px;
    border-radius: 5px;
    color: white;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 0 8px;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.35);
    z-index: 1;
}
.tl-block span {
    overflow: hidden;
    text-overflow: ellipsis;
}
.tl-phone { background: #3b82f6; }
.tl-chat { background: #0d9488; }
.tl-goto { background: #8b5cf6; }
.tl-flex { background: #16803c; }
.tl-pause { background: #64748b; }
.tl-locked { background: #b45309; }
.tl-highlight-band {
    position: absolute;
    top: 0;
    bottom: 0;
    background: rgba(245, 158, 11, 0.22);
    border-left: 2px dashed #f59e0b;
    border-right: 2px dashed #f59e0b;
    z-index: 0;
    pointer-events: none;
}

/* Hide inbox button */
.backlog-cell .backlog-hide {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(15, 23, 42, 0.85);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
    z-index: 2;
}
.backlog-cell:hover .backlog-hide {
    opacity: 1;
}
.backlog-cell .backlog-hide:hover {
    color: var(--red-status);
    border-color: var(--red-status);
    background: rgba(239, 68, 68, 0.12);
}

/* Tidslinje side-by-side layout */
.tidslinje-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 1.25rem;
    align-items: start;
}
.tidslinje-main { min-width: 0; }
.tidslinje-gaps {
    position: sticky;
    top: 1rem;
    height: calc(100vh - 2rem);
    overflow: hidden;
}
.tidslinje-gaps .panel-header {
    flex: 0 0 auto;
}
.tidslinje-gaps .gaps-container {
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    margin: 0 -0.5rem;
    padding: 0 0.5rem 0.25rem;
}
@media (max-width: 1280px) {
    .tidslinje-layout {
        grid-template-columns: 1fr;
    }
    .tidslinje-gaps { position: static; max-height: none; }
}

/* Gap cards */
.gap-date-header {
    margin: 12px 0 6px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    font-weight: 700;
}
.gap-date-header:first-child { margin-top: 4px; }
.gap-item {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    background: rgba(15, 23, 42, 0.45);
    border-left: 3px solid var(--red-status);
    border-radius: 8px;
}
.gap-item .gap-body { min-width: 0; }
.gap-head {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.88rem;
    margin-bottom: 4px;
}
.gap-time-line {
    color: var(--text-secondary);
    font-size: 0.8rem;
}
.gap-suggestion {
    margin-top: 6px;
    color: var(--brand-primary);
    font-size: 0.78rem;
}
.gap-resolve-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.18);
    background: transparent;
    color: rgba(255,255,255,0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: var(--transition);
    flex-shrink: 0;
}
.gap-resolve-btn:hover {
    border-color: var(--green-status);
    color: var(--green-status);
    background: rgba(16, 185, 129, 0.1);
}
.gap-resolve-btn.is-resolved {
    border-color: var(--green-status);
    background: var(--green-status);
    color: white;
}
.gap-resolved {
    opacity: 0.45;
    border-left-color: var(--green-status);
}
.gap-resolved .gap-head {
    text-decoration: line-through;
}
.gap-resolved-note {
    margin-top: 12px;
    padding: 8px 10px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-style: italic;
    background: rgba(16, 185, 129, 0.06);
    border-radius: 6px;
}

/* Clickable coverage gaps */
.clickable-gap {
    cursor: pointer;
    transition: var(--transition);
}
.clickable-gap:not(.gap-resolved):hover {
    background: rgba(59, 130, 246, 0.12);
    transform: translateX(2px);
}

@media (max-width: 1180px) {
    .settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .slot-editor-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .app-container { display: block; }
    .sidebar { width: auto; margin: 1rem; }
    .main-content { padding: 1rem; }
    .top-bar { padding: 1rem 1.25rem; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 1rem; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-save-bar { width: 100%; }
}
