/* =============================================
   SIJennga - Sistema Integral Jennga
   Estilos personalizados
   ============================================= */

:root {
    --primary:       #33C5B6;
    --primary-dark:  #1a9e91;
    --primary-light: #ebfffe;
    --secondary:     #3366FF;
    --sidebar-bg:    #0d4a45;
    --sidebar-dark:  #082e2a;
    --sidebar-hover: #1a7a72;
    --sidebar-active:#33C5B6;
    --accent-green:  #7AB728;
    --accent-yellow: #F5C518;
    --accent-orange: #E8431A;
    --accent-blue:   #2B5FA7;
    --accent-pink:   #E91E8C;
    --accent-lblue:  #89C4E1;
    --text-dark:     #2d3748;
    --text-muted:    #718096;
    --bg-light:      #f4f7f9;
    --border-color:  #e2e8f0;
    --sidebar-width: 260px;
    --header-height: 62px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    margin: 0;
    overflow-x: hidden;
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-wrapper {
    min-height: 100vh;
    background: linear-gradient(135deg, #ebfffe 0%, #d0f5f2 30%, #fff6eb 70%, #ffe8d6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(51,197,182,0.15) 0%, transparent 70%);
    top: -100px; left: -100px;
    border-radius: 50%;
}
.login-wrapper::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(233,30,140,0.08) 0%, transparent 70%);
    bottom: -80px; right: -80px;
    border-radius: 50%;
}

.login-card {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(13,74,69,0.15), 0 4px 20px rgba(0,0,0,0.06);
    padding: 2.8rem 2.5rem;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.7);
}

.login-logo {
    display: block;
    margin: 0 auto 0.5rem;
    height: 110px;
    object-fit: contain;
}

.login-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--sidebar-bg);
    text-align: center;
    margin-bottom: 0.2rem;
    letter-spacing: 0.5px;
}
.login-subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1.8rem;
}

.login-card .form-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.3rem;
}
.login-card .form-control {
    border-radius: 10px;
    border: 1.5px solid var(--border-color);
    padding: 0.65rem 0.9rem;
    font-size: 0.9rem;
    transition: border-color .2s, box-shadow .2s;
}
.login-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(51,197,182,0.18);
}
.btn-login {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.7rem;
    width: 100%;
    transition: transform .15s, box-shadow .15s;
    letter-spacing: 0.3px;
}
.btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(51,197,182,0.35);
    color: #fff;
}
.login-footer-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 1.5rem;
}

/* =============================================
   LAYOUT PRINCIPAL
   ============================================= */

/* Sidebar */
#sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform .3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Scrollbar sidebar */
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 2px; }

.sidebar-brand {
    background: var(--sidebar-dark);
    padding: 1.2rem 1.2rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: var(--header-height);
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sidebar-brand img {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}
.sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}
.sidebar-brand-text span:first-child {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
}
.sidebar-brand-text span:last-child {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.55);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-section-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.35);
    padding: 1.1rem 1.2rem 0.3rem;
    font-weight: 700;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.62rem 1.2rem;
    color: rgba(255,255,255,0.72);
    font-size: 0.855rem;
    font-weight: 500;
    border-radius: 0;
    transition: background .15s, color .15s, padding-left .15s;
    text-decoration: none;
    border-left: 3px solid transparent;
    position: relative;
}
.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,0.07);
    color: #fff;
    padding-left: 1.45rem;
}
.sidebar-nav .nav-link.active {
    background: rgba(51,197,182,0.18);
    color: #fff;
    border-left-color: var(--primary);
    font-weight: 600;
}
.sidebar-nav .nav-link i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
    opacity: 0.85;
    flex-shrink: 0;
}
.sidebar-nav .nav-link.active i { opacity: 1; }

.sidebar-badge {
    margin-left: auto;
    background: var(--accent-pink);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
}

