/* assets/css/admin.css - Clone APEX Dashboard Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Apex Theme Pallete (Slate / Neutral Dark + Primary Emerald/Blueish) */
    --background: #09090b; /* zinc-950 */
    --foreground: #fafafa;
    
    --card: #18181b; /* zinc-900 */
    --card-foreground: #fafafa;
    
    --popover: #18181b;
    --popover-foreground: #fafafa;
    
    --primary: #10b981; /* Default Apex Emerald */
    --primary-foreground: #022c22;
    
    --secondary: #27272a; /* zinc-800 */
    --secondary-foreground: #fafafa;
    
    --muted: #27272a;
    --muted-foreground: #a1a1aa; /* zinc-400 */
    
    --accent: #27272a;
    --accent-foreground: #fafafa;
    
    --destructive: #ef4444; /* red-500 */
    --destructive-foreground: #fafafa;
    
    --border: #27272a;     /* zinc-800 */
    --input: #27272a;
    --ring: #10b981;

    --sidebar-bg: #18181b; /* zinc-900 */
    --sidebar-border: #27272a;
    --sidebar-foreground: #fafafa;
    --sidebar-accent: #27272a;

    --radius-lg: 0.75rem; /* 12px */
    --radius-md: 0.5rem;  /* 8px */
    --radius-sm: 0.25rem; /* 4px */
    
    --chart-1: #10b981;
    --chart-2: #3b82f6;
    --chart-3: #f43f5e;
    --chart-4: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--background);
    color: var(--foreground);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    display: flex;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* utilitários Typography */
.text-muted { color: var(--muted-foreground); }
.text-primary { color: var(--primary); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* ======== LAYOUT BASE: Sidebar Fixa ======== */
.apex-sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 260px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    height: 64px; /* h-16 */
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-bottom: 1px solid var(--sidebar-border);
}

.brand-icon {
    width: 32px; height: 32px;
    background-color: var(--primary);
    color: var(--primary-foreground);
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
}

.brand-text {
    display: flex; flex-direction: column;
}

.brand-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}

.brand-subtitle {
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--muted-foreground);
    margin-top: 2px;
}

/* Nav Links Menu */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 12px;
}

.nav-section { margin-bottom: 8px; }

.nav-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.3);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,0.7);
    transition: all 0.2s;
    margin-bottom: 2px;
}

.nav-link i { font-size: 16px; color: rgba(255,255,255,0.5); transition: color 0.2s; }

.nav-link:hover {
    background-color: rgba(255,255,255,0.05); /* hover:bg-sidebar-accent/50 */
    color: var(--sidebar-foreground);
}
.nav-link:hover i { color: rgba(255,255,255,0.8); }

.nav-link.active {
    background-color: var(--sidebar-accent);
    color: var(--primary);
}
.nav-link.active i { color: var(--primary); }

/* Perfil Botton */
.sidebar-profile {
    padding: 12px;
    border-top: 1px solid var(--sidebar-border);
    display: flex; align-items: center; gap: 8px;
}

.profile-card {
    flex: 1;
    display: flex; align-items: center; gap: 12px;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: background 0.2s;
    cursor: pointer;
}
.profile-card:hover { background-color: rgba(255,255,255,0.05); }

.profile-avatar {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, rgba(16,185,129,0.8), var(--primary));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: bold; color: var(--primary-foreground);
}

.btn-logout {
    border: none; background: transparent;
    color: rgba(255,255,255,0.4);
    cursor: pointer; padding: 6px; border-radius: var(--radius-sm);
    transition: all 0.2s;
}
.btn-logout:hover { background: var(--sidebar-accent); color: rgba(255,255,255,0.7); }

