/* =========================================
   WorkTrace Design System (Obsidian & Zinc)
   Sleek, High-Contrast Modern Dark Theme
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Core Obsidian / Zinc Colors */
    --bg-primary: #09090b;
    --bg-secondary: #0e0e11;
    --bg-card: #121215;
    --bg-card-hover: #18181c;
    --bg-sidebar: #09090b;
    --bg-input: #18181b;
    
    /* Typography Colors */
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --text-main: var(--text-primary);
    
    /* Functional Accents */
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --accent-cyan: #06b6d4;
    
    /* Hairline Translucent Borders */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --border-active: rgba(59, 130, 246, 0.4);
    --border-main: rgba(255, 255, 255, 0.15);
    
    /* Subtle Monochrome & Functional Gradients */
    --gradient-primary: linear-gradient(135deg, #2563eb, #3b82f6);
    --gradient-success: linear-gradient(135deg, #059669, #10b981);
    --gradient-danger: linear-gradient(135deg, #dc2626, #ef4444);
    --gradient-warning: linear-gradient(135deg, #d97706, #f59e0b);
    --gradient-subtle: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    
    /* Shadows & Radii (Deep Architectural + Metallic Top Bevel) */
    --shadow-card: 0 10px 24px -6px rgba(0, 0, 0, 0.65), 0 4px 8px -2px rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
    --shadow-lg: 0 20px 36px -8px rgba(0, 0, 0, 0.8), 0 8px 16px -4px rgba(0, 0, 0, 0.6), inset 0 1px 0 0 rgba(255, 255, 255, 0.15);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    font-size: 13.5px; /* High-density scaling by default (desktop) */
}

@media (max-width: 1200px) {
    html {
        font-size: 14px; /* Slightly larger on medium screens */
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px; /* Legible size on mobile devices */
    }
}

* { box-sizing: border-box; }

html, body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* =========================================
   Layout Structure & App Shell
   ========================================= */

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-brand .logo {
    width: 32px;
    height: 32px;
    background: #fafafa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    color: #09090b;
    letter-spacing: -0.02em;
    box-shadow: var(--shadow-sm);
}

.sidebar-brand h1 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0.5rem;
    overflow-y: auto;
}

.nav-section-title {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.65rem 0.65rem 0.3rem;
    font-weight: 600;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.65rem;
    margin-bottom: 2px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.09);
    color: var(--text-primary);
    font-weight: 600;
}

.sidebar-nav a .nav-icon {
    font-size: 1.05rem;
    width: 20px;
    text-align: center;
    color: var(--text-muted);
    transition: var(--transition);
}

.sidebar-nav a:hover .nav-icon,
.sidebar-nav a.active .nav-icon {
    color: var(--text-primary);
}

.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
}

.main-content {
    margin-left: 220px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.topbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.topbar-user .user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-primary);
}

.page-content {
    flex: 1;
    padding: 0.85rem 1.25rem;
    max-width: 1600px;
    width: 100%;
    min-width: 0;
}

/* =========================================
   Sleek Components (.ui-* and .wt-* bridges)
   ========================================= */

