﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --sidebar-bg: #111827;
    --sidebar-text: #9ca3af;
    --sidebar-text-hover: #ffffff;
    --sidebar-active: #1f2937;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
}

/* LOGIN SCREEN */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a 0%, #111827 100%);
}

.login-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    color: white;
}

.login-container h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.login-container .form-group {
    margin-bottom: 20px;
    text-align: left;
}

.login-container .form-group label {
    display: block;
    font-size: 14px;
    margin-bottom: 8px;
    color: #cbd5e1;
}

.login-container .form-group input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 16px;
    outline: none;
    transition: var(--transition);
}

.login-container .form-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}

/* ADMIN LAYOUT */
.admin-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 260px;
    flex: 0 0 260px;
    background-color: var(--sidebar-bg);
    color: white;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar-close, .sidebar-toggle, .sidebar-backdrop, .mobile-sidebar-fab { display: none; }
.admin-header-title { display: flex; align-items: center; gap: 12px; min-width: 0; }

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar-header h3 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    color: white;
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.menu-item {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.menu-item:hover, .menu-item.active {
    background-color: var(--sidebar-active);
    color: var(--sidebar-text-hover);
    border-left: 4px solid var(--primary);
}

.menu-item i {
    margin-right: 12px;
    font-size: 18px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.top-header {
    height: 70px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.top-header h1 {
    font-size: 20px;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.admin-profile-trigger { width:40px; height:40px; border:0; border-radius:50%; background:var(--primary); color:#fff; }
.user-profile > div[style] { display:none !important; }
.admin-profile-dropdown { display:none; position:absolute; right:24px; top:62px; z-index:1050; width:210px; padding:8px; background:#fff; border:1px solid #e2e8f0; border-radius:12px; box-shadow:0 14px 35px rgba(15,23,42,.16); }
.admin-profile-dropdown.show { display:block; }
.admin-profile-dropdown-title { padding:9px 10px; color:#64748b; font-size:13px; font-weight:700; border-bottom:1px solid #f1f5f9; margin-bottom:5px; }
.admin-profile-dropdown button, .admin-profile-dropdown a { width:100%; border:0; background:transparent; display:flex; gap:10px; align-items:center; padding:10px; border-radius:8px; color:#334155; text-decoration:none; text-align:left; }
.admin-profile-dropdown button:hover, .admin-profile-dropdown a:hover { background:#f1f5f9; color:var(--primary); }

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.content-body {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive table { min-width: 720px; }
.content-body img { max-width: 100%; }

@media (max-width: 1024px) {
    body.sidebar-open { overflow: hidden; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 1200;
        width: min(82vw, 290px);
        transform: translateX(-105%);
        box-shadow: 18px 0 45px rgba(15, 23, 42, .28);
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-header { position: relative; padding-right: 54px; }
    .sidebar-close {
        display: inline-flex; position: absolute; right: 14px; top: 17px; width: 36px; height: 36px;
        align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.15);
        border-radius: 9px; background: rgba(255,255,255,.08); color: #fff;
    }
    .sidebar-toggle {
        display: inline-flex !important; flex: 0 0 40px; width: 40px; height: 40px; align-items: center; justify-content: center;
        border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; color: #334155;
    }
    .mobile-sidebar-fab {
        display: inline-flex !important;
        position: fixed;
        left: 12px;
        top: 11px;
        z-index: 1150;
        width: 42px;
        height: 42px;
        align-items: center;
        justify-content: center;
        border: 1px solid #dbe3ee;
        border-radius: 11px;
        background: #fff;
        color: #0f172a;
        box-shadow: 0 5px 16px rgba(15, 23, 42, .16);
    }
    .admin-header-title .sidebar-toggle { visibility: hidden; }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 1190; border: 0; background: rgba(15,23,42,.48); }
    .sidebar-backdrop.show { display: block; }
    .top-header { padding: 0 20px; }
    .content-body { padding: 22px; }
}

@media (max-width: 767.98px) {
    .top-header { height: 62px; padding: 0 12px; }
    .top-header h1 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
    .user-profile { gap: 6px; }
    .user-profile > span { display: none; }
    .admin-profile-trigger { width: 38px; height: 38px; }
    .admin-profile-dropdown { right: 10px; top: 56px; max-width: calc(100vw - 20px); }
    .content-body { padding: 14px 10px 24px; }
    .card { padding: 14px; border-radius: 10px; }
    .content-header { align-items: flex-start !important; gap: 10px; flex-wrap: wrap; }
    .content-body h2 { font-size: 21px; }
    .content-body > div[style*="justify-content:space-between"] { flex-wrap: wrap; gap: 10px; }
    .content-body > div[style*="justify-content:space-between"] > div { flex-wrap: wrap; max-width: 100%; }
    .modal-overlay { padding: 8px !important; align-items: flex-start !important; overflow-y: auto; }
    .modal-overlay .modal-content { width: 100% !important; max-width: 100% !important; max-height: calc(100dvh - 16px) !important; margin: 0 !important; border-radius: 12px !important; }
    .modal-tabs { overflow-x: auto; flex-wrap: nowrap !important; }
    .modal-tab { white-space: nowrap; padding: 11px 14px !important; }
    .modal-body, .modal-body-scroll { padding: 14px !important; max-height: calc(100dvh - 150px) !important; }
    input, select, textarea, button { max-width: 100%; }
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter { float: none !important; text-align: left !important; margin: 8px 0; }
    .dataTables_wrapper .dataTables_filter input { width: min(100%, 220px) !important; }
    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate { float: none !important; text-align: center !important; margin-top: 10px; }
    .form-row, .form-grid { grid-template-columns: 1fr !important; }
    .modal-content > div[style*="flex-direction:row"] { flex-direction: column !important; overflow-y: auto !important; }
    .modal-content > div[style*="flex-direction:row"] > div { width: 100% !important; flex: none !important; border-left: 0 !important; border-right: 0 !important; }
}

@media (max-width: 420px) {
    .sidebar { width: 88vw; }
    .content-body { padding-inline: 8px; }
    .card { padding: 11px; }
}

.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    padding: 24px;
    margin-bottom: 24px;
}


