:root {
    --p: #4f46e5; --p-dark: #3730a3; --p-soft: rgba(79, 70, 229, 0.05); /* Indigo - softer */
    --s: #10b981; --w: #f59e0b; --d: #e11d48; /* Emerald, Amber, Rose */
    --dark: #000000; --text: #1e293b; --muted: #64748b; /* Slate Palette - darker text */
    --bg: #ffffff; --card: #f8fafc; --border: #e2e8f0; /* White background */
    --glass: rgba(255, 255, 255, 0.85);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -2px rgba(0, 0, 0, 0.02); /* Very soft shadows */
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.03), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
}

body.dark-theme {
    --bg: #0b0f19; --card: #151b2b; --border: #1e293b;
    --text: #f1f5f9; --muted: #94a3b8; --dark: #f8fafc;
    --glass: rgba(21, 27, 43, 0.8);
    --p: #818cf8; --p-dark: #a5b4fc; --p-soft: rgba(129, 140, 248, 0.2);
    --s: #34d399; --w: #fbbf24; --d: #fb7185; 
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { zoom: 0.8; background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif; display: flex; height: 100dvh; overflow: hidden; transition: background 0.3s, color 0.3s; font-size: 14px; -webkit-font-smoothing: antialiased; }

/* Sidebar & Logo */
.nav-sidebar { width: 80px; background: var(--card); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; z-index: 100; height: 100dvh; }
.app-logo { width: 100%; padding: 1.5rem 0; display: flex; justify-content: center; border-bottom: 1px solid var(--border); }
.ht-logo { width: 44px; height: 44px; background: linear-gradient(135deg, var(--p), var(--p-dark)); color: white; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-family: 'Outfit'; font-weight: 800; font-size: 1.3rem; letter-spacing: 1px; box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4); }

.nav-items-container { flex: 1; display: flex; flex-direction: column; align-items: center; padding-top: 2rem; gap: 1.5rem; }
.nav-item { width: 50px; height: 50px; border-radius: 12px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; font-size: 1.4rem; color: var(--muted); }
.nav-item.active { background: var(--p); color: white; box-shadow: 0 4px 10px rgba(37,99,235,0.3); }

/* Main layout */
.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100dvh; }
.top-bar { height: 60px; background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); padding: 0 2.5rem; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; position: sticky; top: 0; z-index: 90; }
.branding h1 { font-family: 'Outfit'; font-size: 1.5rem; color: var(--dark); font-weight: 800; background: linear-gradient(to right, var(--dark), var(--p)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.live-clock { font-size: 0.85rem; color: var(--muted); margin-top: 4px; font-weight: 500; }

.top-bar-actions { display: flex; align-items: center; gap: 1.5rem; }
.theme-toggle { cursor: pointer; font-size: 1.2rem; background: var(--p-soft); width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; transition: 0.2s; border: none; color: var(--p); }
.theme-toggle:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

/* Viewport */
.viewport { flex: 1; overflow-y: auto; position: relative; display: flex; flex-direction: column; }
.view-content { flex: 1; padding: 2rem; overflow: hidden; display: none; }
.view-content.active { display: flex; flex-direction: column; animation: fadeUp 0.3s ease; }
#list-view.active { display: flex; flex-direction: column; }
#transfer-view.active, #scurve-view.active { display: flex; flex-direction: column; }
.focus-fullscreen.active { display: flex !important; align-items: center; justify-content: center; }
@keyframes fadeUp { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform: translateY(0); } }

/* View Headers */
.view-header { margin-bottom: 1.5rem; }
.view-header h2 { font-size: 1.6rem; color: var(--dark); font-family: 'Outfit'; font-weight: 800; }
.flex-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }

