/* ============================================================
   TASKALERT — DESIGN SYSTEM
   Premium Dark/Light Mode with Glassmorphism
   ============================================================ */

/* ── CSS Custom Properties (Light + Dark) ────────────────── */
:root {
    /* Light mode (default) */
    --bg-primary: #f0f2f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8f9fb;
    --bg-sidebar: #ffffff;
    --bg-input: #f5f7fa;
    --bg-input-focus: #ffffff;

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

    --border-color: #e2e8f0;
    --border-light: #f1f5f9;

    --accent-primary: #4f8cff;
    --accent-primary-hover: #3b7bef;
    --accent-primary-bg: rgba(79, 140, 255, 0.1);
    --accent-secondary: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #4f8cff 0%, #7c3aed 100%);

    --status-ok: #22c55e;
    --status-ok-bg: rgba(34, 197, 94, 0.1);
    --status-warning: #f59e0b;
    --status-warning-bg: rgba(245, 158, 11, 0.1);
    --status-danger: #ef4444;
    --status-danger-bg: rgba(239, 68, 68, 0.1);
    --status-info: #3b82f6;
    --status-info-bg: rgba(59, 130, 246, 0.1);

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-blur: 12px;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    --sidebar-width: 260px;
    --topbar-height: 60px;
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 400ms ease;

    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-heading: 'Outfit', 'Inter', sans-serif;
}

/* ── Dark Mode ─────────────────────────────────────────── */
[data-theme="dark"] {
    --bg-primary: #0f1219;
    --bg-secondary: #1a1f2e;
    --bg-card: #232837;
    --bg-card-hover: #2a3042;
    --bg-sidebar: #161b27;
    --bg-input: #1e2333;
    --bg-input-focus: #272d3e;

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

    --border-color: #2d3548;
    --border-light: #232837;

    --accent-primary-bg: rgba(79, 140, 255, 0.15);
    --status-ok-bg: rgba(34, 197, 94, 0.15);
    --status-warning-bg: rgba(245, 158, 11, 0.15);
    --status-danger-bg: rgba(239, 68, 68, 0.15);
    --status-info-bg: rgba(59, 130, 246, 0.15);

    --glass-bg: rgba(22, 27, 39, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background var(--transition-base), color var(--transition-base);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

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

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

img {
    max-width: 100%;
    height: auto;
}

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.login-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(79, 140, 255, 0.15) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(124, 58, 237, 0.1) 0%, transparent 50%);
    animation: loginBgPulse 8s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes loginBgPulse {
    0% { transform: scale(1) rotate(0deg); }
    100% { transform: scale(1.05) rotate(2deg); }
}

.login-container {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    box-shadow: var(--shadow-xl);
    position: relative;
    z-index: 1;
    animation: loginSlideUp 0.6s ease-out;
}

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

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
}

.login-logo svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 12px rgba(79, 140, 255, 0.3));
}

