@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    color-scheme: dark;
    /* Neutral & Clean Dark Palette (Default) */
    --bg-main: #0B0F17;
    --bg-surface: #111827;
    --bg-surface-subtle: #161F30;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --text-main: #F9FAFB;
    --text-muted: #9CA3AF;
    --text-dim: #6B7280;

    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --success: #10B981;
    --error: #EF4444;
    --warning: #F59E0B;
}

:root.light-mode,
html.light-mode,
body.light-mode,
html.light-mode body {
    color-scheme: light;
    /* Clean, Modern, High-Contrast Light Palette */
    --bg-main: #F8FAFC;
    --bg-surface: #FFFFFF;
    --bg-surface-subtle: #F1F5F9;
    --border-color: #E2E8F0;
    --border-hover: #CBD5E1;
    --text-main: #0F172A;
    --text-muted: #334155;
    --text-dim: #64748B;
}

/* Base resets & Clean Neutral Typography */
body {
    background-color: var(--bg-main) !important;
    background-image: none !important;
    color: var(--text-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
}

/* Surfaces */
main {
    background-color: var(--bg-main) !important;
}

header {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
}

aside#sidebar {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
}

h1, h2, h3, h4, .font-display {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.02em;
    font-weight: 600;
}

.font-cinzel {
    font-family: 'Cinzel', Georgia, serif !important;
    letter-spacing: 0.04em;
}

/* Neutral Surfaces */
.glass, .bento-card, .minimal-card {
    background: var(--bg-surface) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 0.875rem;
    box-shadow: none !important;
}

