/**
 * Estilos Principales del Sistema
 * Sistema de Gestión de Solicitudes de Recambios
 * Diseño Navy Blue - Mobile First
 */

/* ============================================
   Variables CSS
   ============================================ */

:root {
    /* Colores Corporativos - Deep Cerulean */
    --deep-cerulean: #007BA7;
    --deep-cerulean-dark: #005f85;
    --deep-cerulean-light: #00b0f0;
    --deep-cerulean-pale: #e6f7ff;

    /* Estados */
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --info: #3B82F6;
    --info-light: #DBEAFE;

    /* Neutrales */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Tipografía */
    --font-family: 'Aptos', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, monospace;

    /* Tamaños de fuente */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;

    /* Espaciado */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Bordes */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;

    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --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);

    /* Transiciones */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Reset y Base
   ============================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--gray-900);
    background: linear-gradient(180deg, var(--gray-50) 0%, var(--gray-100) 100%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   Tipografía
   ============================================ */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--gray-900);
}

h1 {
    font-size: var(--text-3xl);
}

h2 {
    font-size: var(--text-2xl);
}

h3 {
    font-size: var(--text-xl);
}

h4 {
    font-size: var(--text-lg);
}

h5 {
    font-size: var(--text-base);
}

h6 {
    font-size: var(--text-sm);
}

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--deep-cerulean);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--deep-cerulean-dark);
}

code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    background: var(--gray-100);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
}

/* ============================================
   Layout
   ============================================ */

.container {
    width: 100%;
    margin: 0 auto;
    padding: var(--spacing-md);
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
        padding: var(--spacing-lg);
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1280px) {
    .container {
        max-width: 1200px;
    }
}

/* Grid System */
.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Flexbox Utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.gap-sm {
    gap: var(--spacing-sm);
}

.gap-md {
    gap: var(--spacing-md);
}

.gap-lg {
    gap: var(--spacing-lg);
}

/* Visibility Utilities */
@media (max-width: 767px) {
    .hidden-mobile {
        display: none !important;
    }
}

/* ============================================
   Navegación Premium SGR
   ============================================ */

.navbar {
    background: #005f85;
    /* Fallback */
    background: linear-gradient(90deg, #005f85 0%, #007BA7 50%, #005f85 100%);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: white !important;
    text-decoration: none;
    letter-spacing: 0.05em;
}

/* SGR Toggle Button */
.sgr-toggle {
    display: none !important;
    /* Hidden on desktop */
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    padding: 0;
    cursor: pointer;
    width: 44px;
    height: 38px;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1002;
    outline: none;
}

.sgr-hamburger {
    display: block;
    width: 22px;
    height: 2px;
    background: white !important;
    position: relative;
    transition: all 0.3s;
}

.sgr-hamburger::before,
.sgr-hamburger::after {
    content: '' !important;
    position: absolute;
    width: 22px;
    height: 2px;
    background: white !important;
    left: 0;
    display: block !important;
    transition: all 0.3s;
}

.sgr-hamburger::before {
    top: -7px;
}

.sgr-hamburger::after {
    top: 7px;
}

.sgr-toggle.active .sgr-hamburger {
    background: transparent !important;
}

.sgr-toggle.active .sgr-hamburger::before {
    transform: rotate(45deg);
    top: 0;
}

.sgr-toggle.active .sgr-hamburger::after {
    transform: rotate(-45deg);
    top: 0;
}

/* User Profile & Avatar */
.sgr-avatar {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: all 0.2s;
    overflow: hidden;
    position: relative;
}

.sgr-avatar:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.05);
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-grow: 1;
    justify-content: space-between;
    margin-left: 2rem;
}

.navbar-links {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.nav-link {
    color: rgba(255, 255, 255, 0.95) !important;
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.15) !important;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: white;
}

/* Mobile Media Query */
@media (max-width: 768px) {
    .sgr-toggle {
        display: flex !important;
    }

    .navbar-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #005f85 !important;
        /* Dark solid color fallback */
        flex-direction: column;
        align-items: stretch;
        padding: 1.5rem;
        margin: 0;
        gap: 1rem;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 999;
    }

    .navbar-menu.active {
        display: flex !important;
        animation: sgrSlide 0.3s ease-out;
    }

    .navbar-links {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .nav-link {
        width: 100%;
        background: rgba(255, 255, 255, 0.05) !important;
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: white !important;
    }

    .navbar-user {
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        padding-top: 1.25rem;
        width: 100%;
        justify-content: flex-start;
        gap: 1rem;
    }
}

@keyframes sgrSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Contenido Principal
   ============================================ */

.main-content {
    min-height: calc(100vh - 120px);
    padding: var(--spacing-xl) 0;
}

.page-header {
    margin-bottom: var(--spacing-xl);
}

.page-header .flex {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-md);
}

@media (min-width: 768px) {
    .page-header .flex {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

.page-title {
    font-size: var(--text-2xl);
    color: var(--gray-900);
    margin-bottom: var(--spacing-xs);
}

@media (min-width: 768px) {
    .page-title {
        font-size: var(--text-3xl);
        margin-bottom: var(--spacing-sm);
    }
}

.page-subtitle {
    color: var(--gray-600);
    font-size: var(--text-lg);
}

/* ============================================
   Utilidades de Espaciado
   ============================================ */

.mt-sm {
    margin-top: var(--spacing-sm);
}

.mt-md {
    margin-top: var(--spacing-md);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mt-xl {
    margin-top: var(--spacing-xl);
}

.mb-sm {
    margin-bottom: var(--spacing-sm);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.mb-xl {
    margin-bottom: var(--spacing-xl);
}

.p-sm {
    padding: var(--spacing-sm);
}

.p-md {
    padding: var(--spacing-md);
}

.p-lg {
    padding: var(--spacing-lg);
}

.p-xl {
    padding: var(--spacing-xl);
}

/* ============================================
   Utilidades de Texto
   ============================================ */

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

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

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

.text-sm {
    font-size: var(--text-sm);
}

.text-base {
    font-size: var(--text-base);
}

.text-lg {
    font-size: var(--text-lg);
}

.text-xl {
    font-size: var(--text-xl);
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.text-gray {
    color: var(--gray-600);
}

.text-primary {
    color: var(--deep-cerulean);
}

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

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

.text-warning {
    color: var(--warning);
}

/* ============================================
   Utilidades Generales
   ============================================ */

.hidden {
    display: none !important;
}

.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}