/* Popstore Design System - app.css */

/* 1. TOKENS DE DESIGN (Variáveis CSS para Temas Light & Dark) */
:root {
    --bg-main: #080b10;
    --bg-card: rgba(15, 20, 30, 0.4);
    --border-color: rgba(255, 255, 255, 0.05);
    --primary: #38bdf8;
    --primary-hover: #0ea5e9;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --text-main: #f8fafc;
    --text-muted: #8e9cae;
    --bg-header: rgba(8, 11, 16, 0.8);
    --footer-bg: #05070a;
    --input-bg: rgba(0, 0, 0, 0.2);
    --card-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.3);
    --bg-gradient: radial-gradient(ellipse at top, rgba(56, 189, 248, 0.04), transparent 60%);
    
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    
    --btn-login-color: #f8fafc;
    --btn-login-hover: #38bdf8;

    /* Safe Areas & Touch Target Variables */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --touch-target: 44px;
}

.light-mode {
    --bg-main: #fafafd;
    --bg-card: rgba(255, 255, 255, 0.7);
    --border-color: rgba(0, 0, 0, 0.05);
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --accent: #4f46e5;
    --accent-hover: #3730a3;
    --text-main: #0f172a;
    --text-muted: #5e6c84;
    --bg-header: rgba(250, 250, 253, 0.85);
    --footer-bg: #f5f7fa;
    --input-bg: rgba(255, 255, 255, 0.8);
    --card-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.05);
    --bg-gradient: radial-gradient(ellipse at top, rgba(2, 132, 199, 0.03), transparent 60%);
    
    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.06);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.06);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.06);
    
    --btn-login-color: #0f172a;
    --btn-login-hover: #0284c7;
}

/* 2. RESETS E CONFIGURAÇÕES GLOBAIS */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image: var(--bg-gradient);
}

/* Transição global suave para cores na troca de tema */
body, header, footer, .card, .feature-card, .testimonial-card, .pricing-card, 
input, select, textarea, button, a, span, label {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* 3. ELEMENTOS ESTRUTURAIS SEMÂNTICOS */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    animation: fadeIn 0.6s ease-out;
}

footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    padding: 2.5rem 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