.glass-hover {
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.glass-hover:hover {
    border-color: var(--border-hover) !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Botões Neutros & Diretos */
.btn-premium {
    background: var(--primary) !important;
    color: #FFFFFF !important;
    font-weight: 500;
    font-size: 0.8125rem;
    border-radius: 0.625rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    box-shadow: none !important;
    transition: background-color 0.15s ease;
}

.btn-premium:hover {
    background: var(--primary-hover) !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Inputs Limpos */
.input-premium {
    background: var(--bg-surface-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 0.625rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: border-color 0.15s ease;
}

.input-premium:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
    outline: none;
}

select option,
select optgroup,
option {
    background-color: var(--bg-surface) !important;
    color: var(--text-main) !important;
}

/* Cartões dos Potes Neutros */
.pot-card-modern, .virtual-card {
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 0.875rem;
    padding: 1rem 1.25rem;
    position: relative;
    box-shadow: none !important;
    transform: none !important;
    transition: border-color 0.15s ease;
}

.pot-card-modern:hover, .virtual-card:hover {
    border-color: var(--border-hover) !important;
    transform: none !important;
    box-shadow: none !important;
}

.pot-card-modern::before, .virtual-card::before {
    display: none !important;
}

/* Badges Neutras e Limpas */
.badge-subtle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    border: 1px solid transparent;
}

/* Scrollbar Discreta */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Privacy Mode */
.privacy-mode-active .privacy-sensitive {
    filter: blur(6px) !important;
    user-select: none !important;
    cursor: pointer;
}
.privacy-mode-active .privacy-sensitive:hover {
    filter: blur(0px) !important;
}

/* Navegação Mobile Limpa */
.floating-nav {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   REGRAS ESPECÍFICAS PARA MODO CLARO (Light Mode) - ALTO CONTRASTE & LEGIBILIDADE
   ========================================================================== */

/* 1. Estrutura e Layout Geral */
body.light-mode main,
html.light-mode body main,
body.light-mode .bg-\[\#0B0F17\],
body.light-mode .bg-\[\#0b0f17\],
body.light-mode .bg-\[\#111827\],
body.light-mode .bg-\[\#161F30\] {
    background-color: var(--bg-main) !important;
}

body.light-mode header,
html.light-mode body header {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
}

body.light-mode aside#sidebar,
html.light-mode body aside#sidebar {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
}

/* 2. Topbar e Menus no Modo Claro */
body.light-mode header span.text-white,
body.light-mode header strong.text-white,
body.light-mode header .text-white:not([class*="bg-"]) {
    color: var(--text-main) !important;
}

body.light-mode header .text-slate-100,
body.light-mode header .text-slate-200,
body.light-mode header .text-slate-300 {
    color: var(--text-main) !important;
}

body.light-mode header .text-slate-400 {
    color: var(--text-muted) !important;
}

body.light-mode header button:not([class*="bg-indigo-"]):not([class*="bg-emerald-"]) {
    border-color: var(--border-color) !important;
    color: var(--text-muted) !important;
    background-color: var(--bg-surface-subtle) !important;
}

body.light-mode header button:not([class*="bg-indigo-"]):not([class*="bg-emerald-"]):hover {
    color: var(--text-main) !important;
    border-color: var(--border-hover) !important;
    background-color: #E2E8F0 !important;
}

body.light-mode header .h-3\.5\.w-px,
body.light-mode header .h-3\.w-px,
body.light-mode header .h-px,
body.light-mode header .w-px {
    background-color: var(--border-color) !important;
}

/* Menu Dropdown do Utilizador */
body.light-mode header .group .bg-\[\#111827\],
body.light-mode header .group .bg-slate-900 {
    background-color: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode header .group .bg-\[\#111827\] a,
body.light-mode header .group .bg-slate-900 a {
    color: var(--text-muted) !important;
}

body.light-mode header .group .bg-\[\#111827\] a:hover,
body.light-mode header .group .bg-slate-900 a:hover {
    background-color: var(--bg-surface-subtle) !important;
    color: var(--text-main) !important;
}

body.light-mode header .group .bg-\[\#111827\] a.text-rose-400,
body.light-mode header .group .bg-slate-900 a.text-rose-400 {
    color: #BE123C !important;
}

body.light-mode header .group .bg-\[\#111827\] a.text-rose-400:hover,
body.light-mode header .group .bg-slate-900 a.text-rose-400:hover {
    background-color: #FFF1F2 !important;
    color: #9F1239 !important;
}

/* 3. Sidebar no Modo Claro */
body.light-mode aside#sidebar span.text-white,
body.light-mode aside#sidebar strong.text-white,
body.light-mode aside#sidebar .text-white:not([class*="bg-indigo-"]):not(.btn-premium) {
    color: var(--text-main) !important;
}

body.light-mode aside#sidebar nav p {
    color: var(--text-dim) !important;
    font-weight: 700 !important;
}

body.light-mode aside#sidebar a.bg-white\/\[0\.08\],
body.light-mode aside#sidebar a.bg-indigo-500\/15,
body.light-mode aside#sidebar a.bg-indigo-500\/20 {
    background-color: rgba(79, 70, 229, 0.1) !important;
    border-color: rgba(79, 70, 229, 0.3) !important;
    color: #4338CA !important;
    font-weight: 700 !important;
}

body.light-mode aside#sidebar a.bg-white\/\[0\.08\] i,
body.light-mode aside#sidebar a.bg-indigo-500\/15 i,
body.light-mode aside#sidebar a.bg-indigo-500\/20 i {
    color: #4338CA !important;
}

body.light-mode aside#sidebar a.text-slate-300,
body.light-mode aside#sidebar a.text-slate-400 {
    color: var(--text-muted) !important;
}

body.light-mode aside#sidebar a.text-slate-300:hover,
body.light-mode aside#sidebar a.text-slate-400:hover {
    background-color: var(--bg-surface-subtle) !important;
    color: var(--text-main) !important;
}

body.light-mode aside#sidebar a.text-slate-300:hover i,
body.light-mode aside#sidebar a.text-slate-400:hover i {
    color: var(--text-main) !important;
}

body.light-mode aside#sidebar .border-t,
body.light-mode aside#sidebar .border-b {
    border-color: var(--border-color) !important;
}

/* 4. Cartões, Superfícies & Containers */
body.light-mode .glass,
body.light-mode .bento-card,
body.light-mode .minimal-card,
body.light-mode .pot-card-modern,
body.light-mode .virtual-card {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .glass-hover:hover,
body.light-mode .pot-card-modern:hover,
body.light-mode .virtual-card:hover {
    border-color: var(--border-hover) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05) !important;
}

/* Containers com fundos pretos/slate tornam-se superfícies limpas */
body.light-mode .glass .bg-slate-900,
body.light-mode .glass .bg-slate-900\/60,
body.light-mode .glass .bg-slate-900\/80,
body.light-mode .glass .bg-slate-900\/90,
body.light-mode .glass .bg-slate-900\/95,
body.light-mode .glass .bg-slate-950,
body.light-mode .glass .bg-slate-950\/50,
body.light-mode .glass .bg-slate-950\/85 {
    background-color: var(--bg-surface-subtle) !important;
    border-color: var(--border-color) !important;
}

/* 5. Tipografia & Textos no Modo Claro */
body.light-mode h1,
body.light-mode h2,
body.light-mode h3,
body.light-mode h4,
body.light-mode h5,
body.light-mode h6,
body.light-mode .font-display {
    color: var(--text-main) !important;
}

body.light-mode .text-slate-100,
body.light-mode .text-slate-200,
body.light-mode .text-slate-300 {
    color: var(--text-main) !important;
}

body.light-mode .text-slate-400 {
    color: var(--text-muted) !important;
}

body.light-mode .text-slate-500,
body.light-mode .text-slate-600 {
    color: var(--text-dim) !important;
}

/* Proteção essencial de texto branco em botões e elementos escuros */
body.light-mode .btn-premium,
body.light-mode button.bg-indigo-600,
body.light-mode button.bg-purple-600,
body.light-mode button.bg-emerald-600,
body.light-mode button.bg-rose-600,
body.light-mode button[class*="from-"],
body.light-mode a[class*="from-"],
body.light-mode a.bg-indigo-600,
body.light-mode a.bg-purple-600,
body.light-mode a.bg-emerald-600 {
    color: #FFFFFF !important;
}

body.light-mode .btn-premium *,
body.light-mode button.bg-indigo-600 *,
body.light-mode button.bg-purple-600 *,
body.light-mode button.bg-emerald-600 *,
body.light-mode button.bg-rose-600 *,
body.light-mode button[class*="from-"] *,
body.light-mode a[class*="from-"] *,
body.light-mode a.bg-indigo-600 *,
body.light-mode a.bg-purple-600 *,
body.light-mode a.bg-emerald-600 * {
    color: inherit !important;
}

/* Texto branco geral converte-se em texto escuro legível em superfícies normais */
body.light-mode .text-white:not(.btn-premium):not([class*="bg-indigo-"]):not([class*="bg-purple-"]):not([class*="bg-emerald-"]):not([class*="bg-rose-"]):not([class*="bg-red-"]):not([class*="from-"]):not([class*="to-"]):not([id*="pm-main-image"]):not([class*="partner-slide-img"]) {
    color: var(--text-main) !important;
}

/* Badges e Botões Amarelos/Amber mantêm texto escuro para contraste ideal */
body.light-mode .text-slate-950,
body.light-mode [class*="bg-amber-500"] .text-slate-950,
body.light-mode button.bg-amber-500,
body.light-mode a.bg-amber-500,
body.light-mode .bg-amber-400 {
    color: #020617 !important;
}

/* 6. Cores de Destaque com Alto Contraste (Cores Vivas em Fundo Claro) */

/* Âmbar / Dourado / Amarelo */
body.light-mode .text-amber-200,
body.light-mode .text-amber-300,
body.light-mode .text-amber-400,
body.light-mode .text-yellow-300,
body.light-mode .text-yellow-400 {
    color: #92400E !important; /* Amber 800 - contraste 6.5:1 em branco */
}
body.light-mode .hover\:text-amber-300:hover,
body.light-mode .hover\:text-amber-200:hover {
    color: #78350F !important;
}
body.light-mode [class*="bg-amber-500\/"],
body.light-mode [class*="bg-amber-400\/"] {
    background-color: rgba(245, 158, 11, 0.12) !important;
    border-color: rgba(245, 158, 11, 0.35) !important;
    color: #92400E !important;
}

/* Esmeralda / Verde */
body.light-mode .text-emerald-300,
body.light-mode .text-emerald-400,
body.light-mode .text-green-300,
body.light-mode .text-green-400 {
    color: #047857 !important; /* Emerald 700 - contraste 5.5:1 em branco */
}
body.light-mode .hover\:text-emerald-300:hover,
body.light-mode .hover\:text-emerald-200:hover {
    color: #064E3B !important;
}
body.light-mode [class*="bg-emerald-500\/"],
body.light-mode [class*="bg-green-500\/"] {
    background-color: rgba(16, 185, 129, 0.12) !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
    color: #047857 !important;
}

/* Rosa / Vermelho */
body.light-mode .text-rose-300,
body.light-mode .text-rose-400,
body.light-mode .text-red-300,
body.light-mode .text-red-400 {
    color: #BE123C !important; /* Rose 700 - contraste 6.2:1 em branco */
}
body.light-mode .hover\:text-rose-300:hover,
body.light-mode .hover\:text-rose-200:hover {
    color: #9F1239 !important;
}
body.light-mode [class*="bg-rose-500\/"],
body.light-mode [class*="bg-red-500\/"] {
    background-color: rgba(244, 63, 94, 0.12) !important;
    border-color: rgba(244, 63, 94, 0.35) !important;
    color: #BE123C !important;
}

/* Índigo / Azul */
body.light-mode .text-indigo-300,
body.light-mode .text-indigo-400 {
    color: #4338CA !important; /* Indigo 700 - contraste 6.8:1 em branco */
}
body.light-mode .text-blue-300,
body.light-mode .text-blue-400 {
    color: #1D4ED8 !important; /* Blue 700 */
}
body.light-mode .hover\:text-indigo-300:hover,
body.light-mode .hover\:text-indigo-200:hover {
    color: #3730A3 !important;
}
body.light-mode [class*="bg-indigo-500\/"],
body.light-mode [class*="bg-blue-500\/"] {
    background-color: rgba(79, 70, 229, 0.1) !important;
    border-color: rgba(79, 70, 229, 0.3) !important;
    color: #4338CA !important;
}

/* Roxo / Violeta */
body.light-mode .text-purple-300,
body.light-mode .text-purple-400,
body.light-mode .text-violet-300,
body.light-mode .text-violet-400 {
    color: #7E22CE !important; /* Purple 700 - contraste 6.0:1 em branco */
}
body.light-mode .hover\:text-purple-300:hover,
body.light-mode .hover\:text-purple-200:hover {
    color: #6B21A8 !important;
}
body.light-mode [class*="bg-purple-500\/"],
body.light-mode [class*="bg-violet-500\/"] {
    background-color: rgba(168, 85, 247, 0.12) !important;
    border-color: rgba(168, 85, 247, 0.3) !important;
    color: #7E22CE !important;
}

/* Teal / Ciano */
body.light-mode .text-teal-300,
body.light-mode .text-teal-400,
body.light-mode .text-cyan-300,
body.light-mode .text-cyan-400 {
    color: #0F766E !important; /* Teal 700 - contraste 5.8:1 em branco */
}
body.light-mode .hover\:text-teal-300:hover,
body.light-mode .hover\:text-teal-200:hover {
    color: #115E59 !important;
}
body.light-mode [class*="bg-teal-500\/"],
body.light-mode [class*="bg-cyan-500\/"] {
    background-color: rgba(20, 184, 166, 0.12) !important;
    border-color: rgba(20, 184, 166, 0.3) !important;
    color: #0F766E !important;
}

/* 7. Prevenção de Texto a Desaparecer em Hover (hover:text-white) */
body.light-mode a:not([class*="from-"]):not([class*="bg-indigo-600"]):not([class*="bg-purple-600"]):not([class*="bg-emerald-600"]):not(.btn-premium).hover\:text-white:hover,
body.light-mode button:not([class*="from-"]):not([class*="bg-indigo-600"]):not([class*="bg-purple-600"]):not([class*="bg-emerald-600"]):not(.btn-premium).hover\:text-white:hover {
    color: var(--text-main) !important;
}

body.light-mode .hover\:text-slate-200:hover,
body.light-mode .hover\:text-slate-100:hover,
body.light-mode .hover\:text-slate-300:hover {
    color: var(--text-main) !important;
}

/* 8. Títulos com Gradiente (bg-clip-text) com Alto Contraste */
body.light-mode .bg-clip-text[class*="from-indigo-"],
body.light-mode .bg-clip-text[class*="from-purple-"] {
    background-image: linear-gradient(to right, #4338CA, #6366F1, #7E22CE) !important;
}

body.light-mode .bg-clip-text[class*="from-emerald-"],
body.light-mode .bg-clip-text[class*="from-teal-"] {
    background-image: linear-gradient(to right, #047857, #0D9488, #4338CA) !important;
}

body.light-mode .bg-clip-text[class*="from-amber-"],
body.light-mode .bg-clip-text[class*="from-yellow-"] {
    background-image: linear-gradient(to right, #B45309, #D97706, #92400E) !important;
}

body.light-mode .bg-clip-text[class*="from-rose-"] {
    background-image: linear-gradient(to right, #BE123C, #E11D48, #7E22CE) !important;
}

/* 9. Bordas, Divisores e Fundos Sutis */
body.light-mode [class*="border-white\/"] {
    border-color: var(--border-color) !important;
}

body.light-mode .border-white\/5,
body.light-mode .border-white\/10,
body.light-mode .border-white\/15,
body.light-mode .border-white\/20,
body.light-mode .border-white\/\[0\.06\],
body.light-mode .border-white\/\[0\.08\],
body.light-mode .border-white\/\[0\.1\] {
    border-color: var(--border-color) !important;
}

body.light-mode [class*="divide-white"] {
    border-color: var(--border-color) !important;
}

body.light-mode .bg-white\/5,
body.light-mode .bg-white\/10,
body.light-mode .bg-white\/15,
body.light-mode .bg-white\/20,
body.light-mode .bg-white\/\[0\.01\],
body.light-mode .bg-white\/\[0\.02\],
body.light-mode .bg-white\/\[0\.03\],
body.light-mode .bg-white\/\[0\.04\],
body.light-mode .bg-white\/\[0\.05\],
body.light-mode .bg-white\/\[0\.06\],
body.light-mode .bg-white\/\[0\.07\],
body.light-mode .bg-white\/\[0\.08\] {
    background-color: var(--bg-surface-subtle) !important;
    border-color: var(--border-color) !important;
}

body.light-mode .hover\:bg-white\/5:hover,
body.light-mode .hover\:bg-white\/10:hover,
body.light-mode .hover\:bg-white\/\[0\.03\]:hover,
body.light-mode .hover\:bg-white\/\[0\.04\]:hover,
body.light-mode .hover\:bg-white\/\[0\.05\]:hover,
body.light-mode .hover\:bg-white\/\[0\.06\]:hover,
body.light-mode .hover\:bg-white\/\[0\.08\]:hover {
    background-color: #E2E8F0 !important;
}

/* 10. Formulários, Inputs, Radios & Selects */
body.light-mode input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]),
body.light-mode select,
body.light-mode textarea,
body.light-mode .input-premium {
    background-color: #F8FAFC !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-main) !important;
}

body.light-mode input::placeholder,
body.light-mode textarea::placeholder {
    color: var(--text-dim) !important;
}

body.light-mode input:focus,
body.light-mode select:focus,
body.light-mode textarea:focus,
body.light-mode .input-premium:focus {
    border-color: var(--primary) !important;
    background-color: var(--bg-surface) !important;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15) !important;
}

body.light-mode select option,
body.light-mode select optgroup,
body.light-mode option {
    background-color: var(--bg-surface) !important;
    color: var(--text-main) !important;
}

/* Controlo Segmentado / Abas de Alternância (Potes, Modal Tx, etc) */
body.light-mode .bg-white\/5.rounded-2xl,
body.light-mode .bg-white\/5.rounded-xl {
    background-color: var(--bg-surface-subtle) !important;
    border: 1px solid var(--border-color) !important;
}

/* Cartões de Seleção (Banco / Cofre / Ambos) */
body.light-mode .peer + div {
    background-color: #F8FAFC !important;
    border-color: var(--border-color) !important;
}

body.light-mode .peer:checked + div:not([id*="card-bank"]):not([id*="card-vault"]):not([id*="card-split"]) {
    border-color: var(--primary) !important;
    background-color: rgba(79, 70, 229, 0.08) !important;
}

body.light-mode .peer:checked + [id*="card-bank"],
body.light-mode .peer:checked + [id*="bank"] {
    border-color: #3B82F6 !important;
    background-color: rgba(59, 130, 246, 0.1) !important;
}

body.light-mode .peer:checked + [id*="card-vault"],
body.light-mode .peer:checked + [id*="vault"] {
    border-color: #F59E0B !important;
    background-color: rgba(245, 158, 11, 0.1) !important;
}

body.light-mode .peer:checked + [id*="card-split"],
body.light-mode .peer:checked + [id*="split"] {
    border-color: #6366F1 !important;
    background-color: rgba(99, 102, 241, 0.1) !important;
}

/* 11. Tabelas no Modo Claro */
body.light-mode table thead tr,
body.light-mode table thead th {
    background-color: var(--bg-surface-subtle) !important;
    color: var(--text-muted) !important;
    font-weight: 700 !important;
    border-bottom: 1px solid var(--border-color) !important;
}

body.light-mode table tbody tr {
    border-color: var(--border-color) !important;
}

body.light-mode table tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.02) !important;
}

/* 12. Grelha do Calendário (pages/calendar.php) */
body.light-mode .calendar-day-cell {
    background-color: #FFFFFF !important;
    border-color: var(--border-color) !important;
}

body.light-mode .calendar-day-cell:hover {
    background-color: #F8FAFC !important;
    border-color: var(--border-hover) !important;
}

body.light-mode .calendar-day-cell.bg-indigo-600\/15 {
    background-color: rgba(79, 70, 229, 0.08) !important;
    border-color: #6366F1 !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15) !important;
}

body.light-mode .calendar-day-cell span.text-slate-200 {
    color: var(--text-main) !important;
}

/* 13. Barra Sticky / Calculadora (pages/shopping.php) */
body.light-mode .sticky.glass,
body.light-mode .sticky.bg-slate-950\/85 {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-color: var(--border-hover) !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08) !important;
    backdrop-filter: blur(8px) !important;
}

/* 14. Modais, Popovers e Menus Flutuantes */
body.light-mode [id*="modal"].fixed {
    background-color: rgba(15, 23, 42, 0.5) !important;
    backdrop-filter: blur(4px) !important;
}

body.light-mode [id*="modal"] .glass {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.18) !important;
}

