﻿/* ===================================
   LEOCOSTA DESIGN SYSTEM
   ================================== */

:root {
    /* === CORES PRINCIPAIS === */
    --lc-primary: #1a365d;
    --lc-primary-light: #2d5985;
    --lc-primary-dark: #0f2d4a;
    --lc-primary-alpha: rgba(26, 54, 93, 0.1);
    --lc-secondary: #e53e3e;
    --lc-secondary-light: #fc8181;
    --lc-secondary-dark: #c53030;
    --lc-success: #38a169;
    --lc-success-light: #68d391;
    --lc-success-dark: #2f855a;
    --lc-warning: #d69e2e;
    --lc-warning-light: #f6e05e;
    --lc-warning-dark: #b7791f;
    --lc-error: #e53e3e;
    --lc-error-light: #fc8181;
    --lc-error-dark: #c53030;
    /* === CORES NEUTRAS === */
    --lc-white: #ffffff;
    --lc-gray-50: #f7fafc;
    --lc-gray-100: #edf2f7;
    --lc-gray-200: #e2e8f0;
    --lc-gray-300: #cbd5e0;
    --lc-gray-400: #a0aec0;
    --lc-gray-500: #718096;
    --lc-gray-600: #4a5568;
    --lc-gray-700: #2d3748;
    --lc-gray-800: #1a202c;
    --lc-gray-900: #171923;
    /* === TIPOGRAFIA === */
    --lc-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --lc-font-mono: 'JetBrains Mono', 'Fira Code', Consolas, 'Liberation Mono', Menlo, Monaco, monospace;
    --lc-font-size-xs: 0.75rem; /* 12px */
    --lc-font-size-sm: 0.875rem; /* 14px */
    --lc-font-size-base: 1rem; /* 16px */
    --lc-font-size-lg: 1.125rem; /* 18px */
    --lc-font-size-xl: 1.25rem; /* 20px */
    --lc-font-size-2xl: 1.5rem; /* 24px */
    --lc-font-size-3xl: 1.875rem; /* 30px */
    --lc-font-size-4xl: 2.25rem; /* 36px */
    /* === SPACING === */
    --lc-space-0: 0;
    --lc-space-px: 1px;
    --lc-space-0-5: 0.125rem; /* 2px */
    --lc-space-1: 0.25rem; /* 4px */
    --lc-space-1-5: 0.375rem; /* 6px */
    --lc-space-2: 0.5rem; /* 8px */
    --lc-space-2-5: 0.625rem; /* 10px */
    --lc-space-3: 0.75rem; /* 12px */
    --lc-space-3-5: 0.875rem; /* 14px */
    --lc-space-4: 1rem; /* 16px */
    --lc-space-5: 1.25rem; /* 20px */
    --lc-space-6: 1.5rem; /* 24px */
    --lc-space-8: 2rem; /* 32px */
    --lc-space-10: 2.5rem; /* 40px */
    --lc-space-12: 3rem; /* 48px */
    --lc-space-16: 4rem; /* 64px */
    --lc-space-20: 5rem; /* 80px */
    /* === SHADOWS === */
    --lc-shadow-xs: 0 0 0 1px rgba(0, 0, 0, 0.05);
    --lc-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --lc-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --lc-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --lc-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --lc-shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    /* === BORDER RADIUS === */
    --lc-radius-none: 0;
    --lc-radius-sm: 0.125rem; /* 2px */
    --lc-radius-base: 0.25rem; /* 4px */
    --lc-radius-md: 0.375rem; /* 6px */
    --lc-radius-lg: 0.5rem; /* 8px */
    --lc-radius-xl: 0.75rem; /* 12px */
    --lc-radius-2xl: 1rem; /* 16px */
    --lc-radius-full: 9999px;
    /* === LAYOUT === */
    --lc-sidebar-width: 280px;
    --lc-sidebar-collapsed-width: 64px;
    --lc-topbar-height: 64px;
    --lc-container-max-width: 1200px;
    /* === TRANSIÇÕES === */
    --lc-transition-fast: 150ms ease;
    --lc-transition-base: 250ms ease;
    --lc-transition-slow: 350ms ease;
    /* === Z-INDEX === */
    --lc-z-dropdown: 1000;
    --lc-z-sticky: 1020;
    --lc-z-fixed: 1030;
    --lc-z-modal-backdrop: 1040;
    --lc-z-modal: 1050;
    --lc-z-popover: 1060;
    --lc-z-tooltip: 1070;
}

/* === RESET BÁSICO === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--lc-font-family);
    line-height: 1.6;
    color: var(--lc-gray-800);
    background-color: var(--lc-gray-50);
    font-size: var(--lc-font-size-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === LAYOUT PRINCIPAL === */
