/* ============================================================
   MyFalcon DMS — Estilos personalizados
   ============================================================ */

/* Variables globales */
:root {
    --falcon-dark:    #1a1a2e;
    --falcon-primary: #0d6efd;
    --falcon-accent:  #f0a500;
    --sidebar-width:  240px;
    --navbar-height:  56px;
    --sidebar-bg:     #1a1a2e;
    --sidebar-text:   #a8b2d8;
    --sidebar-hover:  rgba(255,255,255,0.08);
    --sidebar-active: rgba(13,110,253,0.25);
    --sidebar-active-text: #ffffff;
    --content-bg:     #f4f6fb;
}

/* ============================================================
   LAYOUT GENERAL
   ============================================================ */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--content-bg);
    color: #212529;
}

.app-wrapper {
    min-height: 100vh;
}

/* Layout con sidebar fijo */
.app-layout {
    display: flex;
    min-height: calc(100vh - var(--navbar-height));
    padding-top: var(--navbar-height);
}

.app-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 1.5rem;
    min-width: 0;
    transition: margin-left 0.25s ease;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.app-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: var(--navbar-height);
    background-color: #ffffff;
    border-bottom: 1px solid #e0e4ef;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.nav-icon-btn {
    color: #495057;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border-radius: 0.5rem;
    transition: background 0.15s;
}

.nav-icon-btn:hover {
    background: var(--content-bg);
    color: var(--falcon-primary);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--falcon-primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.app-sidebar {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--navbar-height));
    background: var(--sidebar-bg);
    overflow-y: auto;
    z-index: 1020;
    transition: transform 0.25s ease;
    padding: 1rem 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 0.75rem;
}

.sidebar-section {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5a6a8a;
    padding: 1rem 0.5rem 0.25rem;
    margin-top: 0.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}

.sidebar-link i {
    font-size: 1.05rem;
    min-width: 20px;
    text-align: center;
}

.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #ffffff;
}

.sidebar-link.active {
    background: var(--sidebar-active);
    color: var(--sidebar-active-text);
    font-weight: 500;
}

/* ============================================================
   NOTIFICACIONES
   ============================================================ */
.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 0.6rem;
    padding: 0.2em 0.4em;
    transform: translate(25%, -25%);
}

.notification-menu {
    min-width: 320px;
    max-height: 400px;
    overflow-y: auto;
}

/* ============================================================
   PÁGINA DE LOGIN
   ============================================================ */
.login-body {
    background: var(--falcon-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    width: 100%;
    max-width: 400px;
    padding: 1rem;
}

.login-card {
    background: #ffffff;
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo img {
    max-height: 50px;
    max-width: 220px;
}

.login-title {
    text-align: center;
    color: #495057;
    margin-bottom: 1.5rem;
    font-weight: 400;
}

.btn-login {
    padding: 0.65rem;
    font-size: 1rem;
}

.login-footer {
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-size: 0.8rem;
    margin-top: 1.25rem;
}

/* ============================================================
   CARDS DE CONTENIDO
   ============================================================ */
.content-card {
    background: #ffffff;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 1.5rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--falcon-dark);
}

/* ============================================================
   TABLAS
   ============================================================ */
.table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead th {
    background: #f4f6fb;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    border-bottom: 2px solid #e0e4ef;
    white-space: nowrap;
}

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

/* ============================================================
   BADGES DE ESTADO
   ============================================================ */
.badge-active {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-inactive {
    background-color: #fee2e2;
    color: #991b1b;
}

/* ============================================================
   RESPONSIVE — colapso del sidebar en móvil
   ============================================================ */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }

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

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

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1015;
    }

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

/* ============================================================
   UTILIDADES
   ============================================================ */
.spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.cursor-pointer { cursor: pointer; }

/* ============================================================
   STAT CARDS — Dashboard
   ============================================================ */
.stat-card {
    background: #fff;
    border-radius: 0.75rem;
    padding: 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border-left: 4px solid transparent;
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.stat-card__icon { font-size: 1.4rem; }
.stat-card__value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-card__label { font-size: 0.78rem; color: #6c757d; }

.stat-card--blue   { border-color: #0d6efd; }
.stat-card--blue   .stat-card__icon { color: #0d6efd; }
.stat-card--green  { border-color: #198754; }
.stat-card--green  .stat-card__icon { color: #198754; }
.stat-card--red    { border-color: #dc3545; }
.stat-card--red    .stat-card__icon { color: #dc3545; }
.stat-card--yellow { border-color: #ffc107; }
.stat-card--yellow .stat-card__icon { color: #ffc107; }
.stat-card--indigo { border-color: #6610f2; }
.stat-card--indigo .stat-card__icon { color: #6610f2; }
.stat-card--cyan   { border-color: #0dcaf0; }
.stat-card--cyan   .stat-card__icon { color: #0dcaf0; }
.stat-card--teal   { border-color: #20c997; }
.stat-card--teal   .stat-card__icon { color: #20c997; }
.stat-card--gray   { border-color: #6c757d; }
.stat-card--gray   .stat-card__icon { color: #6c757d; }

.stat-card--pulse {
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,193,7,0.4); }
    50%       { box-shadow: 0 0 0 6px rgba(255,193,7,0); }
}

/* ============================================================
   UPLOAD AREA
   ============================================================ */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 0.75rem;
    padding: 2rem 1rem;
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}

.upload-area:hover,
.upload-area--selected {
    border-color: var(--falcon-primary);
    background: #f0f5ff;
}

/* ============================================================
   DETAIL VIEW
   ============================================================ */
.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 0.95rem;
    color: #212529;
}
