/* ============================================
   BCC24 Admin Panel — Modern Professional CSS
   ============================================ */

/* --- Variables --- */
:root {
    --admin-red: #dc2626;
    --admin-red-dark: #991b1b;
    --admin-bg: #f1f5f9;
    --sidebar-bg: #0f172a;
    --sidebar-hover: rgba(255,255,255,.07);
    --sidebar-active: rgba(220,38,38,.18);
    --sidebar-active-border: #dc2626;
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 60px;
    --card-radius: .875rem;
    --transition: .22s cubic-bezier(.4,0,.2,1);
    --shadow-sm: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,.05), 0 2px 4px rgba(0,0,0,.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,.08);
    --shadow-xl: 0 20px 50px rgba(0,0,0,.12);
}

* { box-sizing: border-box; }

body {
    background: var(--admin-bg);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: .875rem;
    color: #1e293b;
    margin: 0;
}

/* ---- SIDEBAR ---- */
.admin-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    top: 0; left: 0; z-index: 1050;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    transition: width var(--transition), left var(--transition);
    overflow: hidden;
}
.admin-sidebar::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 1px; height: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,.02) 100%);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem 1.125rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.sidebar-brand img {
    width: 36px; height: 36px;
    border-radius: .5rem;
    background: #1e293b;
    padding: 2px;
}
.sidebar-brand-text {
    white-space: nowrap;
    overflow: hidden;
}
.sidebar-brand-text .brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -.01em;
}
.sidebar-brand-text .brand-sub {
    font-size: .7rem;
    color: rgba(255,255,255,.4);
    letter-spacing: .03em;
    text-transform: uppercase;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: .5rem 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.nav-section-label {
    display: block;
    padding: .875rem 1.125rem .375rem;
    font-size: .65rem;
    font-weight: 600;
    color: rgba(255,255,255,.3);
    text-transform: uppercase;
    letter-spacing: .08em;
    white-space: nowrap;
}

.admin-sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5625rem 1.125rem;
    margin: .0625rem .5rem;
    border-radius: .5rem;
    color: rgba(255,255,255,.55);
    text-decoration: none;
    font-size: .8125rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition);
    position: relative;
}
.admin-sidebar .nav-link i {
    font-size: .95rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
    transition: color var(--transition);
}
.admin-sidebar .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.admin-sidebar .nav-link.active {
    background: var(--sidebar-active);
    color: #fff;
    font-weight: 600;
}
.admin-sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: -.5rem; top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 1.25rem;
    background: var(--sidebar-active-border);
    border-radius: 0 3px 3px 0;
}
.admin-sidebar .nav-link.active i { color: var(--admin-red); }