/* Cards (Milled Metallic Surface with Inner Bevel) */
.wt-card, .ui-card {
    background: linear-gradient(145deg, #16161b 0%, #101013 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: var(--transition);
}

.wt-card:hover, .ui-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.wt-card-header, .ui-card-header {
    padding: 0.65rem 0.95rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
}

.wt-card-header .header-icon, .ui-card-header .header-icon {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.6rem;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.wt-card-body, .ui-card-body {
    padding: 0.95rem;
    max-width: 100%;
    overflow-x: auto;
}

/* Stat Cards */
.stat-card, .ui-stat-card {
    background: linear-gradient(145deg, #16161a 0%, #111114 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 0.95rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.stat-card:hover, .ui-stat-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Remove colored top neon stripes from stat cards */
.stat-card::before, .ui-stat-card::before {
    display: none;
}

.stat-card .stat-label, .ui-stat-card .stat-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.stat-card .stat-value, .ui-stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.stat-card .stat-detail, .ui-stat-card .stat-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.4rem;
}

/* Buttons */
.wt-btn, .ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.83rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.3;
}

.wt-btn-primary, .ui-btn-primary {
    background: rgba(59, 130, 246, 0.16) !important;
    border: 1px solid #3b82f6 !important;
    color: #38bdf8 !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    font-weight: 700 !important;
}
.wt-btn-primary:hover, .ui-btn-primary:hover {
    background: rgba(59, 130, 246, 0.28) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.wt-btn-outline, .ui-btn-outline {
    background: rgba(255, 255, 255, 0.02) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: var(--text-secondary) !important;
}
.wt-btn-outline:hover, .ui-btn-outline:hover {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.25) !important;
    color: var(--text-primary) !important;
}

.wt-btn-success, .ui-btn-success {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}
.wt-btn-success:hover, .ui-btn-success:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.5);
    color: #34d399;
}

.wt-btn-danger, .ui-btn-danger {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}
.wt-btn-danger:hover, .ui-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
}

.wt-btn-ghost, .ui-btn-ghost, .ui-btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border-color: var(--border-color);
}
.wt-btn-ghost:hover, .ui-btn-ghost:hover, .ui-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-hover);
    color: #fafafa;
}

.wt-btn-sm, .ui-btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.78rem;
}

/* Tables */
.wt-table, .ui-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.wt-table thead th, .ui-table thead th {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.55rem 0.85rem;
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}

.wt-table tbody td, .ui-table tbody td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.85rem;
    color: var(--text-secondary);
    vertical-align: middle;
}

.wt-table tbody tr:hover td, .ui-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-primary);
}

/* Badges */
.wt-badge, .ui-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    border: 1px solid transparent;
}

