/**
 * MEMORA SYSTEM - PRODUCTION ADMIN CSS
 * Consolidado a partir do Design System oficial (adm/design-system).
 */

:root {
    /* ================================================
       PALETA DE CORES OFICIAL MEMORA
       ================================================ */
    --color-primary: #303E54;
    /* Azul escuro */
    --color-caramel: #AE7C50;
    /* Caramel */
    --color-marrom: #8B5E3C;
    /* Marrom */
    --color-brown: #6B3B24;
    /* Brown escuro */

    /* Neutros */
    --color-white: #FFFFFF;
    --color-bg: #F3F2F0;
    /* Fundo principal */
    --color-bg-alt: #EAE8E4;
    /* Fundo alternativo (sidebar clara) */
    --color-off-white: #FCFBF9;
    /* Off-white admin */
    --color-sand: #D2C0A8;
    /* Areia - bordas */

    /* Texto */
    --color-text: #303E54;
    --color-text-muted: #6B7280;

    /* Status */
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-danger: #EF4444;

    /* Badges */
    --badge-active-bg: #D1FAE5;
    --badge-active-text: #065F46;
    --badge-pending-bg: #FEF3C7;
    --badge-pending-text: #92400E;
    --badge-archived-bg: #F3F4F6;
    --badge-archived-text: #1F2937;

    /* TIPOGRAFIA */
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

    /* Tamanhos (rem base 18px) */
    --text-xs: 0.625rem;
    --text-sm: 0.75rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;

    /* ESPACAMENTO */
    --spacing-unit: 8px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* RADIUS */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* SOMBRAS */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08);

    /* TRANSICOES */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    --transition-sidebar: width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), transform 0.3s ease-in-out;
}

/* Base Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 112.5%;
    max-width: 100%;
    overflow: hidden;
    height: 100%;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    display: flex;
    height: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
}

/* Main content wrapper */
body>main {
    margin-left: 60px;
    min-width: 0;
    max-width: 100%;
    height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    transition: margin-left 0.3s ease;
}

body>main.expanded {
    margin-left: 250px;
}

/* ================================================
   SIDEBAR (REFATORADA - PADRAO CLARO)
   ================================================ */
.admin-sidebar {
    width: 60px;
    min-width: 60px;
    background-color: var(--color-bg-alt);
    /* Tema Claro solicitado */
    color: var(--color-primary);
    border-right: 1px solid var(--color-sand);
    transition: var(--transition-sidebar);
    display: flex;
    flex-direction: column;
    padding: var(--spacing-sm);
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 20;
}

.admin-sidebar.expanded {
    width: 250px;
    min-width: 250px;
}

/* Logo compacta/expandida */
.sidebar-logo-expanded {
    display: none;
}

.admin-sidebar.expanded .sidebar-logo-compact {
    display: none;
}

.admin-sidebar.expanded .sidebar-logo-expanded {
    display: flex;
}

/* Labels e Textos */
.nav-label {
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: opacity 0.2s ease, max-width 0.3s ease;
    margin-left: 0;
    font-size: 13px;
    font-weight: 500;
}

.admin-sidebar.expanded .nav-label {
    opacity: 1;
    max-width: 160px;
    margin-left: 12px;
}

/* Links de Navegacao */
.nav-link {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    color: var(--color-primary);
    text-decoration: none;
    justify-content: center;
}

.admin-sidebar.expanded .nav-link {
    justify-content: flex-start;
}

.nav-link:hover {
    background-color: rgba(48, 62, 84, 0.05);
}

.nav-link.active {
    background-color: var(--color-primary);
    color: var(--color-white) !important;
    box-shadow: var(--shadow-sm);
}

/* Categorias */
.sidebar-category {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-primary);
    opacity: 1;
    margin: var(--spacing-lg) 0 var(--spacing-xs) var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-sidebar:not(.expanded) .sidebar-category span:not(:first-child),
.admin-sidebar:not(.expanded) .user-name {
    display: none !important;
}

.admin-sidebar:not(.expanded) .sidebar-category {
    justify-content: center;
    margin-left: 0;
}

/* Material Symbols Adjustments */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    font-size: 22px;
}

.nav-link.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 400;
}

/* ================================================
   OUTROS COMPONENTES (DESIGN SYSTEM)
   ================================================ */
.card {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-bg-alt);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    text-transform: uppercase;
    transition: all var(--transition-base);
    cursor: pointer;
}

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

/* Utilitarios */
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

[x-cloak] {
    display: none !important;
}