footer p {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.heart {
    color: #f43f5e;
    display: inline-block;
    animation: beat 1.2s infinite alternate;
}

/* 4. TIPOGRAFIA */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

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

/* 5. FORMULÁRIOS E INPUTS SEMÂNTICOS */
form {
    display: flex;
    flex-direction: column;
    width: 100%;
}

fieldset {
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: rgba(0, 0, 0, 0.05);
}

legend {
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0 0.5rem;
    color: var(--text-main);
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

/* Campos de entrada padrão */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea,
.input-default {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
    min-height: var(--touch-target);
}

/* Remove standard Webkit and Firefox spinners from input[type="number"] */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

::placeholder {
    color: var(--text-muted);
    opacity: 0.45;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus,
.input-default:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.light-mode input:focus,
.light-mode select:focus,
.light-mode textarea:focus {
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

/* Estilização Customizada para Checkbox e Radio */
input[type="checkbox"],
input[type="radio"] {
    appearance: none;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    vertical-align: middle;
    position: relative;
    outline: none;
    transition: all 0.2s ease;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

input[type="checkbox"]:checked::before {
    content: "✓";
    color: #0b0f17;
    font-size: 0.8rem;
    font-weight: 800;
}

.light-mode input[type="checkbox"]:checked::before {
    color: #ffffff;
}

input[type="radio"]:checked::before {
    content: "";
    width: 0.5rem;
    height: 0.5rem;
    background-color: #0b0f17;
    border-radius: 50%;
}

.light-mode input[type="radio"]:checked::before {
    background-color: #ffffff;
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

/* 6. BOTÕES SEMÂNTICOS */
button, .btn {
    background-color: var(--primary);
    color: #0b0f17;
    font-weight: 700;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
    transition: all 0.3s ease;
    min-height: var(--touch-target);
}

.light-mode button, 
.light-mode .btn {
    color: var(--text-main);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.05);
}

.light-mode .btn-primary,
.light-mode .btn-register,
.light-mode .btn-register-mobile {
    color: #ffffff !important;
}

.light-mode .btn-theme,
.light-mode .btn-menu,
.light-mode .btn-close,
.light-mode .btn-secondary,
.light-mode .btn-cta-secondary {
    color: var(--text-main);
}

button:hover, .btn:hover {
    background-color: var(--primary-hover);
    box-shadow: var(--card-shadow);
    transform: translateY(-1px);
}

button:disabled, .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Variações de Botão */
.btn-secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.btn-secondary:hover {
    background-color: var(--border-color);
    color: var(--text-main);
    transform: translateY(-1px);
    box-shadow: none;
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background-color: #dc2626;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.3);
}

/* 7. DIALOGS */
dialog {
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    background: var(--bg-card);
    color: var(--text-main);
    padding: 2.5rem;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--card-shadow);
    outline: none;
    margin: auto;
    backdrop-filter: blur(16px);
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* 8. COMPONENTES REUTILIZÁVEIS */

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 2rem;
    padding-left: 2rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

/* Painel de Tabela / Lista */
.card-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
    margin-bottom: 2rem;
}

/* Switch (Botão estilo iOS) */
.switch {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    cursor: pointer;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.switch input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.switch-slider {
    position: relative;
    display: inline-block;
    width: 2.5rem;
    height: 1.35rem;
    background-color: rgba(255, 255, 255, 0.15); /* Inativo no tema escuro */
    border-radius: 9999px;
    transition: all 0.3s ease;
}

.light-mode .switch-slider {
    background-color: #cbd5e1; /* Inativo no tema claro */
}

.switch-slider::before {
    content: "";
    position: absolute;
    height: 1rem;
    width: 1rem;
    left: 0.15rem;
    bottom: 0.17rem;
    background-color: #ffffff;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.light-mode .switch-slider::before {
    background-color: #ffffff;
}

.switch input:checked + .switch-slider {
    background-color: var(--primary);
}

.switch input:checked + .switch-slider::before {
    transform: translateX(1.15rem);
}

/* Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-select {
    cursor: pointer;
    appearance: none;
    padding-right: 2.5rem !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.light-mode .dropdown-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
}

/* Badges de Status */
.badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-active {
    background-color: var(--success-bg);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-inactive {
    background-color: var(--border-color);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.badge-danger {
    background-color: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Ícones */
.icon {
    font-size: 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

/* 9. ANIMAÇÕES */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes beat {
    to { transform: scale(1.15); }
}

/* 10. GRID E FLEX UTILITIES */
.flex-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
    width: 100%;
}

/* 11. HEADER & NAV STYLINGS */
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.85rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.025em;
    transition: transform 0.2s ease, color 0.3s ease;
}

.logo:hover {
    transform: scale(1.02);
}

.logo span {
    background: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.925rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

.btn-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

.btn-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--success);
    animation: pulse-dot 1.2s infinite alternate;
}

@keyframes pulse-dot {
    0% {
        transform: scale(0.9);
        opacity: 0.6;
        box-shadow: 0 0 4px var(--success);
    }
    100% {
        transform: scale(1.2);
        opacity: 1;
        box-shadow: 0 0 12px var(--success);
    }
}

.btn-status:hover {
    color: var(--text-main);
}

.btn-login {
    color: var(--btn-login-color);
    text-decoration: none;
    font-size: 0.925rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.btn-login:hover {
    color: var(--btn-login-hover);
}

.btn-register {
    background: var(--primary);
    color: #0b0f17;
    border: none;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
    transition: all 0.3s ease;
}

.btn-register:hover {
    background: var(--primary-hover);
    box-shadow: var(--card-shadow);
    transform: translateY(-1px);
}

.light-mode .btn-register {
    color: #fff;
}

.btn-theme {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    width: 2.25rem;
    height: 2.25rem;
}

.btn-theme:hover {
    background: var(--border-color);
    transform: scale(1.05);
}

html.light-mode .theme-icon-light {
    display: none;
}

html:not(.light-mode) .theme-icon-dark {
    display: none;
}

@media (max-width: 768px) {
    .header-container {
        padding: 0.75rem 1rem;
    }
}

/* 12. HERO SECTION STYLES */
.hero {
    text-align: center;
    padding: 5rem 0 4rem 0;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent);
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.light-mode .hero-badge {
    background: rgba(99, 102, 241, 0.08);
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2.5rem;
}

.hero-ctas {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-cta-primary {
    background: var(--primary);
    color: #0b0f17;
    font-weight: 700;
    padding: 0.85rem 2rem;
    border-radius: 9999px;
    text-decoration: none;
    box-shadow: 0 10px 25px -5px rgba(56, 189, 248, 0.3);
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-cta-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--card-shadow);
    transform: translateY(-2px);
}

.light-mode .btn-cta-primary {
    color: #fff;
}

.btn-cta-secondary {
    background: transparent;
    color: var(--text-main);
    font-weight: 600;
    padding: 0.85rem 2rem;
    border-radius: 9999px;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn-cta-secondary:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

/* 13. SECTION HEADERS */
.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
    margin-top: 5rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* 14. GRIDS */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 5rem;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 5rem;
    align-items: stretch;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 6rem;
}

/* 15. COMPONENT CARDS */
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2.25rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
}

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

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
    display: inline-block;
}

.feature-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;
}

.feature-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Pricing Cards */
.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    backdrop-filter: blur(8px);
}

.pricing-card.featured {
    border-color: var(--primary);
    box-shadow: var(--card-shadow);
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.pricing-card.featured::before {
    content: 'MAIS POPULAR';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.25rem 1rem;
    border-radius: 9999px;
    letter-spacing: 0.05em;
}

.pricing-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.plan-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.plan-price {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: baseline;
}

.plan-price span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-left: 0.25rem;
}

.plan-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.plan-features {
    list-style: none;
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.plan-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-main);
}

.plan-features li::before {
    content: '✓';
    color: var(--primary);
    font-weight: bold;
}

.btn-plan {
    display: block;
    text-align: center;
    padding: 0.85rem;
    border-radius: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-plan:hover {
    background: var(--text-main);
    color: var(--bg-main);
    border-color: var(--text-main);
}

.pricing-card.featured .btn-plan {
    background: var(--primary);
    color: #0b0f17;
    border: none;
}

.pricing-card.featured .btn-plan:hover {
    background: var(--primary-hover);
    color: #fff;
}

/* Testimonial Cards */
.testimonial-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

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

.testimonial-stars {
    color: #f59e0b;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.testimonial-quote {
    font-size: 1rem;
    font-style: italic;
    line-height: 1.6;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.testimonial-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border: 2px solid var(--border-color);
}

.testimonial-meta {
    display: flex;
    flex-direction: column;
}

.testimonial-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
}

.testimonial-company {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* 16. AUTHENTICATION PAGES */
.auth-container {
    max-width: 480px;
    margin: 4rem auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(12px);
    animation: fadeInUp 0.5s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn-auth {
    width: 100%;
    background: var(--primary);
    color: #0b0f17;
    border: none;
    border-radius: 0.75rem;
    padding: 0.75rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-auth:hover {
    background: var(--primary-hover);
    box-shadow: var(--card-shadow);
}

.light-mode .btn-auth {
    color: #fff;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

#reg-result {
    margin-top: 1.5rem;
    font-family: monospace;
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 0.75rem;
    display: none;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

/* 17. ANIMATIONS UTILITIES */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.75rem;
    }
    .hero-ctas {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* 18. RESPONSIVE HEADER & MOBILE DRAWER */

/* Top header visible on desktop and mobile */
.app-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--bg-header);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding-top: var(--safe-top); /* Safe Area for Capacitor */
}

/* Hide hamburger toggle by default on desktop */
.app-header .btn-menu {
    display: none;
}

/* Mobile Actions container */
.app-header .mobile-actions {
    display: none;
}

/* Sidebar (Mobile drawer) - Hidden on desktop */
.sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: -290px;
    width: 280px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem 1.5rem;
    padding-top: calc(2rem + var(--safe-top));
    padding-bottom: calc(2rem + var(--safe-bottom));
    height: 100vh;
    height: 100dvh;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
}

.light-mode .sidebar {
    background: #ffffff;
}

.sidebar.active {
    transform: translateX(290px);
}

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

/* Show close button in mobile drawer */
.sidebar-header .btn-close {
    display: flex;
}

/* Navigation inside Mobile drawer */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0.55rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 0.75rem;
    min-height: var(--touch-target);
    transition: all 0.2s ease;
}

.sidebar-nav a:hover {
    color: var(--primary);
    background: rgba(56, 189, 248, 0.08);
}

.light-mode .sidebar-nav a:hover {
    background: rgba(2, 132, 199, 0.08);
}

/* Mobile buttons styling inside drawer */
.btn-login-mobile, .btn-register-mobile {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 1.25rem;
    min-height: var(--touch-target);
    font-weight: 700;
    border-radius: 9999px;
    padding: 0.75rem 1.5rem;
    margin-top: 0.5rem;
}

.btn-login-mobile {
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-login-mobile:hover {
    background: var(--border-color);
}

.btn-register-mobile {
    background: var(--primary);
    color: #0b0f17;
}

.light-mode .btn-register-mobile {
    color: #fff;
}

.btn-register-mobile:hover {
    background: var(--primary-hover);
}

.nav-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

/* Sidebar overlay backdrop */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 95;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Close & Toggle Buttons */
.btn-close, .btn-menu {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--touch-target);
    height: var(--touch-target);
    border-radius: 0.5rem;
    transition: background 0.2s ease;
}

.btn-close:hover, .btn-menu:hover {
    background: var(--border-color);
}

/* Mobile-specific media query (< 992px) */
@media (max-width: 992px) {
    .app-header .btn-menu {
        display: flex;
    }

    .app-header .desktop-nav {
        display: none;
    }

    .app-header .mobile-actions {
        display: flex;
        gap: 0.5rem;
    }
}

/* Status Dialog / Grid */
.status-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 1.5rem 0;
}

.status-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
}

