/* MMDL Mobile - Modern App Styles v2.0 */

/* ============================================
   CSS VARIABLES & THEMING
   ============================================ */

:root {
    /* Light Theme (default) */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.3);

    --secondary: #ec4899;
    --secondary-light: #f472b6;

    --background: #f8fafc;
    --background-alt: #f1f5f9;
    --surface: #ffffff;
    --surface-elevated: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.8);

    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --divider: rgba(0, 0, 0, 0.06);

    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.15);
    --error: #ef4444;
    --error-light: rgba(239, 68, 68, 0.15);
    --info: #3b82f6;
    --info-light: rgba(59, 130, 246, 0.15);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px var(--primary-glow);

    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    --header-height: 60px;
    --bottom-nav-height: 70px;
    --fab-size: 56px;

    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;

    /* Module Colors */
    --module-health: #10b981;
    --module-finance: #22c55e;
    --module-tasks: #f59e0b;
    --module-notes: #8b5cf6;
    --module-household: #06b6d4;
    --module-personal: #ec4899;
    --module-travel: #f97316;
    --module-it: #6366f1;
    --module-books: #a855f7;
}

/* Dark Theme */
[data-theme="dark"] {
    --background: #0f172a;
    --background-alt: #1e293b;
    --surface: #1e293b;
    --surface-elevated: #334155;
    --surface-glass: rgba(30, 41, 59, 0.85);

    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --border: #334155;
    --border-light: #1e293b;
    --divider: rgba(255, 255, 255, 0.06);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
}

/* ============================================
   BASE STYLES
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--background);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Smooth scrolling container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.25;
    color: var(--text);
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

p {
    color: var(--text-secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ============================================
   LOGIN SCREEN
   ============================================ */

#login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

#login-screen article {
    background: var(--surface);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#login-screen header {
    text-align: center;
    margin-bottom: 2rem;
}

#login-screen h1 {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

#login-screen header p {
    color: var(--text-muted);
}

#login-screen .form-group {
    margin-bottom: 1.25rem;
}

#login-screen input {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--background-alt);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    color: var(--text);
    font-size: 1rem;
    transition: all var(--transition-fast);
}

#login-screen input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: var(--shadow-glow);
}

#login-screen button[type="submit"] {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

#login-screen button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

#login-screen button[type="submit"]:active {
    transform: translateY(0);
}

.error-message {
    color: var(--error);
    text-align: center;
    padding: 0.75rem;
    background: var(--error-light);
    border-radius: var(--radius-md);
    margin-top: 1rem;
    font-size: 0.875rem;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ============================================
   APP HEADER
   ============================================ */

.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--divider);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    z-index: 100;
    transition: background-color var(--transition-normal);
}

.app-header h1 {
    font-size: 1.125rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: var(--background-alt);
    color: var(--text);
}

.icon-btn:active {
    transform: scale(0.95);
}