body.light-mode [id*="modal"] .border-b {
    border-color: var(--border-color) !important;
    background-color: #F8FAFC !important;
}

body.light-mode #tour-popover {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12) !important;
}

body.light-mode #tour-popover #tour-title {
    color: var(--text-main) !important;
}

body.light-mode #tour-popover #tour-text {
    color: var(--text-muted) !important;
}

body.light-mode .floating-nav {
    background-color: var(--bg-surface) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08) !important;
}

body.light-mode .floating-nav a.text-slate-400 {
    color: var(--text-muted) !important;
}

body.light-mode .floating-nav a.text-slate-400:hover {
    color: var(--text-main) !important;
}

/* 14.5. Dashboard no Modo Claro */
body.light-mode .dashboard-hero-card {
    background-image: linear-gradient(135deg, #FFFFFF 0%, #EEF2FF 45%, #FAF5FF 100%) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
    box-shadow: 0 10px 30px -10px rgba(79, 70, 229, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.03) !important;
}

body.light-mode .dashboard-hero-card h1 {
    color: #0F172A !important;
}

body.light-mode .dashboard-hero-card p {
    color: #334155 !important;
}

body.light-mode .dashboard-hero-card p strong {
    color: #0F172A !important;
}

body.light-mode .dashboard-hero-card .text-indigo-200\/80 {
    color: #475569 !important;
}

body.light-mode .dashboard-hero-card .text-slate-300\/90 {
    color: #334155 !important;
}

body.light-mode .dashboard-hero-card .text-indigo-300 {
    color: #4338CA !important;
    font-weight: 700 !important;
}

body.light-mode .dashboard-hero-card a[href*="/impact"] {
    background-color: #FFF1F2 !important;
    border-color: #FECDD3 !important;
    color: #BE123C !important;
}

body.light-mode .dashboard-hero-card a[href*="/impact"]:hover {
    background-color: #FFE4E6 !important;
}

body.light-mode .dashboard-hero-card a[href*="/impact"] i {
    color: #E11D48 !important;
}

/* 15. KRAFTIS Privilege & Cartão de Membro (Paleta Dourado Luxury) */

/* Tema Dourado Luxury (Dark Mode) */
.privilege-theme .bg-amber-500,
.privilege-theme .bg-amber-500\/90,
.privilege-theme .bg-gradient-to-br.from-amber-400 {
    background-color: #D4AF37 !important;
    background-image: linear-gradient(135deg, #F5E199 0%, #D4AF37 52%, #A67C1E 100%) !important;
    color: #1A1404 !important;
    border-color: rgba(245, 225, 153, 0.55) !important;
    box-shadow: 0 4px 16px -2px rgba(212, 175, 55, 0.30), inset 0 1px 0 rgba(255, 250, 224, 0.45) !important;
}

.privilege-theme .hover\:bg-amber-400:hover,
.privilege-theme .hover\:bg-amber-500:hover {
    background-color: #DFBE4B !important;
    background-image: linear-gradient(135deg, #FAF0CA 0%, #DFBE4B 52%, #B88B26 100%) !important;
    color: #1A1404 !important;
}

.privilege-theme .bg-amber-400 {
    background-color: #E6C667 !important;
}

.privilege-theme .text-amber-200 {
    color: #F5E6B8 !important;
}

.privilege-theme .text-amber-300,
.privilege-theme .text-amber-300\/90 {
    color: #E6C667 !important;
}

.privilege-theme .text-amber-400 {
    color: #D4AF37 !important;
}

.privilege-theme .text-amber-400\/40 {
    color: rgba(212, 175, 55, 0.42) !important;
}

.privilege-theme .hover\:text-amber-200:hover,
.privilege-theme .hover\:text-amber-300:hover {
    color: #FAF0CA !important;
}

.privilege-theme .bg-amber-500\/10 {
    background-color: rgba(212, 175, 55, 0.10) !important;
}

.privilege-theme .bg-amber-500\/15 {
    background-color: rgba(212, 175, 55, 0.14) !important;
}

.privilege-theme .bg-amber-500\/20 {
    background-color: rgba(212, 175, 55, 0.18) !important;
}

.privilege-theme .bg-amber-500\/25 {
    background-color: rgba(212, 175, 55, 0.22) !important;
}

.privilege-theme .border-amber-500\/20 {
    border-color: rgba(212, 175, 55, 0.22) !important;
}

.privilege-theme .border-amber-500\/25 {
    border-color: rgba(212, 175, 55, 0.28) !important;
}

.privilege-theme .border-amber-500\/30 {
    border-color: rgba(212, 175, 55, 0.34) !important;
}

.privilege-theme .border-amber-500\/40,
.privilege-theme .border-amber-400\/50 {
    border-color: rgba(212, 175, 55, 0.48) !important;
}

.privilege-theme .border-amber-400\/60,
.privilege-theme .hover\:border-amber-400\/50:hover,
.privilege-theme .hover\:border-amber-400\/60:hover,
.privilege-theme .hover\:border-amber-400\/65:hover {
    border-color: rgba(230, 198, 103, 0.65) !important;
}

.privilege-theme .border-amber-400 {
    border-color: #D4AF37 !important;
}

.privilege-theme .ring-amber-400\/40 {
    --tw-ring-color: rgba(212, 175, 55, 0.45) !important;
}

.privilege-theme .focus\:border-amber-500\/50:focus {
    border-color: rgba(212, 175, 55, 0.65) !important;
}

.privilege-theme .from-amber-950\/35,
.privilege-theme .from-amber-950\/40,
.privilege-theme .to-amber-950 {
    background-image: linear-gradient(135deg, rgba(42, 31, 8, 0.72) 0%, rgba(15, 23, 42, 0.92) 55%, rgba(28, 22, 10, 0.88) 100%) !important;
}

.privilege-theme .from-amber-500\/\[0\.08\] {
    background-image: linear-gradient(135deg, rgba(212, 175, 55, 0.11) 0%, rgba(15, 23, 42, 0.4) 60%, transparent 100%) !important;
}

.privilege-theme .bg-clip-text[class*="from-amber-"] {
    background-image: linear-gradient(90deg, #FAF0CA 0%, #D4AF37 50%, #F3E5AB 100%) !important;
}

/* Modo Claro: Dourado Luxury com Contraste Elevado */
body.light-mode .privilege-theme .text-amber-200,
body.light-mode .privilege-theme .text-amber-300,
body.light-mode .privilege-theme .text-amber-300\/90,
body.light-mode .privilege-theme .text-amber-400 {
    color: #8A6612 !important;
}

body.light-mode .privilege-theme .hover\:text-amber-200:hover,
body.light-mode .privilege-theme .hover\:text-amber-300:hover {
    color: #6E4F0B !important;
}

body.light-mode .privilege-theme [class*="bg-amber-500\/"],
body.light-mode .privilege-theme [class*="bg-amber-400\/"] {
    background-color: rgba(212, 175, 55, 0.14) !important;
}

body.light-mode .privilege-theme .bg-clip-text[class*="from-amber-"] {
    background-image: linear-gradient(90deg, #9A7414 0%, #C59B27 50%, #7C5B0E 100%) !important;
}

/* Hero do Módulo Privilege */
body.light-mode .privilege-hero-container {
    background-image: linear-gradient(135deg, #FFFFFF 0%, #FDF9ED 45%, #F8FAFC 100%) !important;
    border-color: rgba(181, 137, 30, 0.35) !important;
    box-shadow: 0 10px 30px -10px rgba(181, 137, 30, 0.14), 0 4px 6px -2px rgba(0, 0, 0, 0.03) !important;
}

body.light-mode .privilege-hero-container h1 {
    color: #0F172A !important;
}

body.light-mode .privilege-hero-container p {
    color: #334155 !important;
}

body.light-mode .privilege-hero-container p strong {
    color: #0F172A !important;
}

body.light-mode .privilege-hero-container p strong.text-amber-200 {
    color: #8A6612 !important;
}

body.light-mode .privilege-filter-btn:not(.bg-amber-500) {
    background-color: #FFFFFF !important;
    border-color: #CBD5E1 !important;
    color: #334155 !important;
}

body.light-mode .privilege-filter-btn:not(.bg-amber-500):hover {
    background-color: #F1F5F9 !important;
    color: #0F172A !important;
    border-color: #94A3B8 !important;
}

/* Cartão Digital de Membro KRAFTIS Club (Versão VIP Claro Champagne / Dourado) */
body.light-mode .privilege-member-card {
    background-image: linear-gradient(135deg, #FFFFFF 0%, #FDF9ED 45%, #F7EBC6 100%) !important;
    border: 1.5px solid rgba(181, 137, 30, 0.50) !important;
    box-shadow: 0 10px 25px -5px rgba(181, 137, 30, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode .privilege-member-card .text-white {
    color: #0F172A !important;
}

body.light-mode .privilege-member-card strong {
    color: #0F172A !important;
}

body.light-mode .privilege-member-card strong.text-amber-200 {
    color: #8A6612 !important;
}

body.light-mode .privilege-member-card .text-amber-400 {
    color: #8A6612 !important;
}

body.light-mode .privilege-member-card .text-amber-300\/90 {
    color: #8A6612 !important;
}

body.light-mode .privilege-member-card .text-slate-400 {
    color: #64748B !important;
}

body.light-mode .privilege-member-card .text-slate-200 {
    color: #0F172A !important;
}

body.light-mode .privilege-member-card .border-t {
    border-color: rgba(181, 137, 30, 0.25) !important;
}

body.light-mode .privilege-member-card .bg-slate-800 {
    background-color: #F7EBC6 !important;
    border-color: rgba(181, 137, 30, 0.6) !important;
    color: #8A6612 !important;
}

body.light-mode .privilege-member-card .bg-gradient-to-br.from-amber-400 {
    background-image: linear-gradient(135deg, #F5E199 0%, #D4AF37 52%, #A67C1E 100%) !important;
    color: #1A1404 !important;
}

body.light-mode .privilege-member-card .bg-emerald-500\/20 {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #047857 !important;
}

/* Modal do Cartão de Membro Ampliado */
body.light-mode #member-card-modal {
    background-color: rgba(15, 23, 42, 0.65) !important;
}

body.light-mode .privilege-member-modal-card {
    background-image: linear-gradient(135deg, #FFFFFF 0%, #FDF9ED 45%, #F7EBC6 100%) !important;
    border: 2px solid rgba(181, 137, 30, 0.55) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

body.light-mode .privilege-member-modal-card .text-white {
    color: #0F172A !important;
}

body.light-mode .privilege-member-modal-card strong {
    color: #0F172A !important;
}

body.light-mode .privilege-member-modal-card strong.text-amber-300 {
    color: #8A6612 !important;
}

body.light-mode .privilege-member-modal-card .text-amber-400 {
    color: #8A6612 !important;
}

body.light-mode .privilege-member-modal-card .text-slate-400 {
    color: #64748B !important;
}

body.light-mode .privilege-member-modal-card .text-slate-200 {
    color: #0F172A !important;
}

body.light-mode .privilege-member-modal-card .bg-white\/\[0\.03\] {
    background-color: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(181, 137, 30, 0.30) !important;
}

body.light-mode .privilege-member-modal-card .bg-slate-800 {
    background-color: #F7EBC6 !important;
    border-color: #D4AF37 !important;
    color: #8A6612 !important;
}

body.light-mode .privilege-member-modal-card .bg-white\/\[0\.03\] .bg-white\/\[0\.03\] {
    background-color: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
}

body.light-mode .privilege-member-modal-card .bg-emerald-500\/20 {
    background-color: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
    color: #047857 !important;
}

body.light-mode .privilege-member-modal-card a.text-amber-400 {
    color: #8A6612 !important;
}

/* Etiquetas dos Parceiros KRAFTIS Privilege no Modo Claro */
body.light-mode .partner-category-badge {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(181, 137, 30, 0.5) !important;
    color: #8A6612 !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12) !important;
}

body.light-mode .partner-category-badge i {
    color: #B5891E !important;
}

body.light-mode .partner-discount-badge {
    background-color: #D4AF37 !important;
    background-image: linear-gradient(135deg, #F5E199 0%, #D4AF37 52%, #A67C1E 100%) !important;
    color: #1A1404 !important;
    border: 1px solid #B5891E !important;
    box-shadow: 0 4px 12px rgba(181, 137, 30, 0.35) !important;
}

body.light-mode .partner-discount-badge * {
    color: #1A1404 !important;
}

body.light-mode .partner-media-badge {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(203, 213, 225, 0.9) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

body.light-mode .partner-media-gallery {
    color: #0F172A !important;
}

body.light-mode .partner-media-gallery i {
    color: #B5891E !important;
}

body.light-mode .partner-media-video {
    color: #BE123C !important;
}

body.light-mode .partner-media-video i {
    color: #E11D48 !important;
}

body.light-mode .partner-media-pdf {
    color: #047857 !important;
}

body.light-mode .partner-media-pdf i {
    color: #059669 !important;
}

body.light-mode .partner-media-coupon {
    background-color: #F59E0B !important;
    color: #020617 !important;
    border: 1px solid #D97706 !important;
}

body.light-mode .partner-media-coupon * {
    color: #020617 !important;
}

body.light-mode .partner-location-badge {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(8px) !important;
    color: #0F172A !important;
    padding: 3px 9px !important;
    border-radius: 9999px !important;
    border: 1px solid rgba(203, 213, 225, 0.9) !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
}

body.light-mode .partner-location-badge i {
    color: #D97706 !important;
}

body.light-mode .partner-location-badge span {
    color: #0F172A !important;
}

/* Modal de Detalhes do Parceiro */
body.light-mode .partner-modal-dialog {
    background-color: #FFFFFF !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

body.light-mode .partner-modal-dialog .border-b {
    background-color: #F8FAFC !important;
    border-color: #E2E8F0 !important;
}

body.light-mode #pm-title {
    color: #0F172A !important;
}

body.light-mode #pm-category-badge {
    background-color: rgba(245, 158, 11, 0.15) !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
    color: #92400E !important;
}

body.light-mode #pm-discount-pill {
    background-color: #F59E0B !important;
    color: #020617 !important;
    border: 1px solid #D97706 !important;
}

body.light-mode #pm-discount-wrapper {
    background-color: #FFFBEB !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}

body.light-mode #pm-discount-wrapper span {
    color: #92400E !important;
}

body.light-mode #pm-discount-label {
    color: #0F172A !important;
}

body.light-mode #pm-location-wrapper {
    background-color: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
}

body.light-mode #pm-location-wrapper span {
    color: #64748B !important;
}

body.light-mode #pm-location {
    color: #0F172A !important;
}

body.light-mode #pm-coupon-wrapper {
    background-image: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%) !important;
    border: 2px dashed #F59E0B !important;
}

body.light-mode #pm-coupon-wrapper p {
    color: #334155 !important;
}

body.light-mode #pm-coupon-code {
    background-color: #FFFFFF !important;
    border: 1.5px solid #F59E0B !important;
    color: #92400E !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode #pm-coupon-site-link {
    color: #B45309 !important;
}

body.light-mode #pm-description {
    color: #334155 !important;
}

body.light-mode #pm-contacts-list {
    color: #0F172A !important;
}