.light-mode .status-card {
    background: rgba(255, 255, 255, 0.5);
}

.status-card .status-val {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.status-card .status-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

/* --- DESIGN SYSTEM COMPONENTS EXTENSIONS --- */

/* Accordion (details/summary) */
details.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    background: var(--bg-card);
    margin-bottom: 0.5rem;
    overflow: hidden;
}
details.accordion-item summary {
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    outline: none;
}
details.accordion-item summary::-webkit-details-marker {
    display: none;
}
details.accordion-item summary::after {
    content: '▼';
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}
details.accordion-item[open] summary::after {
    transform: rotate(180deg);
}
details.accordion-item .accordion-content {
    padding: 0 1.5rem 1.5rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    border-top: 1px solid var(--border-color);
    margin-top: 0;
    line-height: 1.6;
}

/* Action Sheet */
.action-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 150;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.action-sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.action-sheet {
    width: 100%;
    max-width: 500px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-top-left-radius: 1.5rem;
    border-top-right-radius: 1.5rem;
    padding: 1.5rem;
    padding-bottom: calc(1.5rem + var(--safe-bottom));
    border: 1px solid var(--border-color);
    border-bottom: none;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -10px 25px rgba(0,0,0,0.15);
}
.action-sheet-overlay.active .action-sheet {
    transform: translateY(0);
}
.action-sheet-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 1rem;
    letter-spacing: 0.05em;
}
.action-sheet-group {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 1rem;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}
.light-mode .action-sheet-group {
    background: rgba(255, 255, 255, 0.6);
}
.action-sheet-btn {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    color: var(--text-main);
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    cursor: pointer;
    display: block;
    box-shadow: none;
    border-radius: 0;
    min-height: var(--touch-target);
    transition: background 0.2s ease;
}
.action-sheet-btn:last-child {
    border-bottom: none;
}
.action-sheet-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}
.light-mode .action-sheet-btn:hover {
    background: rgba(0, 0, 0, 0.03);
}
.action-sheet-btn.destructive {
    color: var(--danger);
}
.action-sheet-cancel {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    font-weight: 700;
    color: var(--text-main);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
}

