/**
 * TimeTracker - Responsive Styles
 * Version: 3.0
 * Single codebase, CSS handles layout
 */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #10b981;
    --success-hover: #059669;
    --warning: #f59e0b;
    --warning-hover: #d97706;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --font-mono: 'SF Mono', 'Consolas', 'Liberation Mono', monospace;
    
    --sidebar-width: 240px;
    --bottom-nav-height: 70px;
}

html {
    font-size: 14px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ==================== LAYOUT ==================== */

.app-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
}

/* Sidebar - Desktop */
.sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    overflow-y: auto;
    z-index: 100;
}

.logo {
    padding: 0 24px 24px;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.nav-section {
    padding: 0 12px;
    margin-bottom: 24px;
}

.nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.nav-item.active {
    background: var(--accent);
    color: white;
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 24px;
    border-top: 1px solid var(--border);
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-dark);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.connected { background: var(--success); }
.status-dot.reconnecting { background: var(--warning); animation: pulse 1s infinite; }
.status-dot.disconnected { background: var(--danger); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Bottom Nav - Mobile (hidden on desktop) */
.bottom-nav {
    display: none;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 32px;
    min-height: 100vh;
}

/* ==================== PAGE HEADER ==================== */

.page-header {
    margin-bottom: 32px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-secondary);
}

.page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

/* ==================== TIMER ==================== */

.timer-hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 32px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: center;
}

.timer-main {
    text-align: center;
}

.timer-display {
    font-family: var(--font-mono);
    font-size: 72px;
    font-weight: 700;
    letter-spacing: 4px;
    margin-bottom: 16px;
}

.timer-display.idle { color: var(--text-muted); }
.timer-display.running { color: var(--success); text-shadow: 0 0 40px rgba(16, 185, 129, 0.3); }
.timer-display.paused { color: var(--warning); }

.timer-status {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    min-height: 20px;
}

.timer-status strong {
    color: var(--text-primary);
}

.timer-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
}

.timer-form {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
}

/* ==================== BUTTONS ==================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    gap: 8px;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover:not(:disabled) { background: var(--success-hover); }

.btn-warning { background: var(--warning); color: white; }
.btn-warning:hover:not(:disabled) { background: var(--warning-hover); }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover:not(:disabled) { background: var(--danger-hover); }

.btn-secondary { background: var(--bg-hover); color: var(--text-primary); }
.btn-secondary:hover:not(:disabled) { background: var(--border); }

.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 16px 48px; font-size: 16px; }

.btn-start {
    background: var(--success);
    color: white;
    padding: 16px 48px;
    font-size: 16px;
}

.btn-start:hover {
    background: var(--success-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ==================== FORMS ==================== */

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
}