/* ======== MAIN CONTENT AREA ======== */
.apex-main {
    flex: 1;
    margin-left: 260px; /* Offset da sidebar fixa */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Topo */
.apex-header {
    height: 64px;
    background-color: rgba(9, 9, 11, 0.8); /* bg-background/80 */
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0; z-index: 30;
}

.header-search {
    position: relative;
    display: flex; align-items: center;
}
.header-search input {
    width: 280px;
    height: 36px;
    background-color: rgba(255,255,255,0.04);
    border: 1px solid var(--input);
    border-radius: var(--radius-md);
    padding: 0 16px 0 36px;
    color: var(--foreground);
    font-size: 14px;
    outline: none;
    transition: background 0.2s;
}
.header-search input:focus { border-color: var(--ring); }
.header-search i {
    position: absolute; left: 12px;
    color: rgba(255,255,255,0.3); font-size: 14px;
}

.header-actions {
    display: flex; align-items: center; gap: 8px;
}

.btn-icon {
    width: 32px; height: 32px;
    border-radius: var(--radius-md);
    border: none; background: transparent;
    color: var(--muted-foreground);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s;
}
.btn-icon:hover { background-color: var(--accent); color: var(--foreground); }

/* Corpo da Pagina */
.apex-content {
    padding: 24px;
    flex: 1;
}

.page-title {
    font-size: 24px; font-weight: 700;
    letter-spacing: -0.02em; margin-bottom: 4px;
}
.page-desc {
    font-size: 14px; color: var(--muted-foreground);
    margin-bottom: 24px;
}

/* ======== COMPONENTES APEX ======== */

/* Grids */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px; margin-bottom: 24px;
}

/* Cards Apex Style */
.apex-card {
    background-color: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* shadow-sm */
    transition: all 0.3s;
    overflow: hidden;
}
.apex-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-color: rgba(16, 185, 129, 0.2); /* hover:border-primary/20 */
}

.card-body { padding: 20px; }
.card-title {
    font-size: 12px; font-weight: 500; color: var(--muted-foreground);
    margin-bottom: 8px;
}
.card-value {
    font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.card-icon-box {
    width: 40px; height: 40px;
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    transition: transform 0.3s;
}
.apex-card:hover .card-icon-box { transform: scale(1.1); }

.bg-chart-1 { background-color: rgba(16,185,129,0.1); color: var(--chart-1); }
.bg-chart-2 { background-color: rgba(59,130,246,0.1); color: var(--chart-2); }
.bg-chart-3 { background-color: rgba(244,63,94,0.1); color: var(--chart-3); }
.bg-chart-4 { background-color: rgba(245,158,11,0.1); color: var(--chart-4); }

.text-success { color: var(--primary); }
.text-danger { color: var(--destructive); }

/* Tabelas Minimalistas (CRUD) */
.apex-table-wrap {
    width: 100%; overflow-x: auto;
}
.apex-table {
    width: 100%; border-collapse: collapse; text-align: left;
    font-size: 14px;
}
.apex-table th {
    padding: 12px 16px;
    color: var(--muted-foreground);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}
.apex-table td {
    padding: 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
    color: var(--card-foreground);
}
.apex-table tr:hover td { background-color: rgba(255,255,255,0.02); }

/* Badges e Botões MInimalistas */
.badge-apex {
    display: inline-flex; align-items: center;
    padding: 2px 10px; border-radius: 9999px;
    font-size: 12px; font-weight: 600;
}
.badge-primary { background-color: rgba(16,185,129,0.1); color: var(--primary); }

.btn-apex {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 0 16px; height: 36px;
    border-radius: var(--radius-md); font-size: 14px; font-weight: 500;
    transition: all 0.2s; border: none; cursor: pointer;
}
.btn-primary { background-color: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { opacity: 0.9; }
.btn-outline { background-color: transparent; border: 1px solid var(--border); color: var(--foreground); }
.btn-outline:hover { background-color: var(--accent); }
.btn-danger { background-color: var(--destructive); color: var(--destructive-foreground); }
.btn-danger-ghost { background-color: transparent; color: var(--destructive); }
.btn-danger-ghost:hover { background-color: rgba(239, 68, 68, 0.1); }

/* Botao Menu Mobile Toggle */
.mobile-toggle { display: none; }

/* Forms Apex (Inputs) */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; color: var(--foreground); }
.form-control {
    width: 100%; height: 40px; padding: 0 16px;
    background-color: var(--background);
    border: 1px solid var(--input); border-radius: var(--radius-md);
    color: var(--foreground); font-size: 14px; outline: none;
    transition: border-color 0.2s;
}
.form-control:focus { border-color: var(--ring); box-shadow: 0 0 0 2px rgba(16,185,129,0.2); }
textarea.form-control { height: auto; padding: 12px 16px; }

/* Responsividade Principal */
@media (max-width: 1024px) {
    .apex-sidebar { transform: translateX(-100%); }
    .apex-main { margin-left: 0; }
    .mobile-toggle { display: flex; }
    .header-search { display: none; } /* oculta barra busaca no mobiule */

    body.sidebar-open .apex-sidebar { transform: translateX(0); box-shadow: 10px 0 20px rgba(0,0,0,0.5); }
}