/* Avatar */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.875rem;
    width: 2.5rem;
    height: 2.5rem;
}
.avatar-sm { width: 2rem; height: 2rem; font-size: 0.75rem; }
.avatar-md { width: 3rem; height: 3rem; font-size: 1rem; }
.avatar-lg { width: 4.5rem; height: 4.5rem; font-size: 1.5rem; }
.avatar-square { border-radius: 0.75rem; }
.avatar-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    border: 2px solid var(--bg-main);
    background-color: var(--success);
}
.avatar-badge.offline {
    background-color: var(--text-muted);
}

/* Extra Badges */
.badge-warning {
    background-color: var(--warning-bg);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}
.badge-primary {
    background-color: rgba(56, 189, 248, 0.1);
    color: var(--primary);
    border: 1px solid rgba(56, 189, 248, 0.2);
}
.light-mode .badge-primary {
    background-color: rgba(2, 132, 199, 0.06);
}
.badge-pill {
    border-radius: 9999px;
}

/* Banner */
.banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 0.75rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    gap: 1rem;
}
.banner-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
}
.banner-actions {
    display: flex;
    gap: 0.5rem;
}
.banner-danger {
    background: var(--danger-bg);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--text-main);
}
.banner-success {
    background: var(--success-bg);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--text-main);
}