.form-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-control::placeholder {
    color: var(--text-muted);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-text {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Toggle Pills */
.toggle-pills {
    display: flex;
    background: var(--bg-dark);
    border-radius: 8px;
    padding: 4px;
}

.toggle-pill {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.toggle-pill:hover { color: var(--text-primary); }
.toggle-pill.active { background: var(--accent); color: white; }
.toggle-pill:disabled { opacity: 0.6; cursor: not-allowed; }

/* ==================== STATS ==================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
}

.stat-change {
    font-size: 12px;
    color: var(--success);
    margin-top: 4px;
}

/* ==================== CARDS ==================== */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.card:last-child {
    margin-bottom: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
}

.card-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-dark);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.card-body {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* ==================== TABLES ==================== */

.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 12px;
}

.table-title {
    font-size: 16px;
    font-weight: 600;
}

.table-row {
    display: grid;
    padding: 14px 20px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row.header {
    background: var(--bg-dark);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
}

.table-row:not(.header):hover {
    background: var(--bg-hover);
}

/* Entry Rows */
.entries-table .table-row {
    grid-template-columns: 1fr 160px 100px 100px 100px;
}

.entry-title {
    font-weight: 500;
}

.entry-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.entry-time {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
}

.entry-duration {
    font-weight: 600;
}

.entry-billed {
    color: var(--success);
    font-weight: 600;
}

.entry-actions {
    display: flex;
    gap: 8px;
}

/* ==================== BADGES ==================== */

.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
}

.badge-primary { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-success { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.badge-danger { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.badge-secondary { background: rgba(148, 163, 184, 0.2); color: var(--text-secondary); }

.badge-client { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.badge-internal { background: rgba(148, 163, 184, 0.2); color: var(--text-secondary); }
.badge-personal { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

.badge-regular { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.badge-afterhours { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.badge-emergency { background: rgba(239, 68, 68, 0.2); color: var(--danger); }
.badge-saturday, .badge-sunday { background: rgba(168, 85, 247, 0.2); color: #c084fc; }

/* ==================== MODALS ==================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    transform: translateY(-20px);
    transition: transform 0.2s;
}

.modal-overlay.open .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid var(--border);
}

/* ==================== TOAST ==================== */

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--danger); }
.toast-warning { border-color: var(--warning); }

/* ==================== CALENDAR ==================== */

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.calendar-nav {
    display: flex;
    gap: 8px;
}

.calendar-title {
    font-size: 24px;
    font-weight: 700;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.calendar-weekday {
    background: var(--bg-dark);
    padding: 12px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.calendar-day {
    background: var(--bg-card);
    padding: 12px;
    min-height: 100px;
    cursor: pointer;
    transition: background 0.15s;
}

.calendar-day:hover {
    background: var(--bg-hover);
}

.calendar-day.other-month {
    background: var(--bg-dark);
    color: var(--text-muted);
}

.calendar-day.today {
    background: rgba(59, 130, 246, 0.1);
}

.calendar-day.today .day-number {
    background: var(--accent);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.day-number {
    font-weight: 600;
    margin-bottom: 8px;
}

.day-hours {
    font-size: 12px;
    color: var(--text-secondary);
}

.day-bar {
    height: 4px;
    background: var(--accent);
    border-radius: 2px;
    margin-top: 8px;
}

/* ==================== REPORTS ==================== */

.report-filters {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.report-filters .form-group {
    margin-bottom: 0;
    min-width: 150px;
}

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

.chart-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.chart-bar:last-child {
    margin-bottom: 0;
}

.chart-label {
    width: 200px;
    flex-shrink: 0;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chart-bar-container {
    flex: 1;
    height: 24px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s;
}

.chart-value {
    width: 60px;
    text-align: right;
    font-weight: 600;
    font-family: var(--font-mono);
}

/* ==================== TABS ==================== */

.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 24px;
    width: fit-content;
    flex-wrap: wrap;
}

.tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.tab:hover { color: var(--text-primary); }
.tab.active { background: var(--accent); color: white; }

/* ==================== STATUS ==================== */

.status-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.status-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-indicator {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.status-indicator.healthy { background: rgba(16, 185, 129, 0.2); color: var(--success); }
.status-indicator.warning { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.status-indicator.error { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

.status-info h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.status-info span {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==================== LOG VIEWER ==================== */

.log-viewer {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.8;
    max-height: 300px;
    overflow-y: auto;
}

.log-line {
    display: flex;
    gap: 12px;
}

.log-time {
    color: var(--text-muted);
    flex-shrink: 0;
}

.log-level {
    flex-shrink: 0;
    width: 50px;
}

.log-level.info { color: var(--accent); }
.log-level.warn { color: var(--warning); }
.log-level.error { color: var(--danger); }

.log-message {
    color: var(--text-secondary);
}

/* ==================== MISC ==================== */

.progress-bar {
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s;
}

.danger-zone {
    border-color: rgba(239, 68, 68, 0.3);
}

.danger-zone .card-title {
    color: var(--danger);
}

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    margin-bottom: 16px;
}

/* Timesheet Preview */
.timesheet-preview {
    background: white;
    color: #1f2937;
    padding: 32px;
    border-radius: 8px;
}

.timesheet-preview table {
    width: 100%;
    border-collapse: collapse;
}

.timesheet-preview th,
.timesheet-preview td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.timesheet-preview th {
    background: #f3f4f6;
    font-weight: 600;
}

/* ==================== UTILITIES ==================== */

.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-center { text-align: center; }
.text-right { text-align: right; }

.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.mb-lg { margin-bottom: 24px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mt-lg { margin-top: 24px; }

/* ==================== MOBILE STYLES ==================== */

@media (max-width: 768px) {
    html {
        font-size: 16px;
    }
    
    /* Hide sidebar, show bottom nav */
    .sidebar {
        display: none;
    }
    
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-top: 1px solid var(--border);
        justify-content: space-around;
        padding: 8px 0;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
        z-index: 100;
    }
    
    .bottom-nav .nav-item {
        flex-direction: column;
        gap: 4px;
        font-size: 10px;
        padding: 8px 12px;
    }
    
    .bottom-nav .nav-icon {
        font-size: 22px;
    }
    
    /* Adjust layout */
    .app-layout {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
        padding-bottom: calc(var(--bottom-nav-height) + 20px);
    }
    
    /* Page Header */
    .page-title {
        font-size: 22px;
    }
    
    .page-header-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    /* Timer */
    .timer-hero {
        grid-template-columns: 1fr;
        padding: 24px;
        gap: 24px;
    }
    
    .timer-display {
        font-size: 48px;
        letter-spacing: 2px;
    }
    
    .timer-form {
        padding: 16px;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    /* Status Grid */
    .status-grid {
        grid-template-columns: 1fr;
    }
    
    /* Tables */
    .entries-table .table-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .entries-table .table-row.header {
        display: none;
    }
    
    .entry-actions {
        margin-top: 8px;
    }
    
    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-control {
        padding: 14px 16px;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    /* Buttons */
    .btn {
        padding: 14px 20px;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        width: 100%;
    }
    
    /* Calendar */
    .calendar-day {
        min-height: 60px;
        padding: 8px;
    }
    
    .day-hours {
        font-size: 10px;
    }
    
    /* Reports */
    .report-filters {
        flex-direction: column;
    }
    
    .report-filters .form-group {
        min-width: 100%;
    }
    
    .chart-label {
        width: 100px;
        font-size: 12px;
    }
    
    .chart-value {
        width: 50px;
        font-size: 12px;
    }
    
    /* Tabs */
    .tabs {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .tab {
        padding: 10px 14px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    /* Cards Grid */
    .cards-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Modals */
    .modal {
        max-width: 100%;
        margin: 16px;
        max-height: calc(100vh - 32px);
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    /* Toast */
    .toast {
        left: 16px;
        right: 16px;
        bottom: calc(var(--bottom-nav-height) + 16px);
        text-align: center;
    }
}

/* Extra small screens */
@media (max-width: 380px) {
    .timer-display {
        font-size: 40px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .calendar-grid {
        font-size: 12px;
    }
    
    .calendar-day {
        min-height: 50px;
        padding: 6px;
    }
}