.wt-badge-blue, .ui-badge-blue { background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.25); color: #60a5fa; }
.wt-badge-green, .ui-badge-green { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.25); color: #34d399; }
.wt-badge-amber, .ui-badge-amber { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.25); color: #fbbf24; }
.wt-badge-red, .ui-badge-red { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.25); color: #f87171; }
.wt-badge-purple, .ui-badge-purple { background: rgba(139, 92, 246, 0.12); border-color: rgba(139, 92, 246, 0.25); color: #a78bfa; }
.wt-badge-cyan, .ui-badge-cyan { background: rgba(6, 182, 212, 0.12); border-color: rgba(6, 182, 212, 0.25); color: #22d3ee; }
.wt-badge-gray, .ui-badge-gray { background: rgba(148, 163, 184, 0.1); border-color: rgba(148, 163, 184, 0.2); color: #a1a1aa; }

/* Tabs */
.wt-tabs, .ui-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.wt-tab, .ui-tab {
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    font-family: inherit;
    margin-bottom: -1px;
}

.wt-tab:hover, .ui-tab:hover { color: var(--text-primary); }

.wt-tab.active, .ui-tab.active {
    color: #38bdf8 !important;
    border-bottom-color: #38bdf8 !important;
    font-weight: 700 !important;
}

.wt-tab-content, .ui-tab-content { display: none; }
.wt-tab-content.active, .ui-tab-content.active { display: block; }

/* Log Status Banners */
.log-banner {
    border-radius: var(--radius);
    padding: 1rem 1.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.log-banner.logged {
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.log-banner.not-logged {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.log-banner .banner-icon { font-size: 1.35rem; margin-right: 0.75rem; }
.log-banner .banner-text { font-weight: 600; color: var(--text-primary); }
.log-banner .banner-detail { font-size: 0.83rem; color: var(--text-secondary); }

/* Task Item */
.task-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.task-item:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.task-item .task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}

.task-item .task-id {
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
}

.task-item .task-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.task-item .task-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.task-item .task-metrics {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.65rem;
    font-size: 0.8rem;
}

.task-item .task-metrics .metric {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
}

.task-item .task-metrics .metric-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Forms & Inputs (.ui-* and .wt-* bridges with Metallic Depth & Custom Select Chevron) */
.ui-input, .ui-select, .ui-textarea, .wt-input, .wt-select, .form-control, .form-select {
    display: block !important;
    width: 100% !important;
    background: linear-gradient(180deg, #1c1c21 0%, #151518 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: var(--radius-sm) !important;
    padding: 0.42rem 0.75rem !important;
    color: #fafafa !important;
    font-size: 0.86rem !important;
    font-family: inherit !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    transition: var(--transition) !important;
    color-scheme: dark !important;
}

input[type="date"].ui-input::-webkit-calendar-picker-indicator, 
input[type="date"].wt-input::-webkit-calendar-picker-indicator,
input[type="date"].form-control::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.8;
    filter: invert(1);
}
input[type="date"].ui-input::-webkit-calendar-picker-indicator:hover, 
input[type="date"].wt-input::-webkit-calendar-picker-indicator:hover,
input[type="date"].form-control::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.ui-input:focus, .ui-select:focus, .ui-textarea:focus, .wt-input:focus, .wt-select:focus, .form-control:focus, .form-select:focus {
    outline: none !important;
    border-color: rgba(59, 130, 246, 0.65) !important;
    background: #18181d !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.22), inset 0 1px 2px rgba(0, 0, 0, 0.4) !important;
}

/* Custom Sleek Dropdown Arrow for Selects */
.ui-select, .wt-select, .form-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.85rem center !important;
    background-size: 14px 14px !important;
    padding-right: 2.5rem !important;
}

.ui-select option, .wt-select option, .form-select option {
    background-color: #121215 !important;
    color: #fafafa !important;
    padding: 0.6rem !important;
    font-size: 0.86rem !important;
}

.ui-input::placeholder, .wt-input::placeholder, .form-control::placeholder { color: var(--text-muted) !important; }

textarea, textarea.ui-input, textarea.form-control, .ui-textarea {
    min-height: 80px !important;
    height: auto !important;
    resize: vertical !important;
    background: #16161a !important;
    line-height: 1.5 !important;
}

.form-label.style-label, .wt-label {
    display: block !important;
    margin-bottom: 0.45rem !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
    text-align: left !important;
}

/* Log Work Grid */
.wt-logwork-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 2fr;
    gap: 1rem;
    align-items: end;
}
.wt-logwork-grid .wt-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}
.wt-logwork-grid .wt-field .form-label { margin-bottom: 0; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); }
.wt-logwork-grid .wt-field-wide { grid-column: span 1; }
.wt-logwork-grid .wt-select, .wt-logwork-grid .wt-input { width: 100%; }

@media (max-width: 900px) {
    .wt-logwork-grid { grid-template-columns: 1fr 1fr; }
    .wt-logwork-grid .wt-field-wide { grid-column: span 2; }
}
@media (max-width: 560px) {
    .wt-logwork-grid { grid-template-columns: 1fr; }
    .wt-logwork-grid .wt-field-wide { grid-column: span 1; }
}

.inline-log {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

/* Toast Notifications */
#wta-toast-container, #wt-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}
.wt-toast {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: #18181b;
    color: #fafafa;
    padding: 0.85rem 1.15rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-hover);
    min-width: 280px;
    max-width: 420px;
    font-size: 0.88rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: auto;
    cursor: pointer;
}
.wt-toast.wt-toast-visible { opacity: 1; transform: translateY(0); }
.wt-toast-success { border-left: 3px solid #10b981; }
.wt-toast-success i { color: #34d399; }
.wt-toast-error   { border-left: 3px solid #ef4444; }
.wt-toast-error i   { color: #f87171; }
.wt-toast-warning { border-left: 3px solid #f59e0b; }
.wt-toast-warning i { color: #fbbf24; }
.wt-toast-info    { border-left: 3px solid #3b82f6; }
.wt-toast-info i    { color: #60a5fa; }

/* Progress Bars */
.wt-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 9999px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.wt-progress-bar {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.4s ease;
}

.wt-progress-bar.blue { background: #3b82f6; }
.wt-progress-bar.green { background: #10b981; }
.wt-progress-bar.amber { background: #f59e0b; }
.wt-progress-bar.red { background: #ef4444; }

/* Missing Days Calendar */
.days-grid {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.day-cell {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.day-cell.logged { background: rgba(16, 185, 129, 0.15); border-color: rgba(16, 185, 129, 0.35); color: #34d399; }
.day-cell.missing { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.3); color: #f87171; }
.day-cell.today { border-color: #fafafa; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2); }
.day-cell.future { opacity: 0.3; }
.day-cell.weekend { opacity: 0.15; }

/* Quick Action FAB */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #fafafa;
    color: #09090b;
    border: none;
    font-size: 1.35rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.06) translateY(-2px);
    background: #e4e4e7;
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.6);
}

/* Alerts */
.wt-alert {
    border-radius: var(--radius-sm);
    padding: 0.85rem 1.15rem;
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 1px solid transparent;
}

.wt-alert-success { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.25); color: #34d399; }
.wt-alert-danger { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.25); color: #f87171; }
.wt-alert-warning { background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.25); color: #fbbf24; }
.wt-alert-info { background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.25); color: #60a5fa; }

/* Utility Classes */
.text-gradient { color: var(--text-primary); font-weight: 700; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 0.75rem !important; }
.gap-1 { gap: 0.4rem !important; }
.gap-2 { gap: 0.75rem !important; }
.gap-3 { gap: 1.1rem !important; }
.d-flex { display: flex; }
.flex-grow-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
.align-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.w-100 { width: 100%; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.85rem; align-items: stretch; }
.grid-4 > .stat-card, .grid-4 > .ui-stat-card { display: flex; flex-direction: column; }

/* Sprint-Nav Row: Prev Button + Select + Next Button in one compact flex row */
.sprint-nav-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}
.sprint-nav-row select, .sprint-nav-row .ui-select {
    flex: 1;
    min-width: 0;
}

/* Page Header Card — used at top of every main page */
.page-header-card {
    background: linear-gradient(145deg, #16161b 0%, #101013 100%);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 0.85rem 1.25rem;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,.5);
    margin-bottom: 0.75rem;
}

/* KPI Strip — horizontal 3-col strip for stat cards */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.kpi-strip-card {
    background: linear-gradient(145deg, #16161a 0%, #111114 100%);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,.4);
}
.kpi-strip-card .kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}
.kpi-strip-card .kpi-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.15rem;
}
.kpi-strip-card .kpi-value {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2;
}
.kpi-strip-card .kpi-detail {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

/* Work-Type Button Grid */
.work-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr));
    gap: 0.65rem;
}

/* =========================================
   Mobile-First & Touch-Friendly Responsive Architecture (Phase 5)
   ========================================= */

/* Mobile Offcanvas Drawer & Backdrop */
.mobile-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.mobile-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile Bottom Navigation Bar (Docked on Phones) */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 66px;
    background: rgba(14, 14, 17, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    display: none;
    z-index: 1030;
    padding: 0 0.5rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.6);
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.4rem 0;
    transition: var(--transition);
    position: relative;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    transition: transform 0.15s ease;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: #38bdf8;
    text-decoration: none;
}

.bottom-nav-item.active i {
    transform: scale(1.15);
    color: #38bdf8;
}

.bottom-nav-item.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 2px;
    background: #38bdf8;
    border-radius: 2px;
    box-shadow: 0 0 8px #38bdf8;
}

/* Responsive Table Wrapper for Mobile Scrolling */
.ui-table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
}


/* =========================================
   Mobile-First Component Utilities
   page-header-card | kpi-strip | sprint-nav-row | work-type-grid
   ========================================= */

/* Compact page header card (replaces bulky p-4 headers) */
.page-header-card {
    background: linear-gradient(135deg, var(--bg-card), var(--bg-elevated, #18181c));
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
    border-radius: var(--radius, 10px);
    padding: 0.85rem 1.25rem;
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.4));
    margin-bottom: 0.75rem;
}

/* Sprint selector row — icon button | full-width select | icon button */
.sprint-nav-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}
.sprint-nav-row form,
.sprint-nav-row > form {
    flex: 1;
    min-width: 0;
}
.sprint-nav-row select,
.sprint-nav-row .ui-select {
    width: 100%;
}

/* Horizontal 3-column KPI strip — always 3 cols even on narrow screens */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.kpi-strip-card {
    background: var(--bg-card, #121215);
    border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
    border-radius: var(--radius, 10px);
    padding: 0.65rem 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.kpi-strip-card .kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}
.kpi-strip-card .kpi-label {
    font-size: 0.68rem;
    color: var(--text-muted, #71717a);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.kpi-strip-card .kpi-value {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.1;
}
.kpi-strip-card .kpi-detail {
    font-size: 0.7rem;
    color: var(--text-muted, #71717a);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 2-column work-type button grid */
.work-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}
.work-type-grid .ui-btn {
    justify-content: flex-start;
    text-align: left;
}

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}


@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100vh;
        z-index: 1050;
        border-right: 1px solid var(--border-color);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.85);
    }
    .sidebar.mobile-open {
        left: 0;
    }
    .main-content {
        margin-left: 0;
    }
    .topbar {
        padding: 0.75rem 1.25rem;
    }
}

@media (max-width: 768px) {
    .page-content {
        padding: 1rem 0.85rem 90px 0.85rem;
    }
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .grid-3, .grid-4 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .mobile-bottom-nav {
        display: flex;
    }
    /* Compact card body padding on mobile */
    .wt-card-body, .ui-card-body {
        padding: 1rem;
    }
    .page-header-card {
        padding: 0.9rem 1rem;
    }
    .kpi-strip {
        gap: 0.5rem;
    }
    .kpi-strip-card {
        padding: 0.65rem 0.75rem;
        gap: 0.5rem;
    }
    .kpi-strip-card .kpi-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    .kpi-strip-card .kpi-value {
        font-size: 1rem;
    }
    /* Touch Ergonomics: Minimum 44px tap targets */
    .wt-btn, .ui-btn, .wt-input, .wt-select, .ui-input, .ui-select, button, select,
    input[type="text"], input[type="number"], input[type="date"] {
        min-height: 44px;
    }
    /* Prevent iOS Safari auto-zoom on input focus */
    input[type="text"], input[type="number"], input[type="date"], select, textarea {
        font-size: 16px !important;
    }
    /* mb utilities smaller on mobile */
    .mb-4 { margin-bottom: 1rem !important; }
    .mb-3 { margin-bottom: 0.75rem !important; }
    /* stat card */
    .stat-card, .ui-stat-card {
        padding: 0.9rem 1rem;
    }
    .stat-card .stat-value, .ui-stat-card .stat-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 600px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
    .kpi-strip {
        grid-template-columns: repeat(3, 1fr);
    }
    .work-type-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .page-content {
        padding: 0.85rem 0.75rem 90px 0.75rem;
    }
    .topbar {
        padding: 0.6rem 0.85rem;
    }
    .topbar-title {
        font-size: 0.9rem;
    }
    .page-header-card {
        padding: 0.75rem 0.85rem;
    }
    .kpi-strip-card .kpi-label {
        font-size: 0.6rem;
    }
    .kpi-strip-card .kpi-detail {
        display: none;
    }
}