/* Search Bar in Header */
.header-search {
    flex: 1;
    max-width: 400px;
    margin: 0 1rem;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    background: var(--background-alt);
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    color: var(--text);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.header-search input:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.header-search .search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   SIDE MENU
   ============================================ */

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

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

nav.side-menu {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 300px !important;
    height: 100vh !important;
    background: var(--surface) !important;
    z-index: 200 !important;
    display: flex !important;
    flex-direction: column !important;
    transform: translateX(-100%);
    transition: transform var(--transition-normal) !important;
    box-shadow: var(--shadow-xl);
}

nav.side-menu.open {
    transform: translateX(0) !important;
}

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

.menu-header span {
    font-weight: 700;
    font-size: 1.125rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav.side-menu ul {
    list-style: none !important;
    flex: 1 !important;
    overflow-y: auto !important;
    padding: 0.5rem 0 !important;
}

nav.side-menu li {
    margin: 0.25rem 0.5rem !important;
}

nav.side-menu li a {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.875rem 1rem !important;
    color: var(--text) !important;
    text-decoration: none !important;
    border-radius: var(--radius-md) !important;
    transition: all var(--transition-fast) !important;
    font-weight: 500 !important;
}

nav.side-menu li a:hover {
    background: var(--background-alt) !important;
}

nav.side-menu li a.active {
    background: var(--primary-glow) !important;
    color: var(--primary) !important;
}

nav.side-menu li a .menu-icon {
    font-size: 1.25rem;
    width: 1.5rem;
    text-align: center;
}

.menu-footer {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

.menu-footer .theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--background-alt);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
}

.menu-footer .theme-toggle span {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: var(--radius-full);
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.toggle-switch.active::after {
    transform: translateX(24px);
}

.menu-footer button {
    width: 100%;
    padding: 0.875rem;
    background: var(--error-light);
    color: var(--error);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.menu-footer button:hover {
    background: var(--error);
    color: white;
}

/* ============================================
   CONTENT AREA
   ============================================ */

.content {
    flex: 1;
    padding: calc(var(--header-height) + 1rem) 1rem calc(var(--bottom-nav-height) + 1rem);
    min-height: 100vh;
    transition: padding var(--transition-normal);
}

/* Pull to Refresh */
.pull-indicator {
    position: fixed;
    top: var(--header-height);
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: var(--surface);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    opacity: 0;
    transition: all var(--transition-fast);
    z-index: 50;
}

.pull-indicator.visible {
    transform: translateX(-50%) translateY(1rem);
    opacity: 1;
}

.pull-indicator .spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   BOTTOM NAVIGATION
   ============================================ */

nav.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: var(--bottom-nav-height) !important;
    background: var(--surface-glass) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-top: 1px solid var(--divider) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-around !important;
    padding: 0 0.5rem !important;
    padding-bottom: env(safe-area-inset-bottom, 0) !important;
    z-index: 100 !important;
}

nav.bottom-nav button {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: none !important;
    border: none !important;
    color: var(--text-muted) !important;
    padding: 0.5rem 0.75rem !important;
    cursor: pointer !important;
    border-radius: var(--radius-md) !important;
    transition: all var(--transition-fast) !important;
    position: relative !important;
    min-width: 60px !important;
}

nav.bottom-nav button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: transform var(--transition-fast);
}

nav.bottom-nav button.active {
    color: var(--primary) !important;
}

nav.bottom-nav button.active::before {
    transform: translateX(-50%) scaleX(1);
}

nav.bottom-nav button:active {
    transform: scale(0.95);
}

.nav-icon {
    font-size: 1.375rem;
    margin-bottom: 0.25rem;
    transition: transform var(--transition-fast);
}

nav.bottom-nav button.active .nav-icon {
    transform: scale(1.1);
}

.nav-label {
    font-size: 0.625rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Center Quick Add Button */
.quick-add-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    color: white !important;
    width: var(--fab-size) !important;
    height: var(--fab-size) !important;
    border-radius: var(--radius-full) !important;
    margin-top: -1.5rem !important;
    box-shadow: var(--shadow-lg), var(--shadow-glow) !important;
    transition: all var(--transition-fast) !important;
}

.quick-add-btn:hover {
    transform: scale(1.05) !important;
    box-shadow: var(--shadow-xl), 0 0 30px var(--primary-glow) !important;
}

.quick-add-btn:active {
    transform: scale(0.95) !important;
}

.quick-add-btn .nav-icon {
    font-size: 1.75rem !important;
    margin-bottom: 0 !important;
}

.quick-add-btn .nav-label {
    display: none !important;
}

/* ============================================
   FLOATING ACTION BUTTON (FAB)
   ============================================ */

.fab {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 1rem);
    right: 1rem;
    width: var(--fab-size);
    height: var(--fab-size);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    transition: all var(--transition-fast);
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl), 0 0 30px var(--primary-glow);
}

.fab:active {
    transform: scale(0.95);
}

.fab.expanded {
    border-radius: var(--radius-xl);
    width: auto;
    padding: 0 1.5rem;
}

