/* Athena - Gestion de Personal y Asistencia | PharMiVet */

:root {
    --sidebar-width: 250px;
    --sidebar-bg: #ffffff;
    --sidebar-border: #e8ecf1;
    --sidebar-text: #4a5568;
    --sidebar-heading: #1a202c;
    --sidebar-section: #a0aec0;
    --sidebar-hover: #f0f4ff;
    --sidebar-active-bg: #ebf2ff;
    --sidebar-active-text: #3b6ce7;
    --sidebar-active-border: #3b6ce7;
    --primary: #3b6ce7;
    --primary-light: #ebf2ff;
    --primary-dark: #2b52b4;
    --accent: #6c5ce7;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --body-bg: #f5f7fb;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 4px 12px rgba(59, 108, 231, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}

body {
    background-color: var(--body-bg);
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #374151;
}

/* ═══════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════ */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    transition: all 0.3s ease;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar-header {
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-header h5 {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
}

.sidebar-header small {
    color: var(--sidebar-section) !important;
    font-size: 0.75rem;
}

.sidebar .nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sidebar-section);
    padding: 0.5rem 1rem 0.25rem;
    margin-top: 0.25rem;
}

.sidebar .sidebar-divider {
    border-color: var(--sidebar-border);
    margin: 0.5rem 0.75rem;
    opacity: 0.6;
}

.sidebar .nav-link {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin: 1px 0.5rem;
    font-size: 0.875rem;
    color: var(--sidebar-text);
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.sidebar .nav-link i {
    font-size: 1rem;
    width: 1.25rem;
    text-align: center;
    opacity: 0.7;
}

.sidebar .nav-link:hover {
    background-color: var(--sidebar-hover);
    color: var(--primary);
}

.sidebar .nav-link:hover i {
    opacity: 1;
}

.sidebar .nav-link.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
    border-left-color: var(--sidebar-active-border);
}

.sidebar .nav-link.active i {
    opacity: 1;
    color: var(--sidebar-active-text);
}

/* ═══════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════ */
.top-navbar {
    background: #ffffff;
    border-bottom: 1px solid var(--sidebar-border);
    padding: 0.5rem 1.5rem;
}

.top-navbar .btn-outline-secondary {
    border-color: #e2e8f0;
    color: #718096;
}

.top-navbar .btn-outline-secondary:hover {
    background: #f7fafc;
    color: #4a5568;
}

/* ═══════════════════════════════════════
   PAGE CONTENT
   ═══════════════════════════════════════ */
#page-content-wrapper {
    min-width: 0;
    overflow-x: auto;
    background: var(--body-bg);
}

/* ═══════════════════════════════════════
   CARDS
   ═══════════════════════════════════════ */
.card {
    border-radius: 0.75rem;
    border: 1px solid #e8ecf1;
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

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

.card-header {
    border-bottom: 1px solid #f0f3f8;
    font-weight: 600;
}

/* ═══════════════════════════════════════
   TABLES
   ═══════════════════════════════════════ */
.table th {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #8896ab;
    border-bottom-width: 1px;
}

.table td {
    vertical-align: middle;
    color: #4a5568;
}

.table-hover tbody tr:hover {
    background-color: #f8faff;
}

.table-light {
    background-color: #f8fafc !important;
}

/* ═══════════════════════════════════════
   BADGES
   ═══════════════════════════════════════ */
.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: 0.375rem;
}

.badge.bg-primary {
    background-color: var(--primary) !important;
}

.badge.bg-success {
    background-color: var(--success) !important;
}

.badge.bg-warning {
    background-color: var(--warning) !important;
    color: #fff !important;
}

.badge.bg-danger {
    background-color: var(--danger) !important;
}

/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

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

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}

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

/* ═══════════════════════════════════════
   FORMS
   ═══════════════════════════════════════ */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(59, 108, 231, 0.15);
}

/* ═══════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════ */
.alert {
    border-radius: 0.5rem;
    border: none;
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════
   HEADING STYLES
   ═══════════════════════════════════════ */
h5 {
    color: var(--sidebar-heading);
    font-weight: 600;
}

/* ═══════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════ */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 50%, #f5f7fb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 100%;
    max-width: 420px;
    border-radius: 1rem;
    border: none;
    box-shadow: 0 8px 30px rgba(59, 108, 231, 0.1), 0 2px 8px rgba(0, 0, 0, 0.06);
}

.login-card .login-logo {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.75rem;
}

.login-card .login-subtitle {
    color: #8896ab;
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════
   USER ROLE BADGE (navbar)
   ═══════════════════════════════════════ */
.role-badge {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    font-size: 0.7rem;
    padding: 0.3em 0.7em;
    border-radius: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════ */
.page-link {
    color: var(--primary);
    border-color: #e8ecf1;
}

.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ═══════════════════════════════════════
   PORTAL CARDS (intranet)
   ═══════════════════════════════════════ */
.portal-stat-card {
    text-align: center;
    padding: 1.5rem 1rem;
}

.portal-stat-card i {
    font-size: 2rem;
    color: var(--primary);
    opacity: 0.8;
}

.portal-stat-card h2 {
    color: var(--primary);
    font-weight: 700;
}

/* ═══════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════ */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

/* ═══════════════════════════════════════
   SIDEBAR OVERLAY (mobile backdrop)
   ═══════════════════════════════════════ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1039;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-overlay.active {
    display: block;
}

/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(var(--sidebar-width) * -1);
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1040;
        min-height: 0;
        max-height: 100vh;
        max-height: 100dvh;
        height: 100vh;
        height: 100dvh;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
        transition: margin-left 0.3s ease;
    }

    .sidebar .nav {
        padding-bottom: 6rem;
    }

    .sidebar.toggled {
        margin-left: 0;
    }

    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}
