:root {
    /* Identidade Visual - Painel Operacional (Verde / Branco / Laranja) */
    --ceara-green-1: #16803c;
    --ceara-green-2: #319a6e;
    --ceara-green-3: #44a849;
    --ceara-green-gradient: linear-gradient(90deg, #44a849 0%, #319a6e 100%);
    --ceara-orange-1: #e0630e;
    --ceara-orange-2: #d9530f;
    --ceara-yellow: #e0630e;
    
    /* Superfícies (Modo Claro Padrão) */
    --bg-dark-base: #f4f6f8;
    --bg-dark-card: #ffffff;
    --bg-subtle: #f8fafc;
    --bg-glass-border: #e2e8f0;
    --input-border: #cbd5e1;
    --input-bg: #ffffff;
    
    /* Textos */
    --text-primary: #1e293b;
    --text-secondary: #64748b;

    /* Badges e Destaques Suaves */
    --badge-green-bg: #e6f4ea;
    --badge-green-text: #15803d;
    --badge-green-border: #bbf7d0;
    --badge-orange-bg: #fff7ed;
    --badge-orange-text: #9a3412;
    --badge-orange-border: #fdba74;
    --upload-hover-bg: #f0fdf4;
}

body.dark-mode {
    --ceara-green-1: #22c55e;
    --ceara-green-2: #10b981;
    --ceara-green-gradient: linear-gradient(90deg, #15803d 0%, #0f766e 100%);
    --ceara-orange-1: #f97316;
    --ceara-orange-2: #ea580c;
    --ceara-yellow: #f97316;

    /* Superfícies (Modo Escuro) */
    --bg-dark-base: #0f172a;
    --bg-dark-card: #1e293b;
    --bg-subtle: #162032;
    --bg-glass-border: #334155;
    --input-border: #475569;
    --input-bg: #0f172a;

    /* Textos */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;

    /* Badges e Destaques Suaves no Escuro */
    --badge-green-bg: rgba(34, 197, 94, 0.14);
    --badge-green-text: #4ade80;
    --badge-green-border: rgba(74, 222, 128, 0.3);
    --badge-orange-bg: rgba(249, 115, 22, 0.14);
    --badge-orange-text: #fb923c;
    --badge-orange-border: rgba(251, 146, 60, 0.3);
    --upload-hover-bg: rgba(34, 197, 94, 0.1);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark-base);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Background Glow Effects */
.glow-bg {
    display: none;
}

/* Navbar com mesma largura útil do restante do conteúdo (.container) */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: calc(1400px - 4rem);
    width: calc(100% - 4rem);
    margin: 1.2rem auto 0 auto;
    padding: 0.9rem 2rem;
    border-radius: 14px;
    background: var(--ceara-green-gradient);
    box-shadow: 0 4px 12px rgba(49, 154, 110, 0.2);
    position: sticky;
    top: 10px;
    z-index: 100;
    color: #ffffff;
}
.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
}
.nav-brand .icon {
    font-size: 1.6rem;
}
.nav-links {
    list-style: none;
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.35rem 0.5rem;
    border-radius: 20px;
}
.nav-links a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.35rem 0.9rem;
    border-radius: 16px;
    transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active {
    color: #16803c;
    background: #ffffff;
}
.nav-actions {
    display: flex;
    gap: 1rem;
}

/* Botão de Alternar Tema (Claro / Escuro) */
.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 0.45rem 0.95rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.32);
    transform: translateY(-1px);
}

/* Buttons */
button {
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.btn-primary {
    background: #16803c;
    color: #ffffff;
    border: none;
    padding: 0.6rem 1.2rem;
    box-shadow: 0 4px 12px rgba(22, 128, 60, 0.25);
}
.btn-primary:hover {
    background: #146c32;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(22, 128, 60, 0.35);
}
.btn-outline {
    background: var(--bg-dark-card);
    color: var(--ceara-green-1);
    border: 1px solid var(--ceara-green-1);
    padding: 0.6rem 1.2rem;
}
.btn-outline:hover {
    background: var(--upload-hover-bg);
}
.btn-glass {
    background: var(--bg-dark-card);
    border: 1px solid var(--bg-glass-border);
    color: var(--text-primary);
    padding: 0.6rem 1.2rem;
}
.btn-glass:hover {
    background: var(--bg-subtle);
}
button.large {
    padding: 0.95rem 2rem;
    font-size: 1.05rem;
    border-radius: 10px;
}

/* Cards Corporativos */
.glass-card {
    background: var(--bg-dark-card);
    border: 1px solid var(--bg-glass-border);
    border-top: 4px solid var(--ceara-green-1);
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2.2rem 2rem;
}

/* Hero Section */
.hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3.5rem 4rem;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}
.hero-content {
    flex: 1;
    max-width: 60%;
    z-index: 2;
}
.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--badge-green-bg);
    color: var(--badge-green-text);
    border: 1px solid var(--badge-green-border);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}