.leocosta-app {
    display: flex;
    min-height: 100vh;
    background-color: var(--lc-gray-50);
}

/* === SIDEBAR === */
.leocosta-sidebar {
    width: var(--lc-sidebar-width);
    background: linear-gradient(135deg, var(--lc-primary) 0%, var(--lc-primary-dark) 100%);
    color: var(--lc-white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: var(--lc-z-fixed);
    box-shadow: var(--lc-shadow-lg);
    transition: transform var(--lc-transition-base), width var(--lc-transition-base);
    overflow: hidden;
}

    .leocosta-sidebar.collapsed {
        width: var(--lc-sidebar-collapsed-width);
    }

/* === MAIN CONTENT === */
.leocosta-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--lc-transition-base);
    min-height: 100vh;
}

    .leocosta-main.with-sidebar {
        margin-left: var(--lc-sidebar-width);
    }

    .leocosta-main.sidebar-collapsed {
        margin-left: var(--lc-sidebar-collapsed-width);
    }

    .leocosta-main.full-width {
        margin-left: 0;
    }

/* === TOPBAR === */
.leocosta-topbar {
    height: var(--lc-topbar-height);
    background: var(--lc-white);
    border-bottom: 1px solid var(--lc-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--lc-space-6);
    box-shadow: var(--lc-shadow-sm);
    position: sticky;
    top: 0;
    z-index: var(--lc-z-sticky);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: var(--lc-space-4);
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--lc-space-2);
    border-radius: var(--lc-radius-md);
    color: var(--lc-gray-600);
    transition: all var(--lc-transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

    .sidebar-toggle:hover {
        background-color: var(--lc-gray-100);
        color: var(--lc-primary);
    }

.page-title {
    font-size: var(--lc-font-size-xl);
    font-weight: 600;
    color: var(--lc-gray-800);
    margin: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: var(--lc-space-4);
}

/* === USER MENU === */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--lc-space-3);
    cursor: pointer;
    padding: var(--lc-space-2);
    border-radius: var(--lc-radius-lg);
    transition: background-color var(--lc-transition-fast);
}

    .user-menu:hover {
        background-color: var(--lc-gray-100);
    }

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--lc-radius-full);
    object-fit: cover;
    border: 2px solid var(--lc-gray-200);
}

.user-name {
    font-weight: 500;
    color: var(--lc-gray-700);
    font-size: var(--lc-font-size-sm);
}

.dropdown-icon {
    color: var(--lc-gray-500);
    transition: transform var(--lc-transition-fast);
    width: 16px;
    height: 16px;
}

.user-menu:hover .dropdown-icon {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--lc-white);
    border: 1px solid var(--lc-gray-200);
    border-radius: var(--lc-radius-lg);
    box-shadow: var(--lc-shadow-lg);
    min-width: 200px;
    padding: var(--lc-space-2);
    margin-top: var(--lc-space-2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--lc-transition-fast);
    z-index: var(--lc-z-dropdown);
}

    .user-dropdown.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--lc-space-3);
    padding: var(--lc-space-3);
    border-radius: var(--lc-radius-md);
    color: var(--lc-gray-700);
    text-decoration: none;
    font-size: var(--lc-font-size-sm);
    transition: all var(--lc-transition-fast);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

    .dropdown-item:hover {
        background-color: var(--lc-gray-100);
        color: var(--lc-gray-900);
    }

    .dropdown-item.logout {
        color: var(--lc-error);
    }

        .dropdown-item.logout:hover {
            background-color: var(--lc-error);
            color: var(--lc-white);
        }

.dropdown-divider {
    height: 1px;
    background-color: var(--lc-gray-200);
    margin: var(--lc-space-2) 0;
}

/* === CONTENT === */
.leocosta-content {
    flex: 1;
    overflow-y: auto;
    background-color: var(--lc-gray-50);
}

.content-wrapper {
    padding: var(--lc-space-8);
    max-width: var(--lc-container-max-width);
    margin: 0 auto;
    width: 100%;
}

/* === NAVEGAÇÃO LATERAL === */
.leocosta-nav {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--lc-space-6);
}

.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--lc-space-8);
    padding-bottom: var(--lc-space-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--lc-space-3);
}

.brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.brand-text {
    font-size: var(--lc-font-size-xl);
    font-weight: 700;
    color: var(--lc-white);
}

.nav-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: var(--lc-space-1);
    border-radius: var(--lc-radius-md);
    transition: all var(--lc-transition-fast);
    display: none;
}

    .nav-close:hover {
        color: var(--lc-white);
        background-color: rgba(255, 255, 255, 0.1);
    }