body.light-mode #pm-contacts-list i {
    color: #D97706 !important;
}

body.light-mode #pm-socials-list a {
    background-color: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode #pm-socials-list a.text-pink-300 {
    color: #BE185D !important;
    border-color: #FECDD3 !important;
    background-color: #FFF1F2 !important;
}

body.light-mode #pm-socials-list a.text-blue-300 {
    color: #1D4ED8 !important;
    border-color: #BFDBFE !important;
    background-color: #EFF6FF !important;
}

body.light-mode #pm-socials-list a.text-sky-300 {
    color: #0369A1 !important;
    border-color: #BAE6FD !important;
    background-color: #F0F9FF !important;
}

body.light-mode #pm-pdf-link {
    background-color: #FFF1F2 !important;
    border-color: #FECDD3 !important;
    color: #BE123C !important;
}

body.light-mode #pm-photo-counter {
    background-color: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(8px) !important;
    color: #0F172A !important;
    border: 1px solid rgba(203, 213, 225, 0.9) !important;
}

body.light-mode #pm-photo-counter span {
    color: #0F172A !important;
}

/* Proteção dos controlos de foto/slider sobrepostas nos parceiros */
body.light-mode button[onclick*="changePartnerSlide"],
body.light-mode #pm-slide-prev-btn,
body.light-mode #pm-slide-next-btn {
    color: #FFFFFF !important;
}