/* Tabs */
.tabbed-views { display: flex; gap: 0.5rem; background: var(--border); padding: 4px; border-radius: 10px; }
.t-tab { padding: 6px 14px; border-radius: 6px; font-weight: 600; font-size: 0.85rem; border: none; cursor: pointer; background: transparent; color: var(--muted); transition: 0.2s; }
.t-tab.active { background: var(--card); color: var(--dark); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* Shared Widget */
.widget { background: var(--card); border-radius: 16px; border: 1px solid var(--border); box-shadow: var(--shadow); padding: 1.8rem; transition: transform 0.3s, box-shadow 0.3s; color: var(--text); }
.widget:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; width: 100%; }
.list-widget h3 { font-size: 1rem; color: var(--dark); margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.mini-list { max-height: 250px; overflow-y: auto; font-size: 0.85rem; }

.task-item-dash { padding: 10px 12px; border-radius: 8px; margin-bottom: 8px; display: flex; justify-content: space-between; background: var(--bg); transition: 0.2s; border: 1px solid transparent; }
.task-item-dash:hover { border-color: var(--p); background: var(--card); }
.task-item-dash strong { color: var(--dark); font-weight: 600; }
.err-list .task-item-dash { background: rgba(239,68,68,0.05); border: 1px solid rgba(239,68,68,0.15); color: var(--d); }
.err-list .task-item-dash small { color: var(--d); font-weight: 600; }
.wait-list .task-item-dash { background: rgba(245,158,11,0.05); border: 1px solid rgba(245,158,11,0.15); color: var(--w); }
.blue-list .task-item-dash { background: rgba(37,99,235,0.05); border: 1px solid rgba(37,99,235,0.15); color: var(--p); }

/* Table Controls & Local Actions */
.table-controls { margin-bottom: 1rem; margin-top: 1rem; }
.search-input { flex: 1; max-width: 400px; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--border); font-size: 0.9rem; background: var(--bg); color: var(--text); outline: none; transition: all 0.2s ease-in-out; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); }
.search-input:focus { border-color: var(--p); background: var(--card); box-shadow: 0 0 0 4px var(--p-soft); }

.tabbed-views { display: flex; border: 1px solid var(--border); background: var(--bg); border-radius: 10px; overflow: hidden; height: 38px; }
.t-tab { padding: 0 20px; font-size: 0.8rem; font-weight: 600; cursor: pointer; border: none; background: transparent; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); color: var(--muted); border-right: 1px solid var(--border); }
.t-tab:last-child { border-right: none; }
.t-tab:hover { background: var(--card); color: var(--text); }
.t-tab.active { background: var(--card); color: var(--p); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* Table specific overrides */
#master-task-table tr:nth-child(even) td, #spent-entry-table tr:nth-child(even) td { background: rgba(0,0,0,0.015); }
body.dark-theme #master-task-table tr:nth-child(even) td, body.dark-theme #spent-entry-table tr:nth-child(even) td { background: rgba(255,255,255,0.01); }
.numeric-cell { white-space: nowrap; }

.badge { padding: 5px 12px; border-radius: 20px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.5px; border: 1px solid transparent; text-transform: uppercase; }
.cfg-input { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 0.9rem; }
.checkbox-group label { display: inline-flex; align-items: center; margin-right: 15px; font-size: 0.9rem; color: var(--dark); font-weight: 500; cursor: pointer; }
.checkbox-group input { margin-right: 5px; transform: scale(1.1); }

/* Table Headers & Filter Triggers */
.filter-trigger {
    position: absolute;
    bottom: 5px;
    right: 30px; /* Moved away from resizer */
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    color: var(--muted);
    transition: 0.2s;
    user-select: none;
    z-index: 150;
}
.filter-trigger:hover {
    background: var(--p);
    color: white;
    border-color: var(--p);
    transform: scale(1.1);
}
.filter-trigger.active {
    background: var(--p);
    color: white;
    border-color: var(--p);
}

.filter-menu {
    position: fixed;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    min-width: 220px;
    padding: 10px;
    display: none;
    flex-direction: column;
    gap: 10px;
    animation: fadeUp 0.15s ease-out;
    resize: both;
    overflow: auto;
    min-height: 150px;
    margin-top: 10px;
}
.filter-menu.active { display: flex; }

.filter-search {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    background: var(--bg);
    outline: none;
}
.filter-search:focus { border-color: var(--p); box-shadow: 0 0 0 2px var(--p-soft); }

.filter-options {
    max-height: 200px;
    overflow-y: auto;
    display: flex; flex-direction: column; gap: 4px; padding: 4px;
}
.filter-opt {
    display: flex; align-items: center; gap: 10px; padding: 6px 8px;
    border-radius: 6px; cursor: pointer; font-size: 0.8rem; transition: 0.1s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filter-opt:hover { background: var(--bg); }
.filter-opt input { cursor: pointer; }

.filter-actions { display: flex; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.filter-actions button {
    flex: 1; padding: 8px; font-size: 0.75rem; font-weight: 700;
    border-radius: 8px; cursor: pointer; border: none; transition: 0.2s;
}
.filter-btn-clear { background: var(--bg); color: var(--muted); }
.filter-btn-apply { background: var(--p); color: white; }

.view-header-fixed {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--card);
}

.top-layout-wrapper {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.quick-action-bar .btn {
    border-radius: 8px;
}

#list-view .table-container {
    flex: 1;
    overflow: auto;
    position: relative;
}

#master-task-table, #spent-entry-table { border-collapse: separate; border-spacing: 0; width: 100%; table-layout: fixed; }
#master-task-table thead, #spent-entry-table thead {
    z-index: 110;
}

#master-task-table thead th, #spent-entry-table thead th {
    background: var(--card);
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
    border-right: 1px solid var(--border);
    position: sticky !important;
    vertical-align: middle;
    text-align: left;
    font-size: 0.8rem;
    height: 48px;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#table-totals th {
    background: #eef2ff !important;
    color: #4338ca !important;
    border-bottom: 2px solid #c7d2fe;
}

