/* ============================================
   INFO ADMIN - Global CSS
   Design System com variáveis CSS
   ============================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Poppins:wght@500;600;700;800&display=swap');

/* ============================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================ */
:root {
    /* Primary Colors */
    --color-primary: #114368;
    --color-primary-dark: #0b2e49;
    --color-primary-light: #1c5b8a;
    --color-secondary: #2DB2E8;
    --color-secondary-light: #6bcbf2;
    --color-secondary-dark: #1a9ad4;

    /* Neutral Colors */
    --color-bg: #f3f4f6;
    --color-surface: #ffffff;
    --color-text-main: #1f2937;
    --color-text-light: #6b7280;
    --color-text-muted: #9ca3af;
    --color-border: #e5e7eb;
    --color-border-light: #f0f0f0;

    /* Semantic Colors */
    --color-success: #10b981;
    --color-success-light: #d1fae5;
    --color-danger: #ef4444;
    --color-danger-light: #fee2e2;
    --color-warning: #f59e0b;
    --color-warning-light: #fef3c7;
    --color-info: #3b82f6;
    --color-info-light: #dbeafe;

    /* Typography */
    --font-brand: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;

    /* Layout */
    --header-height: 70px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-text-main);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-bottom: 0.5em;
    font-weight: 700;
    color: var(--color-primary);
}

.font-brand {
    font-family: var(--font-brand);
}

/* ============================================
   LAYOUT
   ============================================ */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    height: var(--header-height);
    background: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 50;
    justify-content: space-between;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-brand);
    font-size: 1.5rem;
    color: var(--color-secondary);
    text-transform: uppercase;
}

.app-brand img {
    height: 40px;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    transition: color var(--transition-base);
    font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-secondary);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
}

.app-main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ============================================
   LAYOUT WITH SIDEBAR
   ============================================ */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 260px;
    background: var(--color-primary);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 60;
    transition: transform var(--transition-slow);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-logo svg {
    width: 22px;
    height: 22px;
    fill: white;
}

.sidebar-brand {
    font-family: var(--font-brand);
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.3px;
}

.sidebar-brand small {
    display: block;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0;
    margin-top: 1px;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.sidebar-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.35);
    padding: 1rem 1.5rem 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-base);
    text-decoration: none;
    position: relative;
    margin: 2px 0.75rem;
    border-radius: var(--radius-md);
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-link.active {
    background: rgba(45, 178, 232, 0.2);
    color: var(--color-secondary);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--color-secondary);
    border-radius: 0 3px 3px 0;
}

.sidebar-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    opacity: 0.8;
}

.sidebar-link:hover svg,
.sidebar-link.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-secondary), var(--color-secondary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    flex-shrink: 0;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-logout {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    transition: all var(--transition-base);
}

.sidebar-logout:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.app-content {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.content-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
}

.content-header-title {
    font-family: var(--font-brand);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text-main);
    margin-bottom: 0;
}

.content-header-subtitle {
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-top: 2px;
}

.content-body {
    flex: 1;
    padding: 2rem;
}

/* ============================================
   COMPONENTS - Cards
   ============================================ */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
}

/* ============================================
   COMPONENTS - Stats Cards
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-slow);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.blue {
    background: rgba(45, 178, 232, 0.12);
    color: var(--color-secondary);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.12);
    color: var(--color-success);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.12);
    color: var(--color-warning);
}

.stat-icon.purple {
    background: rgba(139, 92, 246, 0.12);
    color: #8b5cf6;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-text-main);
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-light);
    font-weight: 500;
    margin-top: 4px;
}

/* ============================================
   COMPONENTS - Welcome Section
   ============================================ */
.welcome-banner {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius: var(--radius-xl);
    padding: 2rem 2.5rem;
    color: white;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.welcome-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(45, 178, 232, 0.15);
    border-radius: 50%;
    pointer-events: none;
}

.welcome-banner h2 {
    font-family: var(--font-brand);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.welcome-banner p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    max-width: 500px;
}

/* ============================================
   COMPONENTS - Quick Actions
   ============================================ */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.quick-action-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.quick-action-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--color-secondary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.quick-action-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-secondary);
}

.quick-action-card:hover::before {
    transform: scaleX(1);
}

.quick-action-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    transition: transform 0.3s ease;
}

.quick-action-card:hover .quick-action-icon {
    transform: scale(1.1);
}

.quick-action-icon svg {
    width: 24px;
    height: 24px;
}

.quick-action-title {
    font-family: var(--font-brand);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: 0.25rem;
}

.quick-action-desc {
    font-size: 0.78rem;
    color: var(--color-text-light);
}

/* ============================================
   COMPONENTS - Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--transition-base);
    border: 1px solid transparent;
    cursor: pointer;
    font-family: var(--font-body);
}

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

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

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

.btn-secondary:hover {
    background: var(--color-secondary-dark);
}

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

.btn-outline:hover {
    background: rgba(17, 67, 104, 0.05);
}

/* ============================================
   UTILITIES
   ============================================ */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .app-header {
        padding: 0 1rem;
    }

    .app-main {
        padding: 1rem;
    }

    .nav-link {
        display: none;
    }

    .app-sidebar {
        transform: translateX(-100%);
    }

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

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

    .content-body {
        padding: 1rem;
    }

    .content-header {
        padding: 1rem;
    }
}