/* FAB Menu */
.fab-menu {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + var(--fab-size) + 1.5rem);
    right: 1rem;
    display: flex;
    flex-direction: column-reverse;
    gap: 0.75rem;
    z-index: 89;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all var(--transition-normal);
}

.fab-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.fab-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.fab-menu-item:hover {
    transform: translateX(-5px);
    box-shadow: var(--shadow-xl);
}

.fab-menu-item-icon {
    width: 36px;
    height: 36px;
    background: var(--primary-glow);
    color: var(--primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.fab-menu-item-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
}

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

.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-fast);
    margin-bottom: 1rem;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.card-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-light);
    background: var(--background-alt);
}

/* Glass Card */
.card-glass {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--divider);
}

/* Gradient Card */
.card-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.card-gradient .card-title,
.card-gradient .card-subtitle,
.card-gradient p {
    color: white;
}

/* ============================================
   STATS GRID & WIDGETS
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:active {
    transform: scale(0.98);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    margin-top: 0.5rem;
}

.stat-trend.up {
    background: var(--success-light);
    color: var(--success);
}

.stat-trend.down {
    background: var(--error-light);
    color: var(--error);
}

/* Widget Card */
.widget {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1rem;
}

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

.widget-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
}

.widget-title-icon {
    font-size: 1.125rem;
}

.widget-action {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
}

.widget-body {
    padding: 1rem 1.25rem;
}

/* ============================================
   NAVIGATION GRID
   ============================================ */

.nav-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.nav-grid button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.nav-grid button:hover {
    background: var(--background-alt);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.nav-grid button:active {
    transform: scale(0.98);
}

.nav-grid button .nav-grid-icon {
    font-size: 1.25rem;
}

/* ============================================
   LISTS
   ============================================ */

.list-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--surface);
    border-radius: var(--radius-md);
    margin-bottom: 0.5rem;
    gap: 1rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.list-item:hover {
    background: var(--background-alt);
    transform: translateX(4px);
}

.list-item:active {
    transform: scale(0.99);
}

.list-item-icon {
    font-size: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-alt);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Swipeable List Item */
.list-item-swipe {
    position: relative;
    overflow: visible;
}

.swipe-actions {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    display: flex;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.list-item-swipe.swiped .swipe-actions {
    opacity: 1;
}

.swipe-action {
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.swipe-action-delete {
    background: var(--error);
}

.swipe-action-edit {
    background: var(--primary);
}

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

.info-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.info-card-header {
    padding: 0.875rem 1rem;
    background: var(--background-alt);
    font-weight: 600;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-light);
}

.info-card-content {
    padding: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-light);
}

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

.info-label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.info-value {
    font-weight: 500;
    color: var(--text);
}

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

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    background: var(--background-alt);
    color: var(--text-secondary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-error {
    background: var(--error-light);
    color: var(--error);
}

.badge-info {
    background: var(--info-light);
    color: var(--info);
}

.badge-primary {
    background: var(--primary-glow);
    color: var(--primary);
}

/* Badge with dot */
.badge-dot {
    position: relative;
    padding-left: 1rem;
}

.badge-dot::before {
    content: '';
    position: absolute;
    left: 0.375rem;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ============================================
   PROGRESS BARS
   ============================================ */

.progress-bar {
    height: 8px;
    background: var(--background-alt);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Circular Progress */
.progress-circle {
    position: relative;
    width: 80px;
    height: 80px;
}

.progress-circle svg {
    transform: rotate(-90deg);
}

.progress-circle-bg {
    fill: none;
    stroke: var(--background-alt);
    stroke-width: 8;
}

.progress-circle-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset var(--transition-slow);
}

.progress-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}

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

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text);
}

.form-group label .required {
    color: var(--error);
    margin-left: 0.25rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--background-alt);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

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

/* Floating Label */
.form-floating {
    position: relative;
}

.form-floating input,
.form-floating select,
.form-floating textarea {
    padding-top: 1.5rem;
    padding-bottom: 0.5rem;
}