.sidebar-footer {
    flex-shrink: 0;
    padding: .75rem;
    border-top: 1px solid rgba(255,255,255,.06);
}
.sidebar-footer .admin-user {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .5rem;
    border-radius: .5rem;
    transition: background var(--transition);
}
.sidebar-footer .admin-user:hover { background: var(--sidebar-hover); }
.sidebar-footer .admin-avatar {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--admin-red), #f97316);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    flex-shrink: 0;
}
.sidebar-footer .admin-info { overflow: hidden; }
.sidebar-footer .admin-name {
    font-size: .8rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-footer .admin-role {
    font-size: .65rem;
    color: rgba(255,255,255,.4);
}

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

.admin-topbar {
    height: var(--topbar-height);
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1020;
}
.admin-topbar h1.h5 {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

/* ---- CONTENT AREA ---- */
.admin-content {
    padding: 1.25rem 1.5rem 2rem;
}

/* ---- CARDS ---- */
.card {
    border: 1px solid #e2e8f0;
    border-radius: var(--card-radius);
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
    padding: .875rem 1.125rem;
}

/* ---- STAT CARDS ---- */
.stat-card {
    border: 1px solid #e2e8f0;
    border-radius: var(--card-radius);
    background: #fff;
    padding: 1.125rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 80px; height: 80px;
    border-radius: 50%;
    opacity: .06;
}
.stat-card .stat-icon {
    width: 48px; height: 48px;
    border-radius: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: #0f172a;
}
.stat-card .stat-label {
    font-size: .75rem;
    color: #64748b;
    font-weight: 500;
}
.stat-card .stat-sub {
    font-size: .7rem;
    color: #94a3b8;
}

.stat-icon.red { background: #fef2f2; color: #dc2626; }
.stat-icon.green { background: #f0fdf4; color: #16a34a; }
.stat-icon.amber { background: #fffbeb; color: #d97706; }
.stat-icon.blue { background: #eff6ff; color: #2563eb; }
.stat-icon.purple { background: #faf5ff; color: #9333ea; }
.stat-icon.teal { background: #f0fdfa; color: #0d9488; }

/* ---- TABLES ---- */
.table { font-size: .8125rem; }
.table thead th {
    font-weight: 600;
    color: #475569;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: .75rem .875rem;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}
.table tbody td {
    padding: .75rem .875rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.table-hover tbody tr:hover { background: #f8fafc; }

/* ---- BUTTONS ---- */
.btn {
    border-radius: .5rem;
    font-weight: 600;
    font-size: .8rem;
    padding: .4375rem .875rem;
    transition: all var(--transition);
}
.btn-danger {
    background: var(--admin-red);
    border-color: var(--admin-red);
}
.btn-danger:hover {
    background: var(--admin-red-dark);
    border-color: var(--admin-red-dark);
    box-shadow: 0 4px 12px rgba(220,38,38,.25);
}
.btn-outline-danger {
    color: var(--admin-red);
    border-color: #fca5a5;
}
.btn-outline-danger:hover {
    background: #fef2f2;
    border-color: var(--admin-red);
    color: var(--admin-red-dark);
}
.btn-outline-secondary {
    border-color: #e2e8f0;
    color: #64748b;
}
.btn-outline-secondary:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* ---- BADGES ---- */
.badge { font-weight: 600; font-size: .6875rem; padding: .25em .5em; border-radius: .375rem; }

/* ---- FORMS ---- */
.form-control, .form-select {
    border-color: #e2e8f0;
    border-radius: .5rem;
    font-size: .8125rem;
    padding: .5rem .75rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--admin-red);
    box-shadow: 0 0 0 3px rgba(220,38,38,.1);
}
.form-label {
    font-weight: 600;
    color: #334155;
    font-size: .8rem;
    margin-bottom: .25rem;
}
.form-check-input:checked { background-color: var(--admin-red); border-color: var(--admin-red); }

/* ---- THUMBNAIL ---- */
.thumb-sm {
    width: 56px; height: 40px;
    object-fit: cover;
    border-radius: .375rem;
    background: #f1f5f9;
}

/* ---- LOGIN PAGE ---- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    position: relative;
    overflow: hidden;
}
.login-wrap::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(220,38,38,.12) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(249,115,22,.08) 0%, transparent 50%);
    animation: loginBg 20s ease-in-out infinite alternate;
}
@keyframes loginBg {
    0% { transform: rotate(0deg) scale(1); }
    100% { transform: rotate(5deg) scale(1.05); }
}
.login-card {
    width: 420px;
    max-width: 94vw;
    position: relative;
    z-index: 1;
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 1.25rem;
    box-shadow: 0 25px 60px rgba(0,0,0,.3);
}

/* ---- ALERTS ---- */
.alert {
    border: none;
    border-radius: .625rem;
    font-size: .8125rem;
    font-weight: 500;
}

/* ---- PAGINATION ---- */
.page-link {
    border: none;
    border-radius: .375rem !important;
    margin: 0 .125rem;
    font-size: .8rem;
    font-weight: 600;
    color: #64748b;
}
.page-item.active .page-link {
    background: var(--admin-red);
    color: #fff;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 991.98px) {
    .admin-sidebar { left: calc(-1 * var(--sidebar-width)); }
    .admin-sidebar.show { left: 0; box-shadow: 20px 0 60px rgba(0,0,0,.4); }
    .admin-main { margin-left: 0; }
    .admin-content { padding: 1rem; }
}

/* ---- CHART BAR ---- */
.chart-bar {
    border-radius: .25rem .25rem 0 0;
    transition: height .4s ease, opacity .3s ease;
    position: relative;
}
.chart-bar:hover { opacity: .85; }
.chart-bar::after {
    content: attr(data-val);
    position: absolute;
    top: -18px; left: 50%;
    transform: translateX(-50%);
    font-size: .6rem;
    font-weight: 600;
    color: #64748b;
    opacity: 0;
    transition: opacity .2s;
}
.chart-bar:hover::after { opacity: 1; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ---- TRANSITIONS ---- */
.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
