/* ============================================================
   GROUPE IKI - Admin Dashboard Styles
   ============================================================ */

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.login-container {
    width: 100%;
    max-width: 440px;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.login-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 3rem 2.5rem 1.5rem;
    animation: scaleIn 0.5s ease-out;
}

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

.login-logo span {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.login-form .form-group {
    margin-bottom: 1rem;
}

.login-form .form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.login-form .form-group label i {
    color: var(--primary);
}

.login-form .form-control {
    padding: 0.65rem 0.875rem;
    font-size: 0.8125rem;
}

.btn-login {
    width: 100%;
    padding: 0.65rem;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    margin-top: 0.25rem;
}

.login-footer {
    text-align: center;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.6875rem;
}

.login-bg-shapes .shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

.login-bg-shapes .shape-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    right: -200px;
}

.login-bg-shapes .shape-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    bottom: -100px;
    left: -100px;
}

.login-bg-shapes .shape-3 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%);
}

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: var(--transition);
    overflow: hidden;
}

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

.sidebar-logo .logo-icon {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-brand-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.75rem;
}

.nav-section-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.75rem 1rem 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    margin-bottom: 0.125rem;
    font-size: 0.8125rem;
    font-weight: 500;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(240, 78, 35, 0.12);
    color: var(--primary);
}

.nav-item i {
    font-size: 1.125rem;
    width: 1.25rem;
    text-align: center;
}

.nav-item-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.03);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.logout-item {
    margin-top: 0.5rem;
    color: var(--text-muted);
}

.logout-item:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Top Bar */
.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
}

.page-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Admin Content */
.admin-content {
    flex: 1;
    padding: 1.25rem 1.5rem;
}

/* Admin Footer */
.admin-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.footer-version {
    font-family: monospace;
}

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.stat-trend {
    width: 100%;
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--danger);
}

/* ============================================================
   OCCUPANCY CARD
   ============================================================ */
.occupancy-card {
    padding: 1.5rem;
}

.occupancy-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.occupancy-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.occupancy-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.occupancy-progress {
    height: 12px;
    border-radius: 6px;
    background: var(--bg-input);
    overflow: hidden;
}

.occupancy-progress .progress-bar {
    border-radius: 6px;
    transition: width 1s ease;
}

/* ============================================================
   CHART CARDS
   ============================================================ */
.chart-card {
    padding: 1.5rem;
}

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

.card-header-custom h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
}

.card-header-custom i {
    color: var(--text-muted);
    font-size: 1.25rem;
}

.chart-container {
    padding: 1.5rem;
    position: relative;
    height: 300px;
}

/* ============================================================
   SEARCH FORM
   ============================================================ */
.search-form {
    position: relative;
    max-width: 300px;
}

.search-form i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    z-index: 10;
}

.search-form .form-control {
    padding-left: 2.5rem;
    font-size: 0.8125rem;
}

/* ============================================================
   USER CELL
   ============================================================ */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-cell-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    color: white;
    flex-shrink: 0;
}

/* ============================================================
   ACTION BUTTONS
   ============================================================ */
.action-btns {
    display: flex;
    gap: 0.375rem;
}

.btn-edit {
    background: rgba(36, 59, 143, 0.15);
    color: var(--secondary-light);
}

.btn-edit:hover {
    background: rgba(36, 59, 143, 0.25);
    color: var(--secondary-light);
}

.btn-delete {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.25);
    color: var(--danger);
}

.btn-icon {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 0.375rem;
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* ============================================================
   FILTERS BAR
   ============================================================ */
.filters-bar {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0,0,0,0.1);
}

/* ============================================================
   LIVE INDICATOR
   ============================================================ */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--success);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 1.5s infinite;
}

/* ============================================================
   MODAL
   ============================================================ */
.glass-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

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