body.dark-theme #table-totals th {
    background: #1e293b !important;
    color: #818cf8 !important;
    border-bottom: 2px solid #334155;
}

.row-resizer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    cursor: row-resize;
    z-index: 10;
}
.row-resizer:hover {
    background: var(--p);
}

.view-header-fixed {
    position: sticky; top: 0; z-index: 150;
    background: var(--card); border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.resizer {
    position: absolute;
    right: 0;
    top: 0;
    width: 8px;
    height: 100%;
    cursor: col-resize;
    z-index: 100; /* Lower than filter-trigger */
    background: transparent;
}

.resizer:hover, .resizing .resizer {
    background: var(--p) !important;
    width: 4px;
}

#task-list td {
    background: var(--card);
}

.all-task-tab-bar .tabbed-views {
    background: var(--bg);
    border: 1px solid var(--border);
}

.all-task-tab-bar .t-tab {
    border-radius: 6px;
    margin: 2px;
}

.all-task-tab-bar .t-tab.active {
    background: var(--p);
    color: white;
}
th span { 
    display: block; 
    pointer-events: none; 
}
th.sortable { cursor: pointer; transition: 0.2s; position: relative; }
th.sortable:hover { background: var(--p-soft); color: var(--p); }
th.sort-active { color: var(--p); }
th.sort-active::after { content: ' •'; font-size: 1rem; position: absolute; top: 8px; right: 4px; }
td { 
    padding: 8px 10px; 
    border-bottom: 1px solid var(--border); 
    border-right: 1px solid var(--border);
    font-size: 0.85rem; 
    position: relative; 
    color: var(--text); 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
    vertical-align: middle; 
    transition: background 0.2s;
    height: 44px;
}
tr:hover td { background: var(--bg) !important; }
tr.dirty td { background: var(--p-soft) !important; }
tr.dirty .no-cell::after { content: ' ●'; color: var(--d); }

.due-soon-icon {
    display: inline-block;
    color: var(--w);
    margin-left: 6px;
    font-size: 0.9rem;
    vertical-align: middle;
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    background-color: currentColor;
}

.no-cell { 
    text-align: center; 
    font-weight: 800; 
    color: var(--muted); 
    font-size: 0.75rem; 
    background: var(--bg); 
    position: sticky; 
    left: 0; 
    z-index: 15; 
    border-right: 2px solid var(--border);
}

.cell-textarea {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 100%;
    resize: none; 
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    padding: 4px 6px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.85rem;
    line-height: normal;
    outline: none;
    transition: 0.15s;
    overflow: hidden;
    text-overflow: ellipsis; 
    white-space: nowrap;
    display: block;
}
.cell-textarea:focus, .cell-textarea:hover {
    border-color: var(--p);
    background: var(--bg);
}


table.auto-fit {
    table-layout: auto !important;
}

table.auto-fit td, table.auto-fit tr, table.auto-fit th {
    white-space: normal !important;
    height: auto !important;
}

table.auto-fit .cell-textarea {
    white-space: pre-wrap;
    overflow: hidden;
}

.date-cell { text-align: center; cursor: pointer; transition: 0.2s; min-width: 130px; }
.date-cell input { position: absolute; top:0; left:0; width:100%; height:100%; opacity:0; cursor: pointer; z-index: 5; }
.date-cell:hover { background: var(--p-soft); }
.inline-apply-btn { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); z-index: 10; background: var(--p); color: white; border: none; padding: 4px 8px; font-size: 0.7rem; font-weight: 700; border-radius: 6px; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.2); transition: 0.2s; }
.inline-apply-btn:hover { background: var(--s); }