/* Bottom Sheet */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 140;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.bottom-sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.bottom-sheet {
    width: 100%;
    max-width: 600px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-top-left-radius: 1.75rem;
    border-top-right-radius: 1.75rem;
    padding: 2rem;
    padding-bottom: calc(2rem + var(--safe-bottom));
    border: 1px solid var(--border-color);
    border-bottom: none;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.2);
}
.bottom-sheet-overlay.active .bottom-sheet {
    transform: translateY(0);
}
.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin: -1rem auto 1.5rem auto;
}

/* Carousel */
.carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 1rem;
}
.carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar {
    display: none;
}
.carousel-item {
    flex: 0 0 100%;
    scroll-snap-align: start;
    position: relative;
}

/* Chip */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--border-color);
    color: var(--text-main);
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 32px;
}
.chip:hover {
    background: rgba(255, 255, 255, 0.08);
}
.light-mode .chip:hover {
    background: rgba(0, 0, 0, 0.05);
}
.chip.active {
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary);
    border-color: rgba(56, 189, 248, 0.3);
}
.light-mode .chip.active {
    background: rgba(2, 132, 199, 0.08);
    color: var(--primary);
    border-color: rgba(2, 132, 199, 0.2);
}
.chip-close {
    background: transparent;
    border: none;
    font-size: 0.9rem;
    padding: 0;
    margin-left: 0.15rem;
    cursor: pointer;
    color: var(--text-muted);
    min-height: auto;
    box-shadow: none;
    width: auto;
    height: auto;
    display: inline-flex;
}
.chip-close:hover {
    color: var(--danger);
    background: transparent;
    transform: none;
    box-shadow: none;
}

/* Color Picker */
.color-picker-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
    min-height: var(--touch-target);
}
.color-picker-input {
    appearance: none;
    -webkit-appearance: none;
    border: none;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    cursor: pointer;
    background: none;
    padding: 0;
}
.color-picker-input::-webkit-color-swatch-wrapper {
    padding: 0;
}
.color-picker-input::-webkit-color-swatch {
    border: 1px solid var(--border-color);
    border-radius: 50%;
}