body.light-mode button[onclick*="changePartnerSlide"] i,
body.light-mode #pm-slide-prev-btn i,
body.light-mode #pm-slide-next-btn i {
    color: #FFFFFF !important;
}

/* 16. Scrollbars Modo Claro */
body.light-mode ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
    border-radius: 4px;
}

body.light-mode ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 17. Seleção de Localização em Modais de Edição */
.active-bank {
    border-color: rgba(59, 130, 246, 0.5) !important;
    background-color: rgba(59, 130, 246, 0.1) !important;
}
.active-vault {
    border-color: rgba(245, 158, 11, 0.5) !important;
    background-color: rgba(245, 158, 11, 0.1) !important;
}

/* 18. Modo App Mobile (?app=1): Sem Zoom, Sem Scrollbar, Barra Inferior Fixa e Modais em Ecrã Completo */
html:has(body.kraftis-app-mode:not(.auth-app-screen)),
body.kraftis-app-mode:not(.auth-app-screen) {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    min-height: 100vh !important;
    min-height: -webkit-fill-available !important;
    overflow-x: hidden !important;
}

body.kraftis-app-mode:not(.auth-app-screen) > div.flex.min-h-screen {
    min-height: 100vh !important;
    min-height: -webkit-fill-available !important;
}

body.kraftis-app-mode:not(.auth-app-screen) main {
    min-height: 100vh !important;
    min-height: -webkit-fill-available !important;
    padding-bottom: 0 !important;
}

