/*
 * This is a manifest file that'll be compiled into application.css, which will include all the files
 * listed below.
 *


 */

@import "styles";
/* ============================================
   ODONT ID - SISTEMA DE GESTIÓN
   Admin Panel CSS - Diseño Profesional Consolidado
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    /* Brand Colors */
    --color-primary: #1e4a7e;
    --color-primary-dark: #15355c;
    --color-primary-light: #2d6a9f;
    --color-accent: #4a9fd4;
    
    /* Neutral Colors */
    --color-white: #ffffff;
    --color-gray-50: #f8fafc;
    --color-gray-100: #f1f5f9;
    --color-gray-200: #e2e8f0;
    --color-gray-300: #cbd5e1;
    --color-gray-400: #94a3b8;
    --color-gray-500: #64748b;
    --color-gray-600: #475569;
    --color-gray-700: #334155;
    --color-gray-800: #1e293b;
    --color-gray-900: #0f172a;

    /* Semantic Colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    
    /* Typography */
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-heading: 'Outfit', sans-serif;

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-sans); background-color: var(--color-gray-50); color: var(--color-gray-800); line-height: 1.5; }
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--color-gray-900); }
a { color: inherit; text-decoration: none; }

/* Main Layout Structure */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-white);
    border-right: 1px solid var(--color-gray-200);
    display: flex;
    flex-direction: column;
    position: fixed; /* Fixed globally */
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--color-gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo { display: flex; align-items: center; gap: 0.75rem; font-family: var(--font-heading); font-weight: 700; color: var(--color-primary); font-size: 1.25rem; }
.sidebar-nav { flex: 1; padding: 1rem; overflow-y: auto; }
.nav-section { margin-bottom: 1.5rem; }
.nav-section-title { font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; color: var(--color-gray-400); margin-bottom: 0.5rem; padding-left: 0.5rem; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--color-gray-600);
    font-weight: 500;
    margin-bottom: 2px;
    transition: 0.2s;
}
.nav-item:hover { background: var(--color-gray-100); color: var(--color-primary); }
.nav-item.active { background: var(--color-primary); color: var(--color-white); }

.sidebar-footer { padding: 1rem; border-top: 1px solid var(--color-gray-100); }
.user-card { display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem; background: var(--color-gray-50); border-radius: var(--radius-lg); }
.user-avatar { width: 32px; height: 32px; background: var(--color-primary); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.8125rem; }

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width); /* Default for desktop */
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Header */
.top-header {
    height: var(--header-height);
    background: var(--color-white);
    border-bottom: 1px solid var(--color-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left, .header-right { display: flex; align-items: center; gap: 1rem; }
.header-title { font-size: 1.125rem; margin: 0; }

/* Page Content */
.page-content { padding: 1.25rem; }

/* Card Component */
.card { background: var(--color-white); border-radius: var(--radius-lg); border: 1px solid var(--color-gray-200); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 1.25rem; }
.card-header { padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--color-gray-100); display: flex; align-items: center; justify-content: space-between; }
.card-body { padding: 1.25rem; }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.25rem; }
.stat-card { background: white; padding: 1rem; border-radius: var(--radius-lg); border: 1px solid var(--color-gray-200); box-shadow: var(--shadow-sm); }
.stat-header { display: flex; justify-content: space-between; margin-bottom: 0.25rem; }
.stat-label { font-size: 0.75rem; color: var(--color-gray-500); font-weight: 500; }
.stat-icon { width: 36px; height: 36px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; }
.stat-icon svg { width: 18px; height: 18px; }
.stat-icon.primary { background: rgba(30, 74, 126, 0.1); color: var(--color-primary); }
.stat-icon.success { background: rgba(16, 185, 129, 0.1); color: var(--color-success); }
.stat-icon.warning { background: rgba(245, 158, 11, 0.1); color: var(--color-warning); }
.stat-icon.danger { background: rgba(239, 68, 68, 0.1); color: var(--color-danger); }
.stat-value { font-size: 1.375rem; font-weight: 700; color: var(--color-gray-900); }

/* Dashboard Content Grid - TWO COLUMNS */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.25rem;
    align-items: start;
}

/* Data Tables */
.table-container { overflow-x: auto; width: 100%; border-radius: var(--radius-md); }
.data-table { width: 100%; border-collapse: collapse; background: white; }
.data-table th { text-align: left; padding: 0.75rem 1rem; background: var(--color-gray-50); color: var(--color-gray-500); font-weight: 600; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--color-gray-200); }
.data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--color-gray-100); vertical-align: middle; font-size: 0.875rem; }

/* Compact Table for Dashboard */
.data-table-compact th {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.625rem !important;
}

.data-table-compact td {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.8125rem !important;
}