.sidebar-bottom {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 0.8rem 1.2rem;
}
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.sidebar-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.82rem;
    flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info .name {
    font-size: 0.8rem; font-weight: 600; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-info .role {
    font-size: 0.68rem; color: rgba(255,255,255,0.45);
}
.sidebar-user .logout-btn {
    color: rgba(255,255,255,0.45);
    font-size: 1rem;
    text-decoration: none;
    transition: color .15s;
}
.sidebar-user .logout-btn:hover { color: #fff; }

/* ---- Main Content ---- */
#main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left .3s ease;
}

/* Header */
#topbar {
    position: sticky;
    top: 0;
    z-index: 999;
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.topbar-toggle {
    background: none; border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 6px;
    transition: background .15s, color .15s;
    display: none;
}
.topbar-toggle:hover { background: var(--primary-light); color: var(--primary); }

.topbar-page-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    flex: 1;
}

/* Branch Selector */
.branch-selector-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.branch-selector-wrap label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}
.branch-selector {
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    padding: 0.35rem 0.7rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--sidebar-bg);
    background: var(--primary-light);
    cursor: pointer;
    outline: none;
    transition: border-color .15s;
    min-width: 170px;
}
.branch-selector:focus { border-color: var(--primary); }
.branch-selector option { background: #fff; }

.topbar-sep {
    width: 1px; height: 28px;
    background: var(--border-color);
}

.topbar-notif {
    position: relative;
}
.topbar-notif .notif-btn {
    background: none; border: none;
    color: var(--text-muted);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0.35rem;
    border-radius: 8px;
    transition: background .15s, color .15s;
    display: flex; align-items: center; justify-content: center;
}
.topbar-notif .notif-btn:hover { background: var(--primary-light); color: var(--primary); }
.notif-dot {
    position: absolute;
    top: 4px; right: 4px;
    width: 8px; height: 8px;
    background: var(--accent-pink);
    border-radius: 50%;
    border: 2px solid #fff;
}

.topbar-profile {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
}
.topbar-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 0.82rem;
}
.topbar-profile-info { line-height: 1.2; }
.topbar-profile-info .tp-name { font-size: 0.82rem; font-weight: 700; color: var(--text-dark); }
.topbar-profile-info .tp-role { font-size: 0.68rem; color: var(--text-muted); }

/* Page Content */
.page-content {
    padding: 1.8rem;
    flex: 1;
}

.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.35rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.page-header h1 .ph-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-light), rgba(51,197,182,0.25));
    display: flex; align-items: center; justify-content: center;
    color: var(--primary-dark);
    font-size: 1rem;
}

/* Cards */
.card-si {
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
}
.card-si-header {
    padding: 1rem 1.3rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.card-si-header h6 {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}
.card-si-body { padding: 1.3rem; }

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}
.empty-state .es-icon {
    width: 80px; height: 80px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1.2rem;
}
.empty-state h5 { font-size: 1rem; font-weight: 700; color: var(--text-dark); margin-bottom: 0.4rem; }
.empty-state p { font-size: 0.82rem; color: var(--text-muted); max-width: 320px; margin-bottom: 1.2rem; }

/* Buttons */
.btn-primary-si {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none; color: #fff;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: transform .15s, box-shadow .15s;
    display: inline-flex; align-items: center; gap: 0.4rem;
    text-decoration: none;
}
.btn-primary-si:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(51,197,182,0.35);
    color: #fff;
}

/* Coming Soon Banner */
.coming-soon-card {
    background: #fff;
    border-radius: 20px;
    border: 2px dashed var(--border-color);
    padding: 3.5rem 2rem;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}
.coming-soon-card .cs-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-light), rgba(51,197,182,0.2));
    color: var(--primary-dark);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0.3rem 0.85rem;
    border-radius: 20px;
    margin-bottom: 1rem;
}
.coming-soon-card .cs-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}
.coming-soon-card h3 { font-size: 1.2rem; font-weight: 800; color: var(--text-dark); margin-bottom: 0.5rem; }
.coming-soon-card p { font-size: 0.85rem; color: var(--text-muted); }

