/* ========================================
   ZEREI ADMIN - MAIN STYLES
   Sidebar azul escura + Conteúdo branco
   ======================================== */

/* Reset e configurações base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores principais - Azul escuro */
    --sidebar-bg: #1e3a5f;
    --sidebar-hover: #2d4a6f;
    --sidebar-active: #3a5a7f;
    --sidebar-text: #ffffff;
    --sidebar-text-muted: #a8c5e0;

    /* Cores de conteúdo - Branco/Neutro */
    --content-bg: #ffffff;
    --content-secondary: #f8f9fa;
    --content-border: #e0e6ed;

    /* Cores de texto */
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;

    /* Cores de ação */
    --primary: #1e3a5f;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;

    /* Espaçamentos */
    --sidebar-width: 260px;
    --header-height: 64px;

    /* Sombras */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: var(--content-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========================================
   LAYOUT PRINCIPAL
   ======================================== */

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   SIDEBAR
   ======================================== */

.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* Logo da sidebar */
.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--sidebar-text);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.sidebar-logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Menu da sidebar */
.sidebar-menu {
    padding: 20px 0;
}

.menu-section {
    margin-bottom: 24px;
}

.menu-section-title {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sidebar-text-muted);
    margin-bottom: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: var(--sidebar-hover);
    border-left-color: rgba(255, 255, 255, 0.3);
}

.menu-item.active {
    background: var(--sidebar-active);
    border-left-color: var(--sidebar-text);
    font-weight: 600;
}

.menu-item-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.menu-item-text {
    flex: 1;
    font-size: 14px;
}

.menu-item-badge {
    padding: 2px 8px;
    background: var(--danger);
    color: white;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

/* Footer da sidebar */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--sidebar-active);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
}

.sidebar-user-info {
    flex: 1;
}

.sidebar-user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--sidebar-text);
    display: block;
    margin-bottom: 2px;
}

.sidebar-user-role {
    font-size: 12px;
    color: var(--sidebar-text-muted);
}

/* ========================================
   CONTEÚDO PRINCIPAL
   ======================================== */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: var(--content-secondary);
}

/* Header do conteúdo */
.content-header {
    background: var(--content-bg);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.content-header-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

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

/* Área de conteúdo */
.content-body {
    padding: 32px;
}

/* Cards */
.card {
    background: var(--content-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--content-border);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.card-body {
    color: var(--text-secondary);
}

/* Grid de cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* Stat Cards */
.stat-card {
    background: var(--content-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
}

.stat-card-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.stat-card-change {
    font-size: 13px;
    font-weight: 600;
}

.stat-card-change.positive {
    color: var(--success);
}

.stat-card-change.negative {
    color: var(--danger);
}

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #2d4a6f;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--content-border);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: var(--content-secondary);
}

/* Tabelas */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--content-bg);
    border-radius: 8px;
    overflow: hidden;
}

thead {
    background: var(--content-secondary);
}

th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

td {
    padding: 16px;
    border-top: 1px solid var(--content-border);
    color: var(--text-primary);
}

tr:hover {
    background: var(--content-secondary);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(255, 193, 7, 0.1);
    color: #d39e00;
}

.badge-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger);
}

.badge-info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info);
}

/* Responsivo */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content-body {
        padding: 16px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }
}

/* Loading */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--content-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Utilitários */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mt-24 { margin-top: 24px; }