/* Actions */
.actions-cell { display: flex; gap: 0.5rem; align-items: center; justify-content: flex-end; }
.btn-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); transition: 0.2s; color: var(--color-gray-500); border: none; background: transparent; cursor: pointer; }
.btn-icon:hover { background: var(--color-gray-100); color: var(--color-primary); }
.btn-icon.danger:hover { background: #fee2e2; color: var(--color-danger); }
.btn-icon svg { width: 18px; height: 18px; }

/* Badges */
.badge { padding: 0.25rem 0.75rem; border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 600; display: inline-block; }
.badge-pending { background: rgba(245, 158, 11, 0.1); color: var(--color-warning); }
.badge-confirmed { background: rgba(16, 185, 129, 0.1); color: var(--color-success); }
.badge-in_progress { background: rgba(59, 130, 246, 0.1); color: var(--color-info); }
.badge-completed { background: rgba(100, 116, 139, 0.1); color: var(--color-gray-500); }
.badge-cancelled { background: rgba(239, 68, 68, 0.1); color: var(--color-danger); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--color-gray-700); margin-bottom: 0.25rem; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 0.625rem 0.875rem; border-radius: var(--radius-md); border: 1px solid var(--color-gray-300); font-size: 0.9375rem; }
.form-input:focus, .form-select:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(30, 74, 126, 0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Search Box - FIXED STYLE */
.search-filters { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.search-box {
    position: relative;
    flex: 1 !important;
    display: flex;
    align-items: center;
}
.search-box form {
    flex: 1;
    display: flex;
    width: 100%;
}
.search-box svg { 
    position: absolute; 
    left: 0.875rem; 
    width: 16px !important; 
    height: 16px !important; 
    color: var(--color-gray-400); 
    pointer-events: none;
    z-index: 5;
}
.search-box input {
    width: 100% !important;
    padding: 0.625rem 1rem 0.625rem 2.5rem !important;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-gray-300);
    font-size: 0.875rem;
}

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 1rem; border-radius: var(--radius-md); font-weight: 600; font-size: 0.875rem; cursor: pointer; transition: 0.2s; border: 1px solid transparent; }
.btn-primary { background: var(--color-primary); color: white; }
.btn-secondary { background: white; color: var(--color-gray-700); border-color: var(--color-gray-300); }

/* Toggle Buttons */
.view-toggle { display: flex; background: var(--color-gray-100); padding: 0.2rem; border-radius: var(--radius-md); gap: 0.2rem; }
.btn-toggle { padding: 0.3rem 0.875rem; border-radius: var(--radius-md); font-size: 0.75rem; font-weight: 600; color: var(--color-gray-600); border: none; background: transparent; cursor: pointer; }
.btn-toggle.active { background: white; color: var(--color-primary); box-shadow: var(--shadow-sm); }

/* Mobile Navigation Bar */
.mobile-nav-bar {
    position: fixed; top: 0; left: 0; right: 0; height: var(--header-height);
    background: white; border-bottom: 1px solid var(--color-gray-200);
    padding: 0 1rem; display: none; align-items: center; justify-content: space-between; z-index: 1100;
}
.mobile-toggle-btn { background: none; border: none; cursor: pointer; color: var(--color-gray-600); display: flex; align-items: center; }
.mobile-logo { font-family: var(--font-heading); font-weight: 700; color: var(--color-primary); font-size: 1.125rem; }

.sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 900; opacity: 0; pointer-events: none; transition: 0.3s; }
.sidebar-overlay.active { opacity: 1; pointer-events: auto; }

/* RESPONSIVE QUERIES - ONLY MOBILE REFINEMENTS */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    /* Sidebar as a fixed overlay */
    .sidebar { 
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        transform: translateX(-100%); 
        width: 280px;
        z-index: 2000; /* Higher z-index for mobile menu */
        transition: transform 0.3s ease;
    }
    
    .sidebar.open { 
        transform: translateX(0); 
        box-shadow: 10px 0 30px rgba(0,0,0,0.2); 
    }

    /* Reset main content for mobile */
    .main-content { 
        margin-left: 0 !important;
        width: 100% !important;
        padding-top: var(--header-height); 
    }

    /* Balanced padding for mobile */
    .page-content { 
        padding: 1rem !important; 
    }

    /* Mobile Header */
    .mobile-nav-bar { 
        display: flex; 
        box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    }

    .top-header { 
        display: none !important; 
    }

    /* Grid Adjustments */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 0.75rem;
    }

    .stat-value {
        font-size: 1.125rem;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Form & Search */
    .form-row { grid-template-columns: 1fr; }
    .search-filters { flex-direction: column; align-items: stretch; gap: 0.75rem; }
    .search-box { max-width: 100%; }

    /* Table Actions - More space for touch */
    .actions-cell {
        justify-content: flex-start;
        padding: 0.5rem 0;
    }
}

@media (max-width: 480px) {
    .stats-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.625rem;
    }

    .stat-label {
        font-size: 0.6875rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    .sidebar {
        width: 85%; /* Almost full screen on very small devices */
    }

    .mobile-logo {
        font-size: 1rem;
    }
}