.nav-content {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

    .nav-content::-webkit-scrollbar {
        width: 6px;
    }

    .nav-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .nav-content::-webkit-scrollbar-thumb {
        background-color: rgba(255, 255, 255, 0.3);
        border-radius: var(--lc-radius-full);
    }

.nav-section {
    margin-bottom: var(--lc-space-8);
}

.nav-section-title {
    font-size: var(--lc-font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: var(--lc-space-4);
    padding-left: var(--lc-space-4);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--lc-space-3);
    padding: var(--lc-space-3) var(--lc-space-4);
    border-radius: var(--lc-radius-lg);
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all var(--lc-transition-fast);
    margin-bottom: var(--lc-space-1);
    font-weight: 500;
    font-size: var(--lc-font-size-sm);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

    .nav-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
        color: var(--lc-white);
        transform: translateX(4px);
    }

    .nav-item.active {
        background-color: rgba(255, 255, 255, 0.15);
        color: var(--lc-white);
        box-shadow: var(--lc-shadow-md);
        font-weight: 600;
    }

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 2;
}

.nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-badge {
    background-color: var(--lc-secondary);
    color: var(--lc-white);
    font-size: var(--lc-font-size-xs);
    font-weight: 600;
    padding: var(--lc-space-0-5) var(--lc-space-2);
    border-radius: var(--lc-radius-full);
    min-width: 20px;
    text-align: center;
    line-height: 1;
}

    .nav-badge.urgent {
        background-color: var(--lc-error);
        animation: pulse 2s infinite;
    }

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

/* === FOOTER DA NAVEGAÇÃO === */
.nav-footer {
    margin-top: auto;
    padding-top: var(--lc-space-6);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-toggle {
    margin-bottom: var(--lc-space-4);
}

.toggle-switch {
    width: 44px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: var(--lc-radius-full);
    position: relative;
    transition: background-color var(--lc-transition-base);
    cursor: pointer;
}

    .toggle-switch.active {
        background-color: var(--lc-secondary);
    }

.toggle-thumb {
    width: 20px;
    height: 20px;
    background-color: var(--lc-white);
    border-radius: var(--lc-radius-full);
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform var(--lc-transition-base);
    box-shadow: var(--lc-shadow-sm);
}

.toggle-switch.active .toggle-thumb {
    transform: translateX(20px);
}

.nav-version {
    text-align: center;
    padding-top: var(--lc-space-2);
}

.version-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--lc-font-size-xs);
}

/* === FORMULÁRIOS === */
.form-group {
    margin-bottom: var(--lc-space-6);
}

.form-label {
    display: flex;
    align-items: center;
    gap: var(--lc-space-2);
    font-weight: 500;
    color: var(--lc-gray-700);
    margin-bottom: var(--lc-space-2);
    font-size: var(--lc-font-size-sm);
}

.form-control {
    width: 100%;
    padding: var(--lc-space-3) var(--lc-space-4);
    border: 1px solid var(--lc-gray-300);
    border-radius: var(--lc-radius-lg);
    font-size: var(--lc-font-size-base);
    font-family: var(--lc-font-family);
    transition: all var(--lc-transition-fast);
    background-color: var(--lc-white);
    color: var(--lc-gray-800);
}

    .form-control:focus {
        outline: none;
        border-color: var(--lc-primary);
        box-shadow: 0 0 0 3px var(--lc-primary-alpha);
    }

    .form-control::placeholder {
        color: var(--lc-gray-400);
    }

    .form-control:disabled {
        background-color: var(--lc-gray-100);
        color: var(--lc-gray-500);
        cursor: not-allowed;
    }

/* === BOTÕES === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--lc-space-2);
    padding: var(--lc-space-3) var(--lc-space-6);
    border: none;
    border-radius: var(--lc-radius-lg);
    font-weight: 500;
    font-size: var(--lc-font-size-sm);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--lc-transition-fast);
    text-align: center;
    white-space: nowrap;
    user-select: none;
    line-height: 1.5;
}

    .btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        pointer-events: none;
    }

.btn-primary {
    background-color: var(--lc-primary);
    color: var(--lc-white);
    box-shadow: var(--lc-shadow-sm);
}

    .btn-primary:hover:not(:disabled) {
        background-color: var(--lc-primary-light);
        transform: translateY(-1px);
        box-shadow: var(--lc-shadow-md);
    }

.btn-secondary {
    background-color: var(--lc-gray-200);
    color: var(--lc-gray-700);
}

    .btn-secondary:hover:not(:disabled) {
        background-color: var(--lc-gray-300);
        color: var(--lc-gray-800);
    }

.btn-success {
    background-color: var(--lc-success);
    color: var(--lc-white);
}

    .btn-success:hover:not(:disabled) {
        background-color: var(--lc-success-dark);
    }

.btn-danger {
    background-color: var(--lc-error);
    color: var(--lc-white);
}

    .btn-danger:hover:not(:disabled) {
        background-color: var(--lc-error-dark);
    }

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--lc-primary);
    color: var(--lc-primary);
}

    .btn-outline:hover:not(:disabled) {
        background-color: var(--lc-primary);
        color: var(--lc-white);
    }

/* === ALERTS === */
.alert {
    padding: var(--lc-space-4);
    border-radius: var(--lc-radius-lg);
    margin-bottom: var(--lc-space-6);
    display: flex;
    align-items: flex-start;
    gap: var(--lc-space-3);
    border: 1px solid;
}