.modal-header .modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-header .btn-close {
    filter: invert(0.8);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

/* ============================================================
   EXPORT BUTTONS
   ============================================================ */
.btn-export {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
    background: transparent;
    color: var(--text-primary);
    transition: var(--transition);
    cursor: pointer;
}

.btn-export:hover {
    border-style: solid;
    transform: translateY(-2px);
}

.btn-export.csv:hover {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
}

.btn-export.excel:hover {
    border-color: var(--secondary);
    background: rgba(36, 59, 143, 0.1);
    color: var(--secondary-light);
}

.btn-export.pdf:hover {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ============================================================
   SIDEBAR FOOTER
   ============================================================ */
.sidebar-footer {
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border-color);
}

/* ============================================================
   PREMIUM ANIMATED LED LINE
   ============================================================ */
.led-line-container {
    padding: 0 2rem;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

.led-line {
    position: relative;
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, #F04E23, #D946EF, #243B8F, #D946EF, #F04E23);
    background-size: 300% 100%;
    overflow: visible;
    animation: ledSweep 6s ease-in-out infinite;
}

.led-line::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 4px;
    background: linear-gradient(90deg, #F04E23, #D946EF, #243B8F, #D946EF, #F04E23);
    background-size: 300% 100%;
    filter: blur(12px);
    opacity: 0.6;
    animation: ledSweep 6s ease-in-out infinite;
}

@keyframes ledSweep {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.led-line::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 4px;
    background: linear-gradient(90deg, #F04E23, #D946EF, #243B8F);
    filter: blur(12px);
    opacity: 0.6;
    animation: ledBreathe 3s ease-in-out infinite;
}



@keyframes ledBreathe {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* ============================================================
   RESPONSIVE - 100% MOBILE
   ============================================================ */

/* Tablets & small laptops */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: none;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .admin-sidebar.show {
        transform: translateX(0);
        box-shadow: 20px 0 40px rgba(0,0,0,0.3);
    }
    
    .admin-main {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.6);
        z-index: 999;
        display: none;
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .admin-content {
        padding: 1rem;
    }
    
    .admin-topbar {
        padding: 0.75rem 1rem;
    }

    .page-title {
        font-size: 1.1rem;
    }

    .led-line-container {
        padding: 0 1rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .card-header-custom {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .search-form {
        max-width: 100%;
        width: 100%;
    }

    .filters-bar form {
        flex-direction: column;
    }

    .filters-bar .col-md-3,
    .filters-bar .col-md-4,
    .filters-bar .col-md-2 {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .action-btns {
        flex-wrap: nowrap;
    }
}

/* Phones */
@media (max-width: 575.98px) {
    .admin-sidebar {
        width: 100%;
        max-width: 300px;
    }

    .admin-content {
        padding: 0.75rem;
    }

    .admin-topbar {
        padding: 0.625rem 0.75rem;
    }

    .page-title {
        font-size: 1rem;
    }

    .led-line-container {
        padding: 0 0.75rem;
    }

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

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .card-header-custom {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.625rem;
        padding: 1rem;
    }

    .card-header-custom h3 {
        font-size: 0.9375rem;
    }

    .admin-table thead th,
    .admin-table tbody td {
        padding: 0.5rem 0.625rem;
        font-size: 0.75rem;
    }

    .admin-table thead th {
        font-size: 0.625rem;
    }

    .btn-sm {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    .search-form {
        max-width: 100%;
        width: 100%;
    }

    .form-control-lg {
        padding: 0.75rem 1rem;
        font-size: 0.9375rem;
    }

    .btn-lg {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .topbar-date {
        display: none;
    }

    .admin-footer {
        flex-direction: column;
        gap: 0.25rem;
        text-align: center;
        padding: 0.75rem 1rem;
        font-size: 0.75rem;
    }

    .slot-card .slot-time {
        min-width: 80px;
        font-size: 0.8125rem;
    }

    .chart-container {
        height: 200px;
        padding: 1rem;
    }

    .occupancy-card {
        padding: 1rem;
    }

    .codes-container {
        overflow-x: auto;
    }

    .row.g-4 > [class*="col-"] {
        padding-bottom: 0.5rem;
    }

    .filters-bar {
        padding: 0.75rem;
    }

    input, select, textarea, button {
        font-size: 16px !important; /* prevent iOS zoom */
    }

    .pagination-wrap {
        padding: 0.75rem;
    }

    .pagination .page-link {
        padding: 0.375rem 0.625rem;
        font-size: 0.8125rem;
    }
}