.form-floating label {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    transition: all var(--transition-fast);
    pointer-events: none;
    color: var(--text-muted);
    margin: 0;
}

.form-floating input:focus ~ label,
.form-floating input:not(:placeholder-shown) ~ label,
.form-floating select:focus ~ label,
.form-floating textarea:focus ~ label {
    top: 0.75rem;
    transform: translateY(0);
    font-size: 0.75rem;
    color: var(--primary);
}

/* Form Row */
.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .form-group {
    flex: 1;
}

/* Checkbox & Radio */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.form-check input {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-check label {
    margin: 0;
    cursor: pointer;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    border: none;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--background-alt);
    color: var(--text);
}

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

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

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

.btn-error, .btn-danger {
    background: var(--error);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--background-alt);
    color: var(--text);
}

.btn-sm {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.0625rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-full);
}

/* Action Grid */
.action-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.action-grid .btn {
    flex: 1;
    min-width: calc(50% - 0.25rem);
}

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

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 300;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

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

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform var(--transition-normal);
}

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

.modal-content header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.modal-content header::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--border);
    border-radius: var(--radius-full);
}

.modal-content header h3 {
    font-size: 1.125rem;
    margin: 0;
}

.modal-body {
    padding: 1.25rem;
}

.modal-content footer {
    display: flex;
    gap: 0.75rem;
    padding: 1.25rem;
    border-top: 1px solid var(--border-light);
    background: var(--background-alt);
}

.modal-content footer button {
    flex: 1;
}

/* Center Modal */
.modal.modal-center {
    align-items: center;
    padding: 1rem;
}

.modal.modal-center .modal-content {
    border-radius: var(--radius-xl);
    max-height: 80vh;
}

.modal.modal-center .modal-content header::before {
    display: none;
}

/* Quick Add Modal */
.quick-add-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    padding: 1.25rem;
}

.quick-add-grid button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 0.75rem;
    background: var(--background-alt);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    color: var(--text);
    cursor: pointer;
    gap: 0.5rem;
    transition: all var(--transition-fast);
}