.login-title {
    font-size: 1.75rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── Auth Forms ────────────────────────────────────────── */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-info {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    background: var(--bg-input-focus);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-bg);
}

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

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

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.password-toggle:hover {
    color: var(--text-primary);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 20px 0 16px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider span {
    padding: 0 12px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 500;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    white-space: nowrap;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 14px rgba(79, 140, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(79, 140, 255, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0) scale(0.97);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1.5px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.btn-danger {
    background: var(--status-danger);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: var(--status-ok);
    color: #fff;
}

.btn-success:hover {
    background: #16a34a;
}

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

.btn-ghost:hover {
    background: var(--accent-primary-bg);
    color: var(--accent-primary);
}

.btn-full {
    width: 100%;
    padding: 14px 20px;
    font-size: 1rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background: var(--accent-primary-bg);
    color: var(--accent-primary);
}

.btn-icon svg {
    width: 20px;
    height: 20px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 4px 0;
    transition: color var(--transition-fast);
}

.btn-link:hover {
    color: var(--accent-primary-hover);
    text-decoration: underline;
}

.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ── Loading states ────────────────────────────────────── */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading span {
    visibility: hidden;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

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

.page-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

/* ============================================================
   APP LAYOUT
   ============================================================ */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Topbar (mobile) ───────────────────────────────────── */
.topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--topbar-height);
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    align-items: center;
    gap: 12px;
    z-index: 100;
    backdrop-filter: blur(var(--glass-blur));
}

.topbar-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.topbar-menu-btn:hover {
    background: var(--accent-primary-bg);
}

.topbar-menu-btn svg {
    width: 22px;
    height: 22px;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.topbar-logo {
    width: 32px;
    height: 32px;
}

.topbar-brand span {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.1rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.topbar-btn:hover {
    background: var(--accent-primary-bg);
    color: var(--accent-primary);
}

.topbar-btn svg {
    width: 20px;
    height: 20px;
}

.topbar-avatar {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

/* ── Theme toggle icon switching ──────────────────────── */
.theme-toggle-btn .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle-btn .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle-btn .icon-moon { display: block; }

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    height: 100dvh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform var(--transition-base);
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

.sidebar-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 1.2rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-version {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── Sidebar Navigation ───────────────────────────────── */
.sidebar-nav {
    flex: 1;
    padding: 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
}

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

.nav-item.active {
    background: var(--accent-primary-bg);
    color: var(--accent-primary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0 6px;
}

.nav-badge-danger {
    background: var(--status-danger);
    color: #fff;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.nav-divider {
    padding: 16px 14px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

/* ── Sidebar Footer ────────────────────────────────────── */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-footer-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Sidebar Overlay ───────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

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

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

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

.card-glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
}

/* ── Stat Cards ────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.stat-card.stat-total::before { background: var(--accent-primary); }
.stat-card.stat-warning::before { background: var(--status-warning); }
.stat-card.stat-danger::before { background: var(--status-danger); }
.stat-card.stat-ok::before { background: var(--status-danger); }
.stat-card.stat-completed::before { background: var(--status-ok); }

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

.stat-card.active {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(79, 140, 255, 0.25), var(--shadow-md);
    background: var(--bg-card-hover);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-icon.icon-total { background: var(--accent-primary-bg); color: var(--accent-primary); }
.stat-icon.icon-warning { background: var(--status-warning-bg); color: var(--status-warning); }
.stat-icon.icon-danger { background: var(--status-danger-bg); color: var(--status-danger); }
.stat-icon.icon-ok { background: var(--status-ok-bg); color: var(--status-ok); }

.stat-info {
    flex: 1;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ── Alert/Reminder Cards ──────────────────────────────── */
.reminder-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reminder-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
}

.reminder-card:hover {
    background: var(--bg-card-hover);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.reminder-status {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    position: relative;
}

.reminder-status.status-ok { background: var(--status-ok); }
.reminder-status.status-warning { background: var(--status-warning); }
.reminder-status.status-danger {
    background: var(--status-danger);
    animation: statusPulse 1.5s ease-in-out infinite;
}
.reminder-status.status-overdue {
    background: var(--status-danger);
    box-shadow: 0 0 0 4px var(--status-danger-bg);
    animation: statusPulse 1s ease-in-out infinite;
}

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

.reminder-info {
    flex: 1;
    min-width: 0;
}

.reminder-title {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reminder-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 2px;
}

.reminder-countdown {
    font-weight: 700;
    font-size: 0.85rem;
    white-space: nowrap;
}

.reminder-countdown.countdown-ok { color: var(--status-ok); }
.reminder-countdown.countdown-warning { color: var(--status-warning); }
.reminder-countdown.countdown-danger { color: var(--status-danger); }

.reminder-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* ── Category Badge ────────────────────────────────────── */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--accent-primary-bg);
    color: var(--accent-primary);
}

/* ── Section Header ────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .section-icon {
    width: 32px;
    height: 32px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Page Header ───────────────────────────────────────── */
.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── Empty State ───────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

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

.empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 0.88rem;
    max-width: 400px;
    margin: 0 auto 20px;
    line-height: 1.5;
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp 0.3s ease;
}

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

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

.modal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--status-danger-bg);
    color: var(--status-danger);
}

.modal-close svg {
    width: 18px;
    height: 18px;
}

.modal-body {
    padding: 24px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* ── Alert Days Chips ──────────────────────────────────── */
.alert-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.alert-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--accent-primary-bg);
    color: var(--accent-primary);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.alert-chip .chip-remove {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(79, 140, 255, 0.2);
    color: var(--accent-primary);
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
    transition: all var(--transition-fast);
}

.alert-chip .chip-remove:hover {
    background: var(--status-danger);
    color: #fff;
}

.alert-chip-add {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: transparent;
    color: var(--text-muted);
    border: 1.5px dashed var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
}

.alert-chip-add:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-primary-bg);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    max-width: 420px;
    pointer-events: auto;
    animation: toastIn 0.3s ease;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.toast.toast-success::before { background: var(--status-ok); }
.toast.toast-error::before { background: var(--status-danger); }
.toast.toast-warning::before { background: var(--status-warning); }
.toast.toast-info::before { background: var(--status-info); }

.toast-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.toast.toast-success .toast-icon { color: var(--status-ok); }
.toast.toast-error .toast-icon { color: var(--status-danger); }
.toast.toast-warning .toast-icon { color: var(--status-warning); }
.toast.toast-info .toast-icon { color: var(--status-info); }

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

.toast-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.toast-close:hover {
    background: var(--status-danger-bg);
    color: var(--status-danger);
}

.toast-close svg {
    width: 14px;
    height: 14px;
}

.toast-undo {
    padding: 4px 10px;
    background: transparent;
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.toast-undo:hover {
    background: var(--accent-primary);
    color: #fff;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

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

@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

/* ============================================================
   FAB (Floating Action Button)
   ============================================================ */
.fab {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(79, 140, 255, 0.4);
    z-index: 50;
    transition: all var(--transition-base);
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 28px rgba(79, 140, 255, 0.5);
}

.fab:active {
    transform: scale(1.05) rotate(90deg);
}

.fab svg {
    width: 24px;
    height: 24px;
}

/* ============================================================
   FILTER/SEARCH BAR
   ============================================================ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.search-input-wrapper svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-input-wrapper input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition-fast);
}

.search-input-wrapper input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-bg);
}

.filter-select {
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    outline: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-select:focus {
    border-color: var(--accent-primary);
}

/* ============================================================
   TOGGLE SWITCH
   ============================================================ */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle {
    position: relative;
    width: 44px;
    height: 24px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--border-color);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition-fast);
    border: none;
    outline: none;
}

.toggle::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle:checked {
    background: var(--accent-primary);
}

.toggle:checked::before {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.88rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ============================================================
   PROGRESS BAR (countdown)
   ============================================================ */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.progress-bar-fill.fill-ok { background: var(--status-ok); }
.progress-bar-fill.fill-warning { background: var(--status-warning); }
.progress-bar-fill.fill-danger { background: var(--status-danger); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.animate-in {
    animation: slideUp 0.4s ease forwards;
}

.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }

/* ============================================================
   TABS
   ============================================================ */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 20px;
}

.tab {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex: 1;
    text-align: center;
}

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

.tab.active {
    background: var(--bg-card);
    color: var(--accent-primary);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   COLLAPSIBLE FILTER BAR & HEADER ACTIONS
   ============================================================ */
.page-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.icon-btn-action:hover, .icon-btn-action.active {
    background: var(--accent-primary-bg);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.icon-btn-action svg {
    width: 18px;
    height: 18px;
}

.filter-bar-compact {
    display: none; /* Ukryty na desktop */
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .topbar {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
        height: 100vh;
        height: 100dvh;
        max-height: 100dvh;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-footer {
        padding: 16px 16px max(32px, calc(env(safe-area-inset-bottom, 16px) + 28px)) 16px;
        margin-top: auto;
    }

    .main-content {
        margin-left: 0;
        padding: 12px;
        padding-top: calc(var(--topbar-height) + 12px);
        overflow-x: hidden;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .modal {
        max-width: 100%;
        border-radius: var(--radius-md);
    }

    .modal-body .form-row {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .toast-container {
        bottom: 80px;
        right: 12px;
        left: 12px;
    }

    .toast {
        min-width: auto;
        max-width: 100%;
    }

    .fab {
        bottom: 20px;
        right: 20px;
    }

    .page-title {
        font-size: 1.3rem;
    }

    .page-subtitle {
        font-size: 0.82rem;
    }

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

    /* ── Collapsible Filter Bar on Mobile ─────────────── */
    .filter-bar-compact {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
    }

    .filter-toggle-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 8px 14px;
        background: var(--bg-input);
        border: 1.5px solid var(--border-color);
        border-radius: var(--radius-sm);
        color: var(--text-secondary);
        font-family: var(--font-body);
        font-size: 0.85rem;
        font-weight: 500;
        cursor: pointer;
        transition: all var(--transition-fast);
        flex: 1;
    }

    .filter-toggle-btn:active {
        background: var(--accent-primary-bg);
        border-color: var(--accent-primary);
        color: var(--accent-primary);
    }

    .filter-toggle-btn.active {
        background: var(--accent-primary-bg);
        border-color: var(--accent-primary);
        color: var(--accent-primary);
    }

    .filter-toggle-btn svg {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

    .filter-bar {
        display: none;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 12px;
        overflow: hidden;
        animation: filterSlideDown 0.3s ease;
    }

    .filter-bar.filter-bar-expanded {
        display: flex;
    }

    @keyframes filterSlideDown {
        from {
            opacity: 0;
            transform: translateY(-8px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .search-input-wrapper {
        width: 100%;
    }

    .search-input-wrapper input {
        padding: 8px 12px 8px 36px;
        font-size: 0.85rem;
    }

    .filter-select {
        padding: 8px 10px;
        font-size: 0.82rem;
        width: 100%;
    }

    /* ── Responsive Reminder Cards ────────────────────── */
    .reminder-card {
        padding: 12px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .reminder-title {
        white-space: normal;
        word-break: break-word;
        font-size: 0.9rem;
        line-height: 1.3;
    }

    .reminder-meta {
        gap: 6px;
        font-size: 0.75rem;
    }

    .reminder-countdown {
        font-size: 0.78rem;
    }

    .reminder-actions {
        width: 100%;
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px solid var(--border-light);
        margin-top: 2px;
        gap: 2px;
    }

    .btn-icon {
        width: 32px;
        height: 32px;
    }

    .btn-icon svg {
        width: 16px;
        height: 16px;
    }

    /* ── Dashboard Two Column ─────────────────────────── */
    .dash-two-col {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }

    /* ── Category Badge ───────────────────────────────── */
    .category-badge {
        font-size: 0.72rem;
        padding: 2px 8px;
    }

    /* ── Alert Chips ──────────────────────────────────── */
    .alert-chip {
        font-size: 0.68rem !important;
        padding: 1px 6px !important;
    }

    /* ── Progress Bar ─────────────────────────────────── */
    .progress-bar {
        height: 3px;
    }

    /* ── Cards general ────────────────────────────────── */
    .card {
        padding: 14px;
    }

    /* ── Participant chips ────────────────────────────── */
    .participant-chip {
        font-size: 0.68rem;
        padding: 2px 8px;
    }

    /* ── Modal footer buttons ─────────────────────────── */
    .modal-footer {
        flex-wrap: wrap;
        gap: 6px;
    }

    .modal-footer .btn {
        font-size: 0.82rem;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .stat-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.72rem;
    }

    .login-container {
        padding: 28px 20px;
    }

    .main-content {
        padding: 10px;
        padding-top: calc(var(--topbar-height) + 10px);
    }

    .page-title {
        font-size: 1.15rem;
    }

    .page-subtitle {
        font-size: 0.78rem;
    }

    /* ── Even more compact cards ──────────────────────── */
    .reminder-card {
        padding: 10px;
        gap: 8px;
    }

    .reminder-status {
        width: 10px;
        height: 10px;
    }

    .reminder-title {
        font-size: 0.85rem;
    }

    .reminder-countdown {
        font-size: 0.75rem;
    }

    .reminder-actions {
        gap: 0;
    }

    .btn-icon {
        width: 30px;
        height: 30px;
    }

    /* ── Filter toggle even more compact ──────────────── */
    .filter-toggle-btn {
        padding: 7px 10px;
        font-size: 0.8rem;
    }

    /* ── Tab bar compact ──────────────────────────────── */
    .tab-btn {
        padding: 5px 10px;
        font-size: 0.72rem;
    }
}

@media (max-width: 360px) {
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .page-title {
        font-size: 1.05rem;
    }
}

/* ============================================================
   CONFIRM DIALOG
   ============================================================ */
.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.confirm-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 400px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp 0.3s ease;
    text-align: center;
}

.confirm-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.confirm-icon.confirm-warning {
    background: var(--status-warning-bg);
    color: var(--status-warning);
}

.confirm-icon.confirm-danger {
    background: var(--status-danger-bg);
    color: var(--status-danger);
}

.confirm-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.confirm-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.5;
}

.confirm-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.confirm-actions .btn {
    min-width: 100px;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--status-danger); }
.text-warning { color: var(--status-warning); }
.text-ok { color: var(--status-ok); }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.grid { display: grid; }
.w-full { width: 100%; }

/* ── Collapsible section ──────────────────────────────── */
.collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    cursor: pointer;
    user-select: none;
    border: none;
    background: none;
    width: 100%;
    font-family: var(--font-body);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.collapsible-header svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.collapsible-header.open svg {
    transform: rotate(180deg);
}

.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
}

.collapsible-content.open {
    max-height: 500px;
}

/* ============================================================
   PWA INSTALL BANNER
   ============================================================ */
.pwa-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    padding: 16px;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-banner-show {
    transform: translateY(0);
}

.pwa-banner-hide {
    transform: translateY(100%);
}

.pwa-banner-content {
    max-width: 480px;
    margin: 0 auto;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-xl);
}

[data-theme="dark"] .pwa-banner-content {
    background: rgba(15, 18, 25, 0.92);
    border-color: rgba(255, 255, 255, 0.08);
}

.pwa-banner-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.pwa-banner-icon {
    flex-shrink: 0;
}

.pwa-banner-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.pwa-banner-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 2px 0 0;
}

.pwa-banner-x {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.pwa-banner-x:hover {
    color: var(--text-primary);
}

.pwa-banner-x svg {
    width: 20px;
    height: 20px;
}

.pwa-banner-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin: 0 0 16px;
    line-height: 1.5;
}

.pwa-banner-steps {
    margin-bottom: 16px;
}

.pwa-banner-steps p {
    font-size: 0.88rem;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.pwa-banner-steps ol {
    margin: 0;
    padding-left: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.pwa-banner-steps ol strong {
    color: var(--accent-primary);
}

.pwa-banner-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.pwa-share-icon {
    display: inline-flex;
    align-items: center;
    color: var(--accent-primary);
}

/* ============================================================
   TAB BAR
   ============================================================ */
.tab-bar {
    display: flex;
    gap: 4px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 3px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.tab-btn.active {
    background: var(--accent-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79, 140, 255, 0.3);
}

/* ============================================================
   PARTICIPANT CHIPS
   ============================================================ */
.participant-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    background: var(--accent-primary-bg);
    color: var(--accent-primary);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.participant-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-card-hover);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    transition: background var(--transition-fast);
}

.participant-row:hover {
    background: var(--bg-input);
}

/* ============================================================
   RESPONSIVE OVERRIDES FOR NEW COMPONENTS
   ============================================================ */
@media (max-width: 768px) {
    .tab-bar {
        width: 100%;
    }

    .tab-btn {
        padding: 6px 12px;
        font-size: 0.78rem;
    }

    .pwa-banner {
        padding: 12px;
    }

    .pwa-banner-content {
        padding: 16px;
    }
}

/* ============================================================
   MULTI-TENANT & ENVIRONMENT STYLES
   ============================================================ */
.env-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    user-select: none;
    line-height: 1;
}

.env-badge-test {
    background: #f97316;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.4);
    animation: envBadgePulse 3s ease-in-out infinite;
}

@keyframes envBadgePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(0.97); }
}

.org-selector-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    max-width: 170px;
}

.org-selector-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.org-selector-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.org-selector-arrow {
    font-size: 0.65rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.org-list-modal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.org-list-modal-item:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
}

.org-list-modal-item.active {
    border-color: var(--accent-primary);
    background: var(--accent-primary-bg);
}

