/* ============================================================
   Admin Panel - Custom Styles
   YouTube Service Authentication System
   ============================================================ */

/* ---- Root Variables ---- */
:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #3b82f6;
    --header-height: 60px;
    --badge-active: #22c55e;
    --badge-inactive: #9ca3af;
    --badge-suspended: #ef4444;
}

/* ---- Global ---- */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f1f5f9;
    min-height: 100vh;
}

/* ---- Sidebar ---- */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    color: #e2e8f0;
    z-index: 1040;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.admin-sidebar .sidebar-brand {
    padding: 18px 20px;
    font-size: 1.15rem;
    font-weight: 700;
    border-bottom: 1px solid #334155;
    color: #fff;
    text-decoration: none;
    display: block;
}

.admin-sidebar .sidebar-brand:hover {
    color: #93c5fd;
}

.admin-sidebar .nav-link {
    color: #cbd5e1;
    padding: 12px 20px;
    font-size: 0.92rem;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.admin-sidebar .nav-link:hover {
    background-color: var(--sidebar-hover);
    color: #fff;
    border-left-color: #64748b;
}

.admin-sidebar .nav-link.active {
    background-color: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border-left-color: var(--sidebar-active);
    font-weight: 600;
}

.admin-sidebar .nav-link i {
    width: 22px;
    text-align: center;
    margin-right: 10px;
}

/* ---- Main Content ---- */
.admin-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* ---- Header ---- */
.admin-header {
    height: var(--header-height);
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.admin-header .admin-user-info {
    font-size: 0.9rem;
    color: #475569;
}

.admin-header .admin-user-info strong {
    color: #1e293b;
}

/* ---- Content Area ---- */
.admin-content {
    padding: 24px;
}

/* ---- Dashboard Cards ---- */
.stat-card {
    background-color: #fff;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #e2e8f0;
    border-top: 4px solid #3b82f6;
    transition: box-shadow 0.2s ease;
}

.stat-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.stat-card.card-blue {
    border-top-color: #3b82f6;
}

.stat-card.card-green {
    border-top-color: #22c55e;
}

.stat-card.card-yellow {
    border-top-color: #eab308;
}

.stat-card.card-purple {
    border-top-color: #8b5cf6;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 4px;
}

.stat-card .stat-icon {
    font-size: 2rem;
    color: #94a3b8;
}

/* ---- Status Badges ---- */
.badge-active {
    background-color: var(--badge-active) !important;
    color: #fff !important;
}

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

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

.badge-success-result {
    background-color: #dcfce7 !important;
    color: #166534 !important;
}

.badge-fail-result {
    background-color: #fef2f2 !important;
    color: #991b1b !important;
}

/* ---- Tables ---- */
.admin-table {
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.admin-table .table {
    margin-bottom: 0;
}

.admin-table .table thead th {
    background-color: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    padding: 12px 16px;
    white-space: nowrap;
}

.admin-table .table tbody td {
    padding: 10px 16px;
    vertical-align: middle;
    font-size: 0.9rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
}

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

.admin-table .table tbody tr.row-fail {
    background-color: #fef2f2;
}

.admin-table .table tbody tr.row-fail:hover {
    background-color: #fee2e2;
}

.admin-table .table tbody tr.row-suspicious {
    background-color: #fefce8;
}

/* ---- Filter Bar ---- */
.filter-bar {
    background-color: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.filter-bar label {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
}

/* ---- Login Page ---- */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background-color: #fff;
    border-radius: 12px;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.login-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.login-card .login-subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 28px;
}

/* ---- Pagination ---- */
.pagination .page-link {
    color: #3b82f6;
    border-color: #e2e8f0;
    font-size: 0.88rem;
}

.pagination .page-item.active .page-link {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.pagination .page-item.disabled .page-link {
    color: #94a3b8;
}

/* ---- Toast Notification ---- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* ---- Action Buttons ---- */
.btn-action {
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: 4px;
}

/* ---- Sidebar Toggle Button (mobile) ---- */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #1e293b;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* ---- Sidebar Overlay (mobile) ---- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1035;
}

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

/* ---- Inline Edit Input ---- */
.inline-edit-input {
    width: 60px;
    padding: 2px 6px;
    font-size: 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    text-align: center;
}

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

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

    .admin-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: inline-block;
    }

    .admin-content {
        padding: 16px;
    }
}

@media (max-width: 767.98px) {
    .stat-card {
        padding: 16px;
    }

    .stat-card .stat-number {
        font-size: 1.5rem;
    }

    .admin-table {
        overflow-x: auto;
    }

    .login-card {
        margin: 16px;
        padding: 28px 24px;
    }
}