body.kraftis-app-mode:not(.auth-app-screen) main > div.flex-1.overflow-y-auto {
    overflow-y: visible !important;
    overflow-x: hidden !important;
    padding-top: 16px !important;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
}

html:has(body.kraftis-app-mode.auth-app-screen),
body.kraftis-app-mode.auth-app-screen {
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior-y: contain;
    overflow-x: hidden !important;
}

html:has(body.kraftis-app-mode),
body.kraftis-app-mode,
body.kraftis-app-mode * {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

html:has(body.kraftis-app-mode)::-webkit-scrollbar,
body.kraftis-app-mode::-webkit-scrollbar,
body.kraftis-app-mode *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

body.kraftis-app-mode input,
body.kraftis-app-mode select,
body.kraftis-app-mode textarea {
    font-size: 16px !important;
}

@keyframes appSheetSlideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

body.kraftis-app-mode div.fixed.inset-0[id]:not(#toast-container):not(.app-no-fullscreen):not(.hidden) {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: stretch !important;
    padding: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    background: rgba(2, 6, 23, 0.72) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    overflow: hidden !important;
    touch-action: pan-y !important;
    overscroll-behavior: none !important;
}

body.kraftis-app-mode div.fixed.inset-0[id]:not(#toast-container):not(.app-no-fullscreen):not(.hidden) * {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

body.kraftis-app-mode div.fixed.inset-0[id]:not(#toast-container):not(.app-no-fullscreen):not(.hidden) input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
body.kraftis-app-mode div.fixed.inset-0[id]:not(#toast-container):not(.app-no-fullscreen):not(.hidden) select,
body.kraftis-app-mode div.fixed.inset-0[id]:not(#toast-container):not(.app-no-fullscreen):not(.hidden) textarea {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

body.kraftis-app-mode div.fixed.inset-0[id]:not(#toast-container):not(.app-no-fullscreen):not(.hidden) input[type="date"],
body.kraftis-app-mode div.fixed.inset-0[id]:not(#toast-container):not(.app-no-fullscreen):not(.hidden) input[type="datetime-local"],
body.kraftis-app-mode div.fixed.inset-0[id]:not(#toast-container):not(.app-no-fullscreen):not(.hidden) input[type="time"] {
    -webkit-appearance: none;
    appearance: none;
}

body.kraftis-app-mode.light-mode div.fixed.inset-0[id]:not(#toast-container):not(.app-no-fullscreen):not(.hidden) {
    background: rgba(15, 23, 42, 0.45) !important;
}

body.kraftis-app-mode div.fixed.inset-0[id]:not(#toast-container):not(.app-no-fullscreen):not(.hidden) > div {
    width: 100% !important;
    max-width: 100vw !important;
    min-height: 0 !important;
    max-height: calc(100dvh - max(env(safe-area-inset-top, 0px), 24px)) !important;
    margin: 0 !important;
    border-top-left-radius: 24px !important;
    border-top-right-radius: 24px !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45) !important;
    background: #0F172A !important;
    backdrop-filter: none !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain !important;
    padding: 10px 16px calc(24px + env(safe-area-inset-bottom, 0px)) 16px !important;
    animation: appSheetSlideUp 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

body.kraftis-app-mode.light-mode div.fixed.inset-0[id]:not(#toast-container):not(.app-no-fullscreen):not(.hidden) > div {
    background: #FFFFFF !important;
    border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.16) !important;
}

.app-sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 9999px;
    background: rgba(148, 163, 184, 0.45);
    margin: 2px auto 12px auto;
    flex-shrink: 0;
}

body.kraftis-app-mode div.fixed.inset-0[id]:not(#toast-container):not(.app-no-fullscreen):not(.hidden) > div > div.glass,
body.kraftis-app-mode div.fixed.inset-0[id]:not(#toast-container):not(.app-no-fullscreen):not(.hidden) > div > div[class*="max-w-"] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    padding: 0 !important;
}

/* Ecrãs de Autenticação (Login / Registo) em Ecrã Inteiro no Modo App Mobile */
body.kraftis-app-mode header.sticky.top-0 {
    height: auto !important;
    min-height: calc(48px + env(safe-area-inset-top, 0px)) !important;
    padding-top: max(env(safe-area-inset-top, 0px), 8px) !important;
    padding-bottom: 8px !important;
}

body.kraftis-app-mode #sidebar > div {
    padding-top: calc(16px + max(env(safe-area-inset-top, 0px), 12px)) !important;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
}

body.kraftis-app-mode .floating-nav {
    position: fixed !important;
    bottom: 14px !important;
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    height: 60px !important;
    min-height: 60px !important;
    padding: 0 8px !important;
    border-radius: 1.25rem !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: rgba(17, 24, 39, 0.85) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35) !important;
}

body.kraftis-app-mode.light-mode .floating-nav {
    background: rgba(255, 255, 255, 0.88) !important;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
}

body.kraftis-app-mode.auth-app-screen {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    min-height: 100dvh !important;
    background: #0B0F17 !important;
}

body.kraftis-app-mode.auth-app-screen > div.absolute.top-4.right-4 {
    top: calc(12px + max(env(safe-area-inset-top, 0px), 8px)) !important;
}

body.kraftis-app-mode.auth-app-screen .auth-app-container {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: calc(64px + env(safe-area-inset-top, 0px)) 24px calc(32px + env(safe-area-inset-bottom, 0px)) !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body.kraftis-app-mode.auth-app-screen .auth-app-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
}

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

.app-nav-loader {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 66px);
    left: 50%;
    transform: translateX(-50%) scale(0.9);
    width: 34px;
    height: 34px;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

body.light-mode .app-nav-loader {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.app-nav-loader.is-visible {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

.app-nav-loader-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(99, 102, 241, 0.25);
    border-top-color: #818CF8;
    border-radius: 9999px;
    animation: appNavSpin 0.65s linear infinite;
}

/* Simplificação global de páginas no Modo App Mobile */
body.kraftis-app-mode:not(.auth-app-screen) main .space-y-6 > :not([hidden]) ~ :not([hidden]),
body.kraftis-app-mode:not(.auth-app-screen) main .space-y-8 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.875rem !important;
}

body.kraftis-app-mode:not(.auth-app-screen) main .glass.rounded-3xl:not(.dashboard-hero-card) {
    border-radius: 1rem !important;
}

body.kraftis-app-mode:not(.auth-app-screen) main .glass.p-6,
body.kraftis-app-mode:not(.auth-app-screen) main .glass.p-8,
body.kraftis-app-mode:not(.auth-app-screen) main .glass.p-10 {
    padding: 1rem !important;
}

body.kraftis-app-mode:not(.auth-app-screen) main h1 {
    font-size: 1.35rem !important;
    line-height: 1.25 !important;
}

body.kraftis-app-mode:not(.auth-app-screen) main h2 {
    font-size: 1.05rem !important;
    line-height: 1.3 !important;
}

body.kraftis-app-mode:not(.auth-app-screen) main .blur-3xl,
body.kraftis-app-mode:not(.auth-app-screen) main .blur-2xl {
    display: none !important;
}

body.kraftis-app-mode:not(.auth-app-screen) main table th,
body.kraftis-app-mode:not(.auth-app-screen) main table td {
    padding: 0.55rem 0.65rem !important;
    font-size: 0.75rem !important;
}