/* S-Curve View */
.scurve-main-card { width: 100%; margin: 0 auto; padding: 1.5rem; overflow: hidden; display: flex; flex-direction: column; }
.scurve-ui-wrapper { display: flex; flex-direction: column; gap: 1rem; width: 100%; }

.s-metrics-top-row { display: flex; justify-content: center; gap: 3rem; background: var(--card); padding: 1rem; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 1rem; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
.s-t-stat { font-size: 0.85rem; color: var(--muted); font-weight: 600; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.s-t-stat b { font-size: 1.4rem; color: var(--dark); font-family: 'Outfit'; }
.spi-val { font-weight: 800; font-family: 'Outfit'; }

.scurve-chart-area { width: 100%; position: relative; }
#scurveChart { height: 400px !important; width: 100% !important; }

/* Rotated S-Curve Table */
.sc-table-horizontal-container { overflow-x: auto; margin-top: 1rem; width: 100%; }
.sc-matrix-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; table-layout: fixed; }
.sc-matrix-table tr:first-child th { background: var(--dark); color: var(--bg); border-color: rgba(255,255,255,0.1); }
.sc-matrix-table th, .sc-matrix-table td { border: 1px solid var(--border); padding: 8px 6px; text-align: center; overflow: hidden; white-space: nowrap; color: var(--text); background: var(--card); }
.sc-matrix-table th { background: var(--bg); font-weight: 700; color: var(--text); }
.sc-matrix-table .row-label { background: var(--card); color: var(--text); font-weight: 800; text-align: left; position: sticky; left: 0; width: 130px; min-width: 130px; max-width: 130px; border-right: 2px solid var(--border); }

/* DB View Layout Restored */
.data-mgmt-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; max-width: 1000px; }
.db-info-box, .sync-box { display: flex; flex-direction: column; gap: 1rem; }
.db-grid { border: 1px solid var(--border); border-radius: 12px; }
.db-i { display: flex; justify-content: space-between; padding: 15px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.db-i:last-child { border-bottom: none; }
.btn-stack { display: flex; flex-direction: column; gap: 0.8rem; }
.clr-green { color: var(--s) !important; }
.clr-yellow { color: #f59e0b !important; }
.clr-red { color: var(--d) !important; }

/* Data Management Layout */
.data-mgmt-header-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.sync-management-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.db-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 15px; }
.sc-matrix-table th { background: var(--bg); color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.5px; padding: 12px 10px; border-bottom: 2px solid var(--border); border-right: 1px solid var(--border); }
.sc-matrix-table td { padding: 10px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); background: var(--card); color: var(--text); }
.sc-matrix-table tr:last-child td { border-bottom: none; }
.sc-matrix-table th:last-child, .sc-matrix-table td:last-child { border-right: none; }
.sc-matrix-table tr:hover td { background: var(--bg); }

