:root {
    --primary: #469146; /* Indigo Moderno */
    --primary-hover: #66c766;
    --dark: #0f172a;
    --sidebar-bg: #1e3b30;
    --bg: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --sidebar-w: 280px;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* { box-sizing: border-box; }

body { 
    margin: 0; 
    font-family: 'Plus Jakarta Sans', sans-serif; 
    background: var(--bg); 
    color: var(--text-main);
    overflow-x: hidden;
}

/* Sidebar Estilizada */
.sidebar { 
    width: var(--sidebar-w); 
    background: var(--sidebar-bg); 
    color: white; 
    height: 100vh; 
    position: fixed; 
    padding: 24px;
    z-index: 1000;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Ativa a rolagem vertical */
}

.sidebar::-webkit-scrollbar {
    width: 11px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.logo { 
    display: flex; 
    align-items: center; 
    gap: 12px;
    font-weight: 800;
    font-size: 20px;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-icon {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
}

.logo-icon img{
    width: 100%;
}

.nav-menu { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #94a3b8;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: var(--radius);
    transition: all 0.2s ease;
    font-size: 15px;
    font-weight: 500;
}

.nav-item i { width: 18px; height: 18px; }

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: white;
}

.nav-item.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.nav-item {
    padding: 8px 12px; /* Reduzido de 12px para 8px */
    margin-bottom: 2px;
    font-size: 0.9rem;
}

.nav-category {
    margin-top: 15px;
    margin-bottom: 5px;
    text-transform: uppercase;
    font-size: 1rem;
    letter-spacing: 1.5px;
    opacity: 0.6;
}

.nav-separator {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 15px 0;
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sidebar-footer a {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-decoration: none;
}

.info-box {
    background: #e2e8f0;
    padding: 15px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-top: 20px;
    border-left: 4px solid var(--primary);
}

/* Layout Principal */
.main-content { 
    margin-left: var(--sidebar-w); 
    flex: 1; 
    min-height: 100vh;
    padding: 0;
}

.top-bar {
    background: white;
    padding: 16px 40px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 900;
}

.top-bar h2 { font-size: 18px; margin: 0; font-weight: 700; color: var(--dark); }

.container { padding: 40px; max-width: 1100px; margin: 0 auto; }

.nav-sub-category{
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 5px 0 8px 7px;
    opacity: 0.7;
}

/* Cards e Controles */
.card { 
    background: white; 
    padding: 32px; 
    border-radius: var(--radius); 
    box-shadow: var(--shadow);
    border: 1px solid rgba(0,0,0,0.02);
}

.config-row { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px; 
    margin-bottom: 32px; 
}

.group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}

select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
    transition: border 0.2s;
}

select:focus { outline: none; border-color: var(--primary); }

.btn-primary { 
    background: var(--primary); 
    color: white; 
    border: none; 
    padding: 14px 28px; 
    border-radius: 8px; 
    cursor: pointer; 
    font-weight: 600; 
    transition: all 0.2s;
    width: 100%;
}

.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }

/* Grid de Dados (Dossiê) */
.dossie { margin-top: 40px; animation: fadeIn 0.3s ease; }

.sec-title { 
    font-size: 12px; 
    color: var(--primary); 
    letter-spacing: 0.05em;
    text-transform: uppercase; 
    font-weight: 700;
    margin: 32px 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sec-title::after { content: ""; height: 1px; background: #e2e8f0; flex: 1; }

.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.field-box {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    border-radius: 10px;
    transition: all 0.2s;
}

.field-box:hover { border-color: var(--primary); background: #fcfcff; }

.field-box label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }

.field-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}

.field-content span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--dark);
    word-break: break-all;
}

.field-content button {
    background: #f1f5f9;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    color: var(--primary);
    transition: 0.2s;
}

.field-content button:hover { background: var(--primary); color: white; }

/* JSON View */
.json-box {
    position: relative;
    background: #0f172a;
    border-radius: 12px;
    margin-top: 24px;
    padding: 24px;
}

.json-box pre { margin: 0; color: #38bdf8; font-family: 'JetBrains Mono', monospace; font-size: 13px; line-height: 1.6; }

/* Toast */
.toast { 
    position: fixed; 
    bottom: 30px; 
    right: 30px; 
    background: var(--dark); 
    color: white; 
    padding: 16px 24px; 
    border-radius: 12px; 
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(100px);
    opacity: 0; 
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.2);
    z-index: 2000;
}
.toast.show { transform: translateY(0); opacity: 1; }

/* Mobile */
.menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dark);
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-btn { display: block; }
    .top-bar { padding: 16px 20px; }
    .container { padding: 20px; }
    .profile-grid { grid-template-columns: 1fr; }
    .config-row { grid-template-columns: 1fr; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.color-picker-container {
    position: relative;
    width: 100%;
    height: 55px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: background-color 0.2s ease, transform 0.1s ease;
    cursor: pointer;
    color: white;
}

.color-picker-container:active {
    transform: scale(0.98);
}

.picker-label {
    position: absolute;
    font-size: 14px;
    font-weight: 700;
    pointer-events: none;
    z-index: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

#color-picker {
    width: 100%;
    height: 100%;
    cursor: pointer;
    border: none;
    padding: 0;
    background: none;
    opacity: 0; /* Totalmente invisível, o fundo do container faz o trabalho */
    z-index: 2;
}

.color-preview-large {
    width: 120px;
    height: 120px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    border: 4px solid white;
    transition: background-color 0.2s ease;
}

.field-content input {
    background: transparent;
    border: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: var(--dark);
    width: 100%;
    outline: none;
    padding: 0;
    font-weight: 500;
}

/* Opcional: destaque leve quando o usuário clica para editar */
.field-content input:focus {
    color: var(--primary);
}

/* Mantém o botão de cópia alinhado */
.btn-copy-small {
    flex-shrink: 0;
    margin-left: 10px;
}

#lorem-qty::-webkit-inner-spin-button, 
#lorem-qty::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
#lorem-qty {
    -moz-appearance: textfield;
}

body.dark-mode {
    --bg: #334155;            /* Cinza ardósia médio */
    --text-main: #ffffff;     /* Texto branco */
    --text-muted: #cbd5e1;
    --card-bg: #1e293b;       /* Card cinza azulado escuro */
    --border-color: #475569;
}

/* Ajuste nos Cards quando em modo dark */
body.dark-mode .card,
body.dark-mode .field-box,
body.dark-mode .json-box {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: white;
}

body.dark-mode .field-content span {
    color: #f1f5f9;
}

body.dark-mode .nav-category {
    color: #94a3b8;
}
/* Botão de Troca de Tema */
.theme-btn {
    background: transparent;
    border: 1px solid #e2e8f0;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted);
    margin-right: 15px;
    display: flex;
    align-items: center;
    transition: all 0.2s;
}

body.dark-mode .top-bar h2,
body.dark-mode .menu-btn,
body.dark-mode .theme-btn {
    color: white !important;
}

body.dark-mode .theme-btn {
    border-color: var(--border-color) !important;
    color: #fbbf24 !important; /* Sol Amarelo */
}

body.dark-mode .top-bar {
    background: #1e293b;
    color: white;
    border-bottom: 1px solid var(--border-color);
}

body.dark-mode .top-bar h2 {
    color: white !important;
}

body.dark-mode .sidebar {
    background: #0f172a;      /* Quase preto para contraste com o cinza do fundo */
}

body.dark-mode .info-box{
        background: transparent;
}

body.dark-mode textarea, 
body.dark-mode input, 
body.dark-mode select {
    background-color: #0f172a;
    color: white;
    border: 1px solid var(--border-color);
}