.quick-add-grid button:hover {
    background: var(--primary-glow);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.quick-add-grid button:active {
    transform: scale(0.95);
}

.quick-add-grid button span:first-child {
    font-size: 1.75rem;
}

.quick-add-grid button span:last-child {
    font-size: 0.75rem;
    font-weight: 500;
}

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

#toast-container {
    position: fixed;
    top: calc(var(--header-height) + 0.75rem);
    left: 1rem;
    right: 1rem;
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    pointer-events: auto;
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    flex: 1;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-success .toast-icon {
    color: var(--success);
}

.toast-error {
    border-left: 4px solid var(--error);
}

.toast-error .toast-icon {
    color: var(--error);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-warning .toast-icon {
    color: var(--warning);
}

.toast-info {
    border-left: 4px solid var(--info);
}

.toast-info .toast-icon {
    color: var(--info);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast.toast-out {
    animation: toastOut 0.2s ease forwards;
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* ============================================
   SECTION HEADERS
   ============================================ */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0 0.25rem;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-link {
    font-size: 0.8125rem;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
}

/* ============================================
   LOADING & SKELETON
   ============================================ */

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--background-alt) 25%, var(--border-light) 50%, var(--background-alt) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-text:last-child {
    width: 70%;
}

.skeleton-title {
    height: 1.5rem;
    width: 60%;
    margin-bottom: 0.75rem;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
}

.skeleton-card {
    height: 120px;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
}

/* ============================================
   CHARTS
   ============================================ */

.chart-container {
    position: relative;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.chart-title {
    font-weight: 600;
    font-size: 0.9375rem;
}

.chart-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.chart-body {
    position: relative;
    height: 200px;
}

/* Simple Bar Chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    height: 100%;
    padding-top: 1rem;
}

.bar-chart-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.bar-chart-bar {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(to top, var(--primary), var(--primary-light));
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: height var(--transition-slow);
}

.bar-chart-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
}

.bar-chart-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text);
}

/* Line Chart (simple CSS version) */
.sparkline {
    height: 60px;
    display: flex;
    align-items: flex-end;
    gap: 2px;
}

.sparkline-bar {
    flex: 1;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.sparkline-bar:hover {
    opacity: 1;
}

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

.calendar {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.calendar-header h4 {
    color: white;
    font-size: 1rem;
}

.calendar-nav {
    display: flex;
    gap: 0.5rem;
}

.calendar-nav button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.calendar-nav button:hover {
    background: rgba(255,255,255,0.3);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 0.75rem;
    background: var(--background-alt);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    text-align: center;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    padding: 0.5rem;
    gap: 0.25rem;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.calendar-day.other-month {
    color: var(--text-muted);
    opacity: 0.5;
}

.calendar-day.today {
    background: var(--primary-glow);
    color: var(--primary);
    font-weight: 600;
}

.calendar-day.selected {
    background: var(--primary);
    color: white;
}

.calendar-day.has-event {
    position: relative;
}

.calendar-day.has-event::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--primary);
    border-radius: 50%;
}

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

.tabs {
    display: flex;
    background: var(--background-alt);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
    margin-bottom: 1.5rem;
}

.tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   FILTER BAR
   ============================================ */

.filter-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-chip:hover {
    border-color: var(--primary);
}

.filter-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ============================================
   SEARCH RESULTS
   ============================================ */

.search-results {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--background-alt);
}

.search-result-icon {
    font-size: 1.25rem;
}

.search-result-content {
    flex: 1;
}

.search-result-title {
    font-weight: 500;
}

.search-result-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ============================================
   PRIORITY COLORS
   ============================================ */

.priority-1 { color: var(--text-muted); }
.priority-2 { color: var(--info); }
.priority-3 { color: var(--warning); }
.priority-4 { color: var(--error); }

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

.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-info { color: var(--info); }
.text-primary { color: var(--primary); }

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

.hidden { display: none !important; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* ============================================
   SCANNER
   ============================================ */

#scanner-container {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--background);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

#scanner-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scanner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scanner-frame {
    width: 250px;
    height: 250px;
    border: 3px solid var(--primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
    position: relative;
}

.scanner-frame::before,
.scanner-frame::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: var(--primary);
    border-style: solid;
}

.scanner-frame::before {
    top: -3px;
    left: -3px;
    border-width: 4px 0 0 4px;
    border-radius: var(--radius-md) 0 0 0;
}

.scanner-frame::after {
    bottom: -3px;
    right: -3px;
    border-width: 0 4px 4px 0;
    border-radius: 0 0 var(--radius-md) 0;
}

.scanner-line {
    position: absolute;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: scan 2s linear infinite;
}

@keyframes scan {
    0%, 100% { top: 10%; }
    50% { top: 90%; }
}

#scanner-result {
    padding: 1rem;
    text-align: center;
    background: var(--surface);
    border-radius: var(--radius-lg);
    margin-top: 1rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (min-width: 640px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .nav-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .quick-add-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) {
    .content {
        max-width: 720px;
        margin: 0 auto;
    }

    .modal-content {
        border-radius: var(--radius-xl);
        max-width: 480px;
    }

    .modal {
        align-items: center;
        padding: 2rem;
    }

    .modal-content header::before {
        display: none;
    }
}

@media (min-width: 1024px) {
    :root {
        --bottom-nav-height: 0px;
    }

    nav.bottom-nav {
        display: none !important;
    }

    nav.side-menu {
        transform: translateX(0) !important;
        box-shadow: none;
        border-right: 1px solid var(--border);
    }

    .menu-overlay {
        display: none !important;
    }

    .content {
        max-width: none;
        margin-left: 300px;
        padding-bottom: 2rem;
    }

    .app-header {
        left: 300px;
    }

    .fab {
        bottom: 2rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .app-header,
    .side-menu,
    .bottom-nav,
    .fab,
    .fab-menu,
    .modal {
        display: none !important;
    }

    .content {
        padding: 0;
        margin: 0;
    }

    body {
        background: white;
        color: black;
    }
}

/* ============================================
   SAFE AREA (iOS notch support)
   ============================================ */

@supports (padding-top: env(safe-area-inset-top)) {
    .app-header {
        padding-top: env(safe-area-inset-top);
        height: calc(var(--header-height) + env(safe-area-inset-top));
    }

    .content {
        padding-top: calc(var(--header-height) + env(safe-area-inset-top) + 1rem);
    }
}

/* ============================================
   OFFLINE INDICATOR
   ============================================ */

.offline-indicator {
    position: fixed;
    top: calc(var(--header-height) + env(safe-area-inset-top, 0px) + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    background: var(--warning);
    color: #000;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 1000;
    animation: slideDown 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.offline-indicator .offline-icon {
    font-size: 1rem;
}

.offline-indicator .offline-badge {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* ============================================
   SWIPEABLE ELEMENTS
   ============================================ */

.swipeable {
    position: relative;
    overflow: visible;
    touch-action: pan-y pinch-zoom;
}

.swipeable::before,
.swipeable::after {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity var(--transition-fast);
    pointer-events: none;
}

.swipeable::before {
    content: '✓ Erledigt';
    left: -100px;
    background: var(--success);
    color: white;
}

.swipeable::after {
    content: '🗑 Löschen';
    right: -100px;
    background: var(--error);
    color: white;
}

.swipeable.swiping-right::before {
    opacity: 1;
}

.swipeable.swiping-left::after {
    opacity: 1;
}

/* Swipe hint animation */
.swipe-hint {
    animation: swipeHint 2s ease-in-out;
    animation-delay: 1s;
}

@keyframes swipeHint {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
    75% { transform: translateX(-5px); }
}

/* ============================================
   VOICE INPUT
   ============================================ */

.voice-btn {
    background: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.voice-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.voice-btn:active {
    transform: scale(0.95);
}

.voice-btn.recording {
    background: var(--error);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

.input-with-voice {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.input-with-voice input,
.input-with-voice textarea {
    flex: 1;
}

/* Voice command hint */
.voice-commands-hint {
    background: var(--surface-elevated);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-top: 1rem;
}

.voice-commands-hint h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.voice-commands-hint ul {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-left: 1.25rem;
}

.voice-commands-hint li {
    margin-bottom: 0.25rem;
}

/* ============================================
   BIOMETRIC AUTH
   ============================================ */

.biometric-btn {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text);
    padding: 1rem 2rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    width: 100%;
    margin-top: 1rem;
}

.biometric-btn:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
}

.biometric-btn:active {
    transform: scale(0.98);
}

.biometric-btn .biometric-icon {
    font-size: 1.5rem;
}

/* ============================================
   PWA INSTALL PROMPT
   ============================================ */

.install-prompt {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 1rem);
    left: 1rem;
    right: 1rem;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 100;
    animation: slideUp 0.3s ease;
}

.install-prompt-icon {
    font-size: 2rem;
}

.install-prompt-content {
    flex: 1;
}

.install-prompt-content h4 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.install-prompt-content p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.install-prompt-actions {
    display: flex;
    gap: 0.5rem;
}

.install-prompt-actions button {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
}

.install-prompt-actions .install-btn {
    background: var(--primary);
    color: white;
}

.install-prompt-actions .dismiss-btn {
    background: transparent;
    color: var(--text-muted);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   SHARE TARGET INDICATOR
   ============================================ */

.share-indicator {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* ============================================
   HAPTIC FEEDBACK VISUAL
   ============================================ */

.haptic-feedback {
    animation: hapticPulse 0.1s ease;
}

@keyframes hapticPulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.98); }
    100% { transform: scale(1); }
}

/* ============================================
   BIOMETRIC TOGGLE IN MENU
   ============================================ */

.biometric-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.biometric-toggle span {
    font-size: 0.9rem;
    color: var(--text);
}