/* Buttons */
.btn { padding: 0.8rem 1.8rem; border-radius: 8px; font-weight: 600; cursor: pointer; font-size: 0.9rem; border: none; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: var(--shadow-soft); display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; }
.btn:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--p), var(--p-dark)); color: white; border: 1px solid rgba(0,0,0,0.1); }
.btn-primary:active { transform: scale(0.98) translateY(0); box-shadow: var(--shadow-soft); }
.btn-secondary { background: var(--card); border: 1px solid var(--border); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.btn-secondary:hover { background: var(--bg); border-color: var(--p); }
.btn-secondary:active { background: var(--bg); transform: scale(0.98) translateY(0); box-shadow: 0 0 0; }
.btn-outline { border: 1.5px dashed var(--p); color: var(--p); background: transparent; box-shadow: none; }
.btn-outline:hover { background: var(--p-soft); }

.badge { padding: 5px 12px; border-radius: 15px; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.5px; }
.st-bitti { background: rgba(16,185,129,0.15); color: var(--s); border: 1px solid rgba(16,185,129,0.3); }
.st-devam { background: rgba(79, 70, 229, 0.15); color: var(--p); border: 1px solid rgba(79, 70, 229, 0.3); }
.st-gecikti { background: rgba(225, 29, 72, 0.15); color: var(--d); border: 1px solid rgba(225, 29, 72, 0.3); }
.st-bekliyor { background: rgba(100,116,139,0.15); color: var(--muted); border: 1px solid rgba(100,116,139,0.3); }

input[type="text"], input[type="number"], .cfg-input { border: 1px solid var(--border); background: var(--bg); color: var(--text); padding: 8px 12px; border-radius: 8px; font-family: inherit; font-size: inherit; outline: none; transition: 0.2s; }
input[type="text"]:focus, input[type="number"]:focus, .cfg-input:focus { border-color: var(--p); box-shadow: 0 0 0 3px var(--p-soft); background: var(--card); }

.group-summary-card { background: var(--bg); padding: 12px; border-radius: 12px; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.group-summary-header { display: flex; justify-content: space-between; font-weight: 700; color: var(--dark); }
.group-summary-stats { display: flex; gap: 10px; font-size: 0.75rem; font-weight: 600; flex-wrap: wrap; }
.gs-stat { background: var(--card); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--border); }

.red { color: var(--d) !important; }
.btn-del-task { display: flex !important; align-items: center; justify-content: center; width: 100%; height: 100%; cursor: pointer; border: none; background: transparent; transition: transform 0.1s; }
.btn-del-task:hover { transform: scale(1.2); }

.filter-menu {
    display: none; position: fixed; background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); z-index: 1000;
    min-width: 220px; max-width: 400px; max-height: 500px; 
    overflow: hidden; resize: both; display: flex; flex-direction: column;
}

.filter-opt {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: 8px; cursor: pointer; font-size: 0.85rem; transition: 0.1s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.filter-opt:hover { background: var(--p-soft); color: var(--p); }

.filter-actions { 
    display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--border);
    background: var(--card); position: sticky; bottom: 0; margin-top: auto;
}

.filter-search {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
    margin-bottom: 8px; font-size: 0.85rem; background: var(--bg);
}

.filter-options { flex: 1; overflow-y: auto; padding: 5px; }

/* ===== FOCUS MODE — PREMIUM POMODORO ===== */
.focus-fullscreen { 
    display: none; 
    position: fixed; 
    top: 0;
    right: 0;
    bottom: 0;
    left: 80px;
    z-index: 1000; 
    background: #0f172a; 
    overflow: hidden !important; 
}

.focus-fullscreen.active { display: flex; }

.focus-bg-overlay {
    position: absolute; inset: 0; z-index: 0;
    background: 
        radial-gradient(ellipse at 15% 15%, rgba(16,185,129,0.08) 0%, transparent 40%),
        radial-gradient(ellipse at 85% 85%, rgba(59,130,246,0.08) 0%, transparent 40%),
        linear-gradient(160deg, #0f172a 0%, #020617 100%);
}

.focus-content-layer {
    position: relative; z-index: 1;
    display: flex; 
    width: 100%;
    height: 100%;
    padding: 2rem 5%;
    gap: 5%;
    align-items: center;
    justify-content: space-between;
}

/* Left Pane: Timer */
.focus-left-pane {
    flex: 1;
    max-width: 550px;
    height: 90vh;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    padding: 40px;
    backdrop-filter: blur(40px);
    box-shadow: 0 40px 100px -20px rgba(0,0,0,0.5);
}

/* Right Pane: Info & Stats */
.focus-right-pane {
    flex: 1.2;
    max-width: 1000px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow-y: auto;
    padding-right: 10px;
}

/* Scrollbar for right pane */
.focus-right-pane::-webkit-scrollbar { width: 6px; }
.focus-right-pane::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.05); border-radius: 10px; }

/* Circular Ring Container */
.focus-ring-container {
    position: relative; width: 360px; height: 360px;
    display: flex; align-items: center; justify-content: center;
}
.focus-time-inner {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; pointer-events: none;
}
.focus-phase-label {
    font-size: 1rem; font-weight: 800; letter-spacing: 5px;
    text-transform: uppercase; color: rgba(255,255,255,0.6); margin-bottom: 0px;
}
.focus-countdown {
    font-size: 7.5rem; font-family: 'Outfit'; font-weight: 800;
    color: #ffffff; letter-spacing: -3px; line-height: 1;
    text-shadow: 0 0 40px rgba(255,255,255,0.15);
}
.focus-set-info {
    font-size: 1.2rem; color: rgba(255,255,255,0.5); margin-top: 15px;
    font-weight: 600;
}