.alert-success {
    background-color: var(--lc-success-light);
    border-color: var(--lc-success);
    color: var(--lc-success-dark);
}

.alert-error {
    background-color: #fef2f2;
    border-color: var(--lc-error-light);
    color: var(--lc-error-dark);
}

.alert-warning {
    background-color: #fffbeb;
    border-color: var(--lc-warning-light);
    color: var(--lc-warning-dark);
}

.alert-info {
    background-color: #eff6ff;
    border-color: var(--lc-primary-light);
    color: var(--lc-primary-dark);
}

/* === VALIDAÇÃO === */
.field-validation-error {
    color: var(--lc-error);
    font-size: var(--lc-font-size-xs);
    margin-top: var(--lc-space-1);
    display: block;
}

.validation-summary {
    background-color: #fef2f2;
    border: 1px solid var(--lc-error-light);
    color: var(--lc-error-dark);
    padding: var(--lc-space-4);
    border-radius: var(--lc-radius-lg);
    margin-bottom: var(--lc-space-6);
}

/* === SPINNER === */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: var(--lc-radius-full);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .content-wrapper {
        padding: var(--lc-space-6);
    }
}

@media (max-width: 768px) {
    .leocosta-sidebar {
        transform: translateX(-100%);
        width: var(--lc-sidebar-width);
    }

        .leocosta-sidebar.open {
            transform: translateX(0);
        }

    .leocosta-main {
        margin-left: 0 !important;
    }

    .content-wrapper {
        padding: var(--lc-space-4);
    }

    .topbar-left .page-title {
        font-size: var(--lc-font-size-lg);
    }

    .nav-close {
        display: block;
    }

    .user-menu .user-name {
        display: none;
    }
}

@media (max-width: 480px) {
    .leocosta-topbar {
        padding: 0 var(--lc-space-4);
    }

    .content-wrapper {
        padding: var(--lc-space-3);
    }

    .btn {
        padding: var(--lc-space-2-5) var(--lc-space-4);
        font-size: var(--lc-font-size-xs);
    }
}

/* === UTILITÁRIOS === */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.text-xs {
    font-size: var(--lc-font-size-xs);
}

.text-sm {
    font-size: var(--lc-font-size-sm);
}

.text-base {
    font-size: var(--lc-font-size-base);
}

.text-lg {
    font-size: var(--lc-font-size-lg);
}

.text-xl {
    font-size: var(--lc-font-size-xl);
}

.text-2xl {
    font-size: var(--lc-font-size-2xl);
}

.m-0 {
    margin: 0;
}

.mt-1 {
    margin-top: var(--lc-space-1);
}

.mt-2 {
    margin-top: var(--lc-space-2);
}

.mt-3 {
    margin-top: var(--lc-space-3);
}

.mt-4 {
    margin-top: var(--lc-space-4);
}

.mb-1 {
    margin-bottom: var(--lc-space-1);
}

.mb-2 {
    margin-bottom: var(--lc-space-2);
}

.mb-3 {
    margin-bottom: var(--lc-space-3);
}

.mb-4 {
    margin-bottom: var(--lc-space-4);
}

.mb-6 {
    margin-bottom: var(--lc-space-6);
}

.p-0 {
    padding: 0;
}

.p-2 {
    padding: var(--lc-space-2);
}

.p-4 {
    padding: var(--lc-space-4);
}

.p-6 {
    padding: var(--lc-space-6);
}

.hidden {
    display: none;
}

.block {
    display: block;
}

.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.opacity-50 {
    opacity: 0.5;
}

.opacity-75 {
    opacity: 0.75;
}

/* === TEMA ESCURO (preparação futura) === */
[data-theme="dark"] {
    --lc-gray-50: #1a202c;
    --lc-gray-100: #2d3748;
    --lc-gray-200: #4a5568;
    --lc-gray-800: #f7fafc;
    --lc-gray-900: #ffffff;
}

/* === PRINT STYLES === */
@media print {
    .leocosta-sidebar,
    .leocosta-topbar,
    .nav-footer {
        display: none;
    }

    .leocosta-main {
        margin-left: 0 !important;
    }

    .content-wrapper {
        padding: 0;
        max-width: none;
    }
}