/* Combobox (Searchable Dropdown) */
.combobox {
    position: relative;
    width: 100%;
}
.combobox-input {
    padding-right: 2.5rem !important;
}
.combobox-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(16px);
    margin-top: 0.5rem;
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}
.combobox.active .combobox-dropdown {
    display: block;
}
.combobox-item {
    padding: 0.75rem 1rem;
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.95rem;
    transition: background 0.2s ease;
}
.combobox-item:hover {
    background: var(--border-color);
}
.combobox-item.selected {
    background: rgba(56, 189, 248, 0.15);
    color: var(--primary);
}
.light-mode .combobox-item.selected {
    background: rgba(2, 132, 199, 0.08);
}

/* Command Palette */
.cmd-palette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.cmd-palette-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.cmd-palette {
    width: 90%;
    max-width: 600px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    backdrop-filter: blur(20px);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s ease;
}
.cmd-palette-overlay.active .cmd-palette {
    transform: scale(1);
}
.cmd-palette-search {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}
.cmd-palette-input {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 1.1rem !important;
    padding: 0 !important;
    min-height: auto !important;
}
.cmd-palette-results {
    max-height: 350px;
    overflow-y: auto;
    padding: 0.5rem;
}
.cmd-palette-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}
.cmd-palette-item:hover, .cmd-palette-item.active {
    background: var(--border-color);
    color: var(--primary);
}
.cmd-palette-shortcut {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    border: 1px solid var(--border-color);
}

/* Context Menu */
.context-menu {
    position: fixed;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(16px);
    padding: 0.5rem;
    z-index: 300;
    min-width: 160px;
    display: none;
}
.context-menu-item {
    padding: 0.5rem 1rem;
    color: var(--text-main);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.context-menu-item:hover {
    background: var(--border-color);
    color: var(--primary);
}

/* Date & Time Picker */
input[type="date"],
input[type="time"] {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    min-height: var(--touch-target);
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}
input[type="date"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238e9cae'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'/%3E%3C/svg%3E");
}
.light-mode input[type="date"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%235e6c84'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z'/%3E%3C/svg%3E");
}
input[type="time"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%238e9cae'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
}
.light-mode input[type="time"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%235e6c84'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z'/%3E%3C/svg%3E");
}

/* Divider */
.divider {
    height: 1px;
    background-color: var(--border-color);
    width: 100%;
    margin: 1.5rem 0;
    border: none;
}
.divider-vertical {
    width: 1px;
    height: 100%;
    background-color: var(--border-color);
    margin: 0 1.5rem;
    border: none;
    display: inline-block;
    vertical-align: middle;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    border: 1px dashed var(--border-color);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.01);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 500px;
    margin: 2rem auto;
}
.empty-state-icon {
    font-size: 3.5rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    opacity: 0.7;
}
.empty-state-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}
.empty-state-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Error Message */
.error-message {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    color: var(--danger);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
}
.error-message::before {
    content: '⚠️';
    font-size: 1.1rem;
}

/* File Uploader */
.file-uploader {
    border: 2px dashed var(--border-color);
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.light-mode .file-uploader {
    background: rgba(255, 255, 255, 0.5);
}
.file-uploader:hover, .file-uploader.dragover {
    border-color: var(--primary);
    background: rgba(56, 189, 248, 0.05);
}
.light-mode .file-uploader:hover, .light-mode .file-uploader.dragover {
    background: rgba(2, 132, 199, 0.02);
}
.file-uploader-icon {
    font-size: 2.5rem;
    color: var(--primary);
    opacity: 0.8;
}
.file-uploader-text {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 600;
}
.file-uploader-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Floating Action Button (FAB) */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    bottom: calc(2rem + var(--safe-bottom));
    right: calc(2rem + var(--safe-right));
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background-color: var(--primary);
    color: #0b0f17;
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.3);
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: auto;
}
.light-mode .fab {
    color: #ffffff;
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.3);
}
.fab:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 12px 32px rgba(56, 189, 248, 0.4);
}
.light-mode .fab:hover {
    box-shadow: 0 12px 32px rgba(2, 132, 199, 0.4);
}

/* Fullscreen Overlay */
.fs-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-main);
    z-index: 500;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    padding-top: calc(2rem + var(--safe-top));
    padding-bottom: calc(2rem + var(--safe-bottom));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.fs-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 2rem;
}
.gallery-item {
    border-radius: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    transition: all 0.3s ease;
    aspect-ratio: 1;
    position: relative;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.gallery-item:hover img {
    transform: scale(1.06);
}

/* Launch Screen */
.launch-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-main);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeOutLaunch 0.5s ease-out 2s forwards;
}
.launch-logo {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    animation: scaleLaunch 1.5s ease-out infinite alternate;
}
@keyframes fadeOutLaunch {
    to { opacity: 0; pointer-events: none; }
}
@keyframes scaleLaunch {
    from { transform: scale(0.9); }
    to { transform: scale(1.1); }
}

/* Loading Indicators */
.loading-spinner {
    width: 2.25rem;
    height: 2.25rem;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
.loading-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.loading-dots span {
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--primary);
    border-radius: 50%;
    animation: dot-bounce 1.4s infinite ease-in-out both;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes dot-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Map Pin */
.map-pin {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--primary);
    color: #0b0f17;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: -2px 2px 4px rgba(0,0,0,0.25);
}
.light-mode .map-pin {
    color: #ffffff;
}
.map-pin::after {
    content: '';
    width: 0.75rem;
    height: 0.75rem;
    background: var(--bg-main);
    border-radius: 50%;
    position: absolute;
}

/* Navigation Flyout */
.nav-flyout {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(20px);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(2, 200px);
    gap: 1.25rem;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}
.nav-flyout-trigger:hover + .nav-flyout,
.nav-flyout:hover {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.nav-flyout-col-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

/* Page Control */
.page-control {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
}
.page-control-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--border-color);
    cursor: pointer;
    transition: all 0.3s ease;
}
.page-control-dot.active {
    background-color: var(--primary);
    transform: scale(1.25);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 2rem 0;
}
.pagination-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}
.pagination-item:hover {
    background: var(--border-color);
    color: var(--primary);
}
.pagination-item.active {
    background: var(--primary);
    color: #0b0f17;
    border-color: var(--primary);
}
.light-mode .pagination-item.active {
    color: #ffffff;
}
.pagination-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Popover */
.popover {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(16px);
    padding: 1.25rem;
    z-index: 120;
    width: 280px;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
    transition: all 0.2s ease;
}
.popover.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

/* Progress Indicator */
.progress-bar-wrapper {
    width: 100%;
    background-color: var(--border-color);
    border-radius: 9999px;
    height: 6px;
    overflow: hidden;
    margin: 1rem 0;
}
.progress-bar-fill {
    height: 100%;
    background-color: var(--primary);
    width: 0%;
    transition: width 0.4s ease;
}

/* Search Bar */
.search-bar-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
}
.search-bar-input {
    padding-left: 2.75rem !important;
}
.search-bar-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 1.1rem;
}

/* Segmented Control */
.segmented-control {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.25rem;
    width: 100%;
    max-width: 400px;
}
.light-mode .segmented-control {
    background: rgba(0, 0, 0, 0.05);
}
.segmented-control-item {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    user-select: none;
}
.segmented-control-item.active {
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, var(--border-color) 25%, rgba(255, 255, 255, 0.05) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: loading-skeleton 1.5s infinite;
    border-radius: 0.5rem;
}
.light-mode .skeleton {
    background: linear-gradient(90deg, rgba(0,0,0,0.06) 25%, rgba(0,0,0,0.03) 50%, rgba(0,0,0,0.06) 75%);
    background-size: 200% 100%;
}
.skeleton-text { height: 1rem; width: 100%; margin-bottom: 0.5rem; }
.skeleton-avatar { height: 3rem; width: 3rem; border-radius: 50%; }
.skeleton-rect { height: 10rem; width: 100%; }
@keyframes loading-skeleton {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Slider */
input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 9999px;
    outline: none;
    margin: 1rem 0;
}
input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 2px solid var(--bg-main);
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transition: transform 0.1s ease;
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* Stacked List */
.stacked-list {
    display: flex;
    flex-direction: column;
    width: 100%;
}
.stacked-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}
.stacked-list-item:last-child {
    border-bottom: none;
}
.stacked-list-item:hover {
    background: rgba(255, 255, 255, 0.02);
}
.light-mode .stacked-list-item:hover {
    background: rgba(0, 0, 0, 0.01);
}
.stacked-list-content {
    flex: 1;
}
.stacked-list-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
    margin-bottom: 0.15rem;
}
.stacked-list-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Status Dot */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-dot-active {
    background-color: var(--success);
    box-shadow: 0 0 8px var(--success);
}
.status-dot-inactive {
    background-color: var(--text-muted);
}
.status-dot-danger {
    background-color: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}
