/* Unified light/dark theme baseline across all templates */
:root {
    color-scheme: light;
    --theme-bg: #f5f5f7;
    --theme-surface: rgba(255, 255, 255, 0.82);
    --theme-surface-solid: #ffffff;
    --theme-border: rgba(15, 23, 42, 0.12);
    --theme-border-strong: rgba(15, 23, 42, 0.2);
    --theme-text: #111827;
    --theme-text-secondary: #4b5563;
    --theme-text-muted: #6b7280;
    --theme-primary: #0a84ff;
    --theme-primary-hover: #0077ed;
    --theme-shadow: 0 16px 42px rgba(15, 23, 42, 0.1);
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --theme-bg: #0b1020;
    --theme-surface: rgba(17, 24, 39, 0.8);
    --theme-surface-solid: #111827;
    --theme-border: rgba(148, 163, 184, 0.28);
    --theme-border-strong: rgba(148, 163, 184, 0.4);
    --theme-text: #f3f4f6;
    --theme-text-secondary: #d1d5db;
    --theme-text-muted: #9ca3af;
    --theme-primary: #4ea3ff;
    --theme-primary-hover: #74b7ff;
    --theme-shadow: 0 18px 44px rgba(2, 6, 23, 0.42);
}

html,
body {
    background: var(--theme-bg) !important;
    color: var(--theme-text) !important;
    transition: background-color 0.25s ease, color 0.25s ease;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

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

.navbar,
.sidebar,
.content-card,
.stats-section,
.orders-panel,
.orders-table-wrap,
.platform-chart,
.stat-card,
.product-card,
.feature-card,
.download-card,
.upload-card,
.glass-card,
.card,
.modal-content,
.confirm-content,
.device-card,
.order-card,
.admin-form {
    background: var(--theme-surface) !important;
    border-color: var(--theme-border) !important;
    box-shadow: var(--theme-shadow) !important;
}

.navbar,
.sidebar {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.page-title,
.section-title,
.product-name,
.feature-title,
.cta-title,
h1,
h2,
h3,
h4 {
    color: var(--theme-text);
}

.page-subtitle,
.section-desc,
.product-desc,
.feature-desc,
p,
label,
.orders-subtitle,
.admin-hint {
    color: var(--theme-text-secondary);
}

.nav-links a,
.nav-item,
.footer-nav-links a {
    color: var(--theme-text-secondary) !important;
}

.nav-links a.active,
.nav-links a:hover,
.nav-item:hover {
    color: var(--theme-text) !important;
}

button,
.btn,
.cta-btn,
.hero-btn-primary,
.hero-btn-secondary {
    transition: all 0.2s ease;
}

.btn-primary,
.btn-refresh,
.btn-approve,
.hero-btn-primary,
.cta-btn {
    background: var(--theme-primary) !important;
    border-color: transparent !important;
    color: #ffffff !important;
}

.btn-primary:hover,
.btn-refresh:hover,
.btn-approve:hover,
.hero-btn-primary:hover,
.cta-btn:hover {
    background: var(--theme-primary-hover) !important;
}

.btn-secondary,
.hero-btn-secondary,
.btn-cancel {
    background: rgba(148, 163, 184, 0.12) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
}

input,
select,
textarea,
.form-control,
.orders-input,
.orders-select {
    background: var(--theme-surface-solid) !important;
    color: var(--theme-text) !important;
    border-color: var(--theme-border) !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--theme-text-muted) !important;
}

input:focus,
select:focus,
textarea:focus,
.form-control:focus,
.orders-input:focus,
.orders-select:focus {
    border-color: var(--theme-primary) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-primary) 26%, transparent) !important;
}

table thead th {
    color: var(--theme-text-muted) !important;
    border-bottom-color: var(--theme-border) !important;
}

table tbody td {
    color: var(--theme-text) !important;
    border-bottom-color: color-mix(in srgb, var(--theme-border) 65%, transparent) !important;
}

table tbody tr:hover {
    background: color-mix(in srgb, var(--theme-primary) 9%, transparent) !important;
}

.footer {
    background: #131722 !important;
}

:root[data-theme="dark"] .footer {
    background: #080b14 !important;
}