/* Action Buttons */
.focus-action-bar { display: flex; gap: 20px; align-items: center; }
.focus-btn {
    padding: 16px 45px; border-radius: 50px; font-family: 'Outfit';
    font-weight: 800; font-size: 1.2rem; cursor: pointer; transition: 0.3s;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
}
.focus-btn:hover { background: rgba(255,255,255,0.1); transform: translateY(-3px); }
.focus-btn-main { 
    background: rgba(16, 185, 129, 0.15);
    color: #10b981; 
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.1);
}
.focus-btn-main:hover { 
    background: rgba(16, 185, 129, 0.25); 
    box-shadow: 0 0 50px rgba(16, 185, 129, 0.25);
    border-color: rgba(16, 185, 129, 0.5);
}

.focus-btn-pause { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.focus-btn-stop { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); color: #ef4444; }
.focus-btn-skip { background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.2); color: #60a5fa; }

/* Activity Card Panels */
.focus-history-panel {
    background: rgba(255, 255, 255, 0.02); 
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.04); 
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.focus-history-panel h3 { 
    color: #60a5fa; font-size: 0.85rem; font-weight: 800; 
    letter-spacing: 2px; text-transform: uppercase; margin-bottom: 20px; 
}

/* History Table */
.focus-history-table { width: 100%; border-collapse: collapse; }
.focus-history-table th { 
    color: rgba(255,255,255,0.4); font-size: 0.75rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 1px; padding: 15px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.focus-history-table td { padding: 18px 10px; color: rgba(255,255,255,0.85); font-size: 0.95rem; border-bottom: 1px solid rgba(255,255,255,0.05); }

/* Config Inputs */
.focus-setting { display: flex; flex-direction: column; gap: 8px; }
.focus-setting label { 
    font-size: 0.75rem; font-weight: 800; color: rgba(255,255,255,0.6); 
    text-transform: uppercase; letter-spacing: 1px; 
}
.focus-cfg-input {
    background: rgba(0,0,0,0.4) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: #ffffff !important; font-weight: 800; font-family: 'Outfit';
    width: 100% !important; height: 45px; border-radius: 12px; font-size: 1.1rem;
    text-align: center;
}
.focus-cfg-input:focus { border-color: #60a5fa !important; box-shadow: 0 0 15px rgba(96,165,250,0.3); }

.focus-notify-btn {
    background: rgba(0,0,0,0.4) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    color: #10b981 !important;
    width: 100% !important; border-radius: 12px; height: 45px; 
    font-size: 0.85rem; font-weight: 700; cursor: pointer;
}
.focus-notify-btn:hover { background: rgba(0,0,0,0.6) !important; }

.focus-task-bar { display: none; }

/* Filter Menu & Table UX Enhancements */
.filter-menu {
    display: none; position: fixed; background: var(--card); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); z-index: 1000;
    min-width: 240px; max-width: 900px; max-height: 80vh; 
    overflow: hidden; resize: both; flex-direction: column;
}

.filter-menu.active { display: flex; }

.filter-search-container { padding: 12px 12px 0; background: var(--card); position: sticky; top: 0; z-index: 10; }
.filter-search {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
    font-size: 0.85rem; background: var(--bg); color: var(--dark); outline: none;
}
.filter-search:focus { border-color: var(--p); box-shadow: 0 0 0 2px var(--p-soft); }

.filter-options { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.filter-opt {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border-radius: 8px; cursor: pointer; font-size: 0.85rem; transition: 0.1s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    border: 1px solid transparent;
}
.filter-opt:hover { background: var(--p-soft); color: var(--p); }
.filter-opt.selected { background: var(--p); color: white; }

.filter-actions { 
    display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--border);
    background: var(--card); position: sticky; bottom: 0; margin-top: auto;
}

.filter-trigger { 
    cursor: pointer; color: var(--muted); margin-left: 6px; font-size: 0.75rem; 
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 4px; padding: 2px; transition: 0.2s;
}
.filter-trigger:hover { background: var(--p-soft); color: var(--p); }

.btn-del-task { 
    display: flex !important; align-items: center; justify-content: center; 
    width: 100%; height: 100%; cursor: pointer; border: none; 
    background: transparent; transition: transform 0.1s; 
    color: var(--d) !important;
}
.btn-del-task:hover { transform: scale(1.2); color: #be123c !important; }

/* Status Distribution Dot */
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 8px; }