.status-dot-warning {
    background-color: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}
.status-dot-pulse {
    animation: pulse-dot 1.2s infinite alternate;
}

/* Stepper */
.stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    background: var(--input-bg);
    overflow: hidden;
    min-height: var(--touch-target);
}
.stepper-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 2.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: none;
    border-radius: 0;
    min-height: auto;
}
.stepper-btn:hover {
    background: var(--border-color);
}
.stepper-val {
    padding: 0 1rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
    min-width: 3rem;
    text-align: center;
}

/* Tab Bar */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    padding-top: 0.5rem;
    padding-bottom: calc(0.5rem + var(--safe-bottom));
    z-index: 90;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
}
.tab-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}
.tab-bar-item.active {
    color: var(--primary);
}
.tab-bar-icon {
    font-size: 1.25rem;
}

/* Table */
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    color: var(--text-main);
    font-size: 0.95rem;
}
th {
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    padding: 1rem 1.5rem;
    border-bottom: 2px solid var(--border-color);
}
td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
tr:last-child td {
    border-bottom: none;
}
tr:hover td {
    background-color: rgba(255, 255, 255, 0.01);
}
.light-mode tr:hover td {
    background-color: rgba(0, 0, 0, 0.005);
}

/* Table of Contents */
.toc {
    padding: 1rem;
    border-left: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.toc-item {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}
.toc-item:hover, .toc-item.active {
    color: var(--primary);
    padding-left: 0.25rem;
}

/* Tile */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}
.tile {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    background: var(--bg-card);
    transition: all 0.2s ease;
    user-select: none;
}
.tile:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}
.tile.selected {
    background: rgba(56, 189, 248, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}
.light-mode .tile.selected {
    background: rgba(2, 132, 199, 0.08);
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}
.toast {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    padding: 0.85rem 1.5rem;
    border-radius: 0.75rem;
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: auto;
    animation: slideUpToast 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
@keyframes slideUpToast {
    from { transform: translateY(100%) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 0.5rem 1rem;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tooltip */
[data-tooltip] {
    position: relative;
}
[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-6px) scale(0.95);
    background: #0b0f17;
    color: #ffffff;
    padding: 0.35rem 0.65rem;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.15s ease;
    z-index: 100;
    border: 1px solid rgba(255,255,255,0.05);
}
.light-mode [data-tooltip]::after {
    background: #0f172a;
}
[data-tooltip]:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-6px) scale(1);
}

/* Tree */
.tree {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.tree-node {
    display: flex;
    flex-direction: column;
    padding-left: 1.25rem;
    position: relative;
}
.tree-node::before {
    content: '';
    position: absolute;
    left: 0.35rem;
    top: 0;
    bottom: 0;
    width: 1px;
    background-color: var(--border-color);
}
.tree-node:last-child::before {
    height: 0.75rem;
}
.tree-node-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.5rem;
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 0.35rem;
    transition: background 0.2s ease;
    user-select: none;
}
.tree-node-label:hover {
    background: rgba(255,255,255,0.02);
}
.light-mode .tree-node-label:hover {
    background: rgba(0,0,0,0.01);
}

