@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons+Round');

:root {
    --verde:      #0D4F3C;
    --verde-dark: #0A3020;
    --verde-light:#E8F2EE;
    --dourado:    #C9A84C;
    --sidebar-w:  240px;
    --header-h:   60px;
    --bg:         #F4F6F8;
    --branco:     #ffffff;
    --borda:      #E2E8F0;
    --texto:      #1a202c;
    --muted:      #718096;
    --danger:     #E53E3E;
    --success:    #38A169;
    --warning:    #D69E2E;
    --info:       #3182CE;
    --radius:     10px;
    --sombra:     0 1px 8px rgba(0,0,0,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--texto); min-height: 100vh; }
a { text-decoration: none; color: inherit; }

/* SIDEBAR */
.sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-w); height: 100vh;
    background: var(--verde-dark);
    display: flex; flex-direction: column;
    z-index: 100; overflow-y: auto;
}
.sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: 10px;
}
.sidebar-logo-mark {
    width: 34px; height: 34px; border-radius: 50%;
    background: rgba(201,168,76,0.15);
    border: 1.5px solid var(--dourado);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: var(--dourado);
    flex-shrink: 0;
}
.sidebar-logo-text { line-height: 1.2; }
.sidebar-logo-nome { font-size: 14px; font-weight: 600; color: #fff; }
.sidebar-logo-tag { font-size: 10px; color: var(--dourado); opacity: .8; }
.sidebar-nav { flex: 1; padding: 16px 0; }
.nav-section { padding: 8px 20px 4px; font-size: 10px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,0.3); }
.nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 20px; font-size: 13.5px; font-weight: 500;
    color: rgba(255,255,255,0.6); cursor: pointer;
    transition: all .2s; border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active { background: rgba(201,168,76,0.1); color: var(--dourado); border-left-color: var(--dourado); }
.nav-item .material-icons-round { font-size: 18px; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.08); }
.sidebar-footer a { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,0.4); transition: color .2s; }
.sidebar-footer a:hover { color: #fff; }
.sidebar-footer .material-icons-round { font-size: 16px; }

/* MAIN */
.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }

/* HEADER */
.topbar {
    height: var(--header-h); background: var(--branco);
    border-bottom: 1px solid var(--borda);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px; position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 600; color: var(--texto); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-user { font-size: 13px; color: var(--muted); }
.topbar-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--verde); color: var(--dourado);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}

/* CONTENT */
.content { flex: 1; padding: 28px; }

/* CARDS */
.card {
    background: var(--branco); border-radius: var(--radius);
    border: 1px solid var(--borda); box-shadow: var(--sombra);
    overflow: hidden;
}
.card-header {
    padding: 16px 20px; border-bottom: 1px solid var(--borda);
    display: flex; align-items: center; justify-content: space-between;
}
.card-header h2 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-header h2 .material-icons-round { font-size: 18px; color: var(--verde); }
.card-body { padding: 20px; }

/* STATS CARDS */
.stats-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: var(--branco); border-radius: var(--radius);
    border: 1px solid var(--borda); padding: 20px;
    display: flex; align-items: center; gap: 16px;
}
.stat-icon {
    width: 44px; height: 44px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
}
.stat-icon.verde { background: var(--verde-light); color: var(--verde); }
.stat-icon.dourado { background: rgba(201,168,76,0.12); color: var(--dourado); }
.stat-icon.azul { background: #EBF4FF; color: var(--info); }
.stat-icon.laranja { background: #FFF5E6; color: #E07D10; }
.stat-num { font-size: 1.5rem; font-weight: 700; color: var(--texto); line-height: 1; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* FORMULÁRIOS */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group.full { grid-column: 1 / -1; }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .5px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], textarea, select {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--borda); border-radius: 8px;
    font-family: 'DM Sans', sans-serif; font-size: 14px;
    color: var(--texto); background: var(--branco);
    transition: border-color .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--verde); }
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* BOTÕES */
.btn {
    padding: 9px 18px; border-radius: 8px; font-size: 13.5px; font-weight: 600;
    cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    border: none; transition: all .2s; font-family: 'DM Sans', sans-serif;
}
.btn .material-icons-round { font-size: 16px; }
.btn-primary { background: var(--verde); color: #fff; }
.btn-primary:hover { background: var(--verde-dark); }
.btn-secondary { background: var(--bg); color: var(--texto); border: 1px solid var(--borda); }
.btn-secondary:hover { background: var(--borda); }
.btn-danger { background: #FFF5F5; color: var(--danger); border: 1px solid #FED7D7; }
.btn-danger:hover { background: #FED7D7; }
.btn-success { background: #F0FFF4; color: var(--success); border: 1px solid #C6F6D5; }
.btn-success:hover { background: #C6F6D5; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: 7px; }

/* TABELAS */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { background: var(--bg); padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--borda); }
td { padding: 12px 14px; border-bottom: 1px solid var(--borda); color: var(--texto); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #FAFBFC; }
.td-acoes { display: flex; gap: 6px; }

/* BADGES */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.badge-success { background: #F0FFF4; color: var(--success); }
.badge-danger  { background: #FFF5F5; color: var(--danger);  }
.badge-warning { background: #FFFFF0; color: var(--warning); }
.badge-info    { background: #EBF4FF; color: var(--info);    }
.badge-muted   { background: var(--bg); color: var(--muted); }

/* TOGGLE */
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #CBD5E0; border-radius: 22px; transition: .3s;
}
.toggle-slider::before {
    content: ''; position: absolute;
    width: 16px; height: 16px; left: 3px; bottom: 3px;
    background: white; border-radius: 50%; transition: .3s;
}
.toggle input:checked + .toggle-slider { background: var(--verde); }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); }

/* FLASH */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.flash-success { background: #F0FFF4; color: var(--success); border: 1px solid #C6F6D5; }
.flash-danger  { background: #FFF5F5; color: var(--danger);  border: 1px solid #FED7D7; }
.flash .material-icons-round { font-size: 18px; }

/* TABS */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--borda); margin-bottom: 20px; }
.tab { padding: 10px 16px; font-size: 13.5px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .2s; }
.tab.active { color: var(--verde); border-bottom-color: var(--verde); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* DRAG HANDLE */
.drag-handle { cursor: grab; color: var(--muted); }
.drag-handle:active { cursor: grabbing; }

/* MODAL */
.modal-bg { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 999; align-items: center; justify-content: center; }
.modal-bg.show { display: flex; }
.modal-box { background: var(--branco); border-radius: 14px; width: 100%; max-width: 480px; overflow: hidden; }
.modal-header { padding: 16px 20px; border-bottom: 1px solid var(--borda); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { font-size: 15px; font-weight: 600; }
.modal-body { padding: 20px; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--borda); display: flex; justify-content: flex-end; gap: 10px; }

/* SECTION TABS NAV */
.section-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.section-nav a {
    padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 500;
    background: var(--branco); border: 1px solid var(--borda); color: var(--muted);
    transition: all .2s;
}
.section-nav a:hover { border-color: var(--verde); color: var(--verde); }
.section-nav a.active { background: var(--verde); border-color: var(--verde); color: #fff; }

/* RESPONSIVE */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main { margin-left: 0; }
    .stats-row { grid-template-columns: repeat(2,1fr); }
    .form-row { grid-template-columns: 1fr; }
}