.dot {
    width: 8px;
    height: 8px;
    background: var(--ceara-green-1);
    border-radius: 50%;
}
.hero-title {
    font-size: 3.4rem;
    line-height: 1.12;
    margin-bottom: 1.2rem;
    color: var(--text-primary);
    font-weight: 800;
}
.hero-title span {
    background: linear-gradient(90deg, #44a849 0%, #319a6e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
    max-width: 90%;
}
.hero-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}
.stat {
    background: var(--bg-subtle);
    border: 1px solid var(--bg-glass-border);
    border-top: 3px solid var(--ceara-green-1);
    border-radius: 10px;
    padding: 0.9rem 1.4rem;
    min-width: 140px;
}
.stat:first-child {
    border-top-color: var(--ceara-orange-1);
}
.stat:first-child h3 {
    color: var(--ceara-orange-1);
}
.stat h3 {
    font-size: 1.7rem;
    color: var(--ceara-green-1);
    margin-bottom: 0.2rem;
    font-weight: 800;
}
.stat p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.hero-buttons {
    display: flex;
    gap: 1rem;
}

/* Hero Visual */
.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 2;
}
.glowing-circle {
    width: 280px;
    height: 280px;
    border-radius: 50%;
    padding: 5px;
    background: var(--ceara-green-gradient);
    position: relative;
    box-shadow: 0 12px 30px rgba(49, 154, 110, 0.2);
}
.hero-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-dark-card);
    border: 4px solid var(--bg-dark-card);
}
.floating-badge {
    position: absolute;
    background: var(--badge-orange-bg);
    color: var(--badge-orange-text);
    border: 1px solid var(--badge-orange-border);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
}
.badge-top { top: 8%; right: 2%; }
.badge-bottom {
    bottom: 8%;
    left: 2%;
    background: var(--badge-green-bg);
    color: var(--badge-green-text);
    border-color: var(--badge-green-border);
}

/* Tools Grid */
.section-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: #ffffff;
    background: var(--ceara-green-gradient);
    padding: 0.9rem 1.4rem;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(49, 154, 110, 0.15);
}
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}
.tool-card {
    padding: 1.8rem;
    cursor: pointer;
    transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.tool-card:nth-child(odd) {
    border-top-color: var(--ceara-orange-1);
}
.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}
.tool-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
}
.tool-icon.icon-orange {
    background: var(--badge-orange-bg);
    border: 1px solid var(--badge-orange-border);
}
.tool-icon.icon-green {
    background: var(--badge-green-bg);
    border: 1px solid var(--badge-green-border);
}
.tool-card h3 {
    font-size: 1.15rem;
    margin-bottom: 0.6rem;
    color: var(--text-primary);
    font-weight: 700;
}
.tool-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}
.modal-content {
    width: 90%;
    max-width: 600px;
    padding: 2.5rem;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s;
}
.modal-overlay.active .modal-content {
    border-radius: 12px;
    z-index: 1000;
    transform: translateY(0);
}

/* Modal Grande */
.modal-lg .modal-content {
    max-width: 90vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
}
.modal-lg #modal-body {
    flex-grow: 1;
    overflow-y: auto;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.3s;
}

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

/* Page Previews (SortableJS) */
.page-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.page-card {
    background: var(--bg-subtle);
    border: 1px solid var(--input-border);
    border-top: 3px solid var(--ceara-green-1);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: grab;
    transition: 0.2s;
    position: relative;
    user-select: none;
}

.page-card:active {
    cursor: grabbing;
}

.page-card.deleted {
    opacity: 0.35;
    border-color: var(--ceara-orange-1);
    border-top-color: var(--ceara-orange-1);
}

.page-card img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    margin-bottom: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, z-index 0.2s;
    position: relative;
    z-index: 1;
    cursor: pointer;
}

.page-card.zoomed {
    z-index: 100;
}

.page-card.zoomed img {
    transform: scale(3.0);
    z-index: 100;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.page-card .page-label {
    font-size: 0.8rem;
    color: var(--text-primary);
    font-weight: 500;
}

.page-card .delete-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--ceara-orange-1);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: none;
    z-index: 5;
}

.page-card:hover .delete-btn {
    display: block;
}

.sortable-ghost {
    opacity: 0.4;
    background: var(--badge-orange-bg);
}

/* Upload e Inputs */
.upload-area {
    border: 2px dashed var(--input-border);
    background: var(--bg-subtle);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    margin: 1.5rem 0;
    cursor: pointer;
    transition: border 0.2s, background 0.2s;
    color: var(--text-primary);
}
.upload-area:hover {
    border-color: var(--ceara-green-1);
    background: var(--upload-hover-bg);
}
.input-group {
    margin-bottom: 1.5rem;
}
.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}
.input-group input, .input-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
}
.input-group input:focus, .input-group select:focus {
    outline: none;
    border-color: var(--ceara-green-1);
    box-shadow: 0 0 0 3px rgba(22, 128, 60, 0.15);
}