/* Stat Cards (Dashboard) */
.stat-card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    padding: 1.3rem 1.3rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.08); }
.stat-card .sc-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}
.stat-card .sc-value { font-size: 1.9rem; font-weight: 800; color: var(--text-dark); line-height: 1; margin-bottom: 0.25rem; }
.stat-card .sc-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.stat-card .sc-trend {
    font-size: 0.72rem; font-weight: 600;
    display: flex; align-items: center; gap: 0.25rem;
    margin-top: 0.5rem;
}
.sc-trend.up { color: #22c55e; }
.sc-trend.neutral { color: var(--text-muted); }

.stat-card::after {
    content: '';
    position: absolute;
    right: -15px; top: -15px;
    width: 80px; height: 80px;
    border-radius: 50%;
    opacity: 0.05;
}

/* Color variants for stat cards */
.sc-teal .sc-icon { background: rgba(51,197,182,0.12); color: var(--primary-dark); }
.sc-teal::after { background: var(--primary); }
.sc-blue .sc-icon { background: rgba(51,102,255,0.1); color: var(--secondary); }
.sc-blue::after { background: var(--secondary); }
.sc-pink .sc-icon { background: rgba(233,30,140,0.1); color: var(--accent-pink); }
.sc-pink::after { background: var(--accent-pink); }
.sc-green .sc-icon { background: rgba(122,183,40,0.12); color: var(--accent-green); }
.sc-green::after { background: var(--accent-green); }
.sc-orange .sc-icon { background: rgba(232,67,26,0.1); color: var(--accent-orange); }
.sc-orange::after { background: var(--accent-orange); }

/* Tables */
.table-si { width: 100%; border-collapse: separate; border-spacing: 0; }
.table-si thead th {
    background: var(--bg-light);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
.table-si tbody td {
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-dark);
    vertical-align: middle;
}
.table-si tbody tr:last-child td { border-bottom: none; }
.table-si tbody tr:hover td { background: #fafcfc; }

/* Badges */
.badge-si {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    display: inline-block;
}
.badge-active { background: rgba(34,197,94,0.12); color: #166534; }
.badge-inactive { background: rgba(100,116,139,0.1); color: #64748b; }
.badge-pending { background: rgba(234,179,8,0.12); color: #854d0e; }
.badge-confirmed { background: rgba(51,197,182,0.12); color: var(--primary-dark); }
.badge-cancelled { background: rgba(239,68,68,0.1); color: #991b1b; }

/* Avatar */
.avatar-si {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.82rem;
    color: #fff;
    flex-shrink: 0;
}
.av-1 { background: linear-gradient(135deg, #33C5B6, #1a9e91); }
.av-2 { background: linear-gradient(135deg, #3366FF, #1a44cc); }
.av-3 { background: linear-gradient(135deg, #E91E8C, #c01577); }
.av-4 { background: linear-gradient(135deg, #7AB728, #5d8f1e); }
.av-5 { background: linear-gradient(135deg, #F5C518, #d4a715); color: #333; }

/* Responsive */
@media (max-width: 992px) {
    #sidebar { transform: translateX(-100%); }
    #sidebar.open { transform: translateX(0); }
    #main-content { margin-left: 0; }
    .topbar-toggle { display: flex; }
    .topbar-profile-info { display: none; }
}

@media (max-width: 576px) {
    .page-content { padding: 1rem; }
    .branch-selector-wrap label { display: none; }
    .branch-selector { min-width: 140px; }
}

/* Overlay mobile */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}
#sidebar-overlay.show { display: block; }

/* Breadcrumb */
.breadcrumb-si {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.breadcrumb-si a { color: var(--primary-dark); text-decoration: none; }
.breadcrumb-si a:hover { text-decoration: underline; }
.breadcrumb-si .sep { color: var(--border-color); }

/* Footer */
.page-footer {
    padding: 1rem 1.8rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.72rem;
    color: var(--text-muted);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Scroll animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}
.fade-in-up { animation: fadeInUp .35s ease both; }
