/* =========================================================
   DLG Admin Panel — admin.css
   Theme mirrors site palette: #1D2D5F  #FFBC47  #F65E5D  #40CEE3
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --a-primary: #1D2D5F;
    --a-primary-lt: #2a3f7a;
    --a-primary-dk: #131e42;
    --a-amber: #FFBC47;
    --a-coral: #F65E5D;
    --a-cyan: #40CEE3;
    --a-success: #2ecc71;
    --a-warning: #f39c12;
    --a-danger: #F65E5D;
    --a-white: #ffffff;
    --a-gray-50: #f8f9fa;
    --a-gray-100: #f1f3f5;
    --a-gray-200: #e9ecef;
    --a-gray-400: #ced4da;
    --a-gray-600: #868e96;
    --a-gray-800: #343a40;
    --a-sidebar-w: 260px;
    --a-topbar-h: 64px;
    --a-radius: 10px;
    --a-shadow: 0 2px 12px rgba(29, 45, 95, 0.10);
    --a-shadow-lg: 0 8px 32px rgba(29, 45, 95, 0.18);
    --a-transition: all 0.25s ease;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body.admin-body {
    font-family: 'Inter', sans-serif;
    background: var(--a-gray-100);
    color: var(--a-gray-800);
    display: flex;
    min-height: 100vh;
    font-size: 0.9rem;
}

/* =========================================================
   SIDEBAR
   ========================================================= */
.a-sidebar {
    width: var(--a-sidebar-w);
    background: var(--a-primary-dk);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 500;
    transition: var(--a-transition);
    overflow: hidden;
}

.a-sidebar.collapsed {
    width: 68px;
}

/* Brand */
.a-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 72px;
}

.a-brand-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--a-coral), var(--a-amber));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
}

.a-brand-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    display: block;
}

.a-brand-sub {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.5);
    display: block;
}

.a-sidebar.collapsed .a-brand-text,
.a-sidebar.collapsed span,
.a-sidebar.collapsed .a-brand-sub {
    display: none;
}

/* Nav */
.a-sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.a-sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.a-sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.a-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    border-radius: 0;
    transition: var(--a-transition);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    position: relative;
}

.a-nav-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.a-nav-item.active {
    background: rgba(64, 206, 227, 0.12);
    color: var(--a-cyan);
    border-left: 3px solid var(--a-cyan);
}

.a-nav-icon {
    width: 18px;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.a-logout {
    color: rgba(246, 94, 93, 0.8) !important;
}

.a-logout:hover {
    background: rgba(246, 94, 93, 0.1) !important;
    color: var(--a-coral) !important;
}

.a-sidebar-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 0;
}

/* =========================================================
   MAIN WRAPPER
   ========================================================= */
.a-main-wrapper {
    margin-left: var(--a-sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: var(--a-transition);
}

.a-main-wrapper.expanded {
    margin-left: 68px;
}

/* =========================================================
   TOPBAR
   ========================================================= */
.a-topbar {
    height: var(--a-topbar-h);
    background: var(--a-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    border-bottom: 1px solid var(--a-gray-200);
    box-shadow: var(--a-shadow);
    position: sticky;
    top: 0;
    z-index: 400;
}

.a-topbar-left,
.a-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.a-sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--a-gray-600);
    padding: 6px 10px;
    border-radius: var(--a-radius);
    transition: var(--a-transition);
}

.a-sidebar-toggle:hover {
    background: var(--a-gray-100);
    color: var(--a-primary);
}

.a-breadcrumb {
    font-size: 0.82rem;
    color: var(--a-gray-600);
    display: flex;
    align-items: center;
    gap: 6px;
}

.a-breadcrumb a {
    color: var(--a-primary);
    font-weight: 600;
    text-decoration: none;
}

.a-breadcrumb-sep {
    opacity: 0.5;
}

.a-topbar-time {
    font-size: 0.8rem;
    color: var(--a-gray-600);
    font-family: monospace;
    white-space: nowrap;
}

.a-user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
}

.a-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--a-primary), var(--a-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}

.a-user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--a-primary);
    display: block;
}

.a-user-role {
    font-size: 0.72rem;
    color: var(--a-gray-600);
    display: block;
}

/* =========================================================
   FLASH MESSAGES
   ========================================================= */
.a-flash {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    font-size: 0.88rem;
    font-weight: 500;
}

.a-flash-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid var(--a-success);
}

.a-flash-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--a-coral);
}

.a-flash-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--a-cyan);
}

/* =========================================================
   PAGE CONTENT
   ========================================================= */
.a-page-content {
    padding: 28px;
    flex: 1;
}

/* Page header */
.a-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.a-page-header h1 {
    font-size: 1.5rem;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--a-primary);
}

/* =========================================================
   CARDS
   ========================================================= */
.a-card {
    background: var(--a-white);
    border-radius: var(--a-radius);
    box-shadow: var(--a-shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.a-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--a-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--a-gray-200);
    display: flex;
    align-items: center;
    gap: 10px;
}

.a-card-title i {
    color: var(--a-cyan);
}

/* =========================================================
   STATS GRID
   ========================================================= */
.a-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.a-stat-card {
    background: var(--a-white);
    border-radius: var(--a-radius);
    box-shadow: var(--a-shadow);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-left: 4px solid transparent;
    transition: var(--a-transition);
}

.a-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--a-shadow-lg);
}

.a-stat-card:nth-child(1) {
    border-left-color: var(--a-primary);
}

.a-stat-card:nth-child(2) {
    border-left-color: var(--a-coral);
}

.a-stat-card:nth-child(3) {
    border-left-color: var(--a-cyan);
}

.a-stat-card:nth-child(4) {
    border-left-color: var(--a-amber);
}

.a-stat-card:nth-child(5) {
    border-left-color: var(--a-primary);
}

.a-stat-card:nth-child(6) {
    border-left-color: var(--a-coral);
}

.a-stat-card:nth-child(7) {
    border-left-color: var(--a-cyan);
}

.a-stat-card:nth-child(8) {
    border-left-color: var(--a-amber);
}

.a-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.a-stat-num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--a-primary);
    line-height: 1;
}

.a-stat-label {
    font-size: 0.78rem;
    color: var(--a-gray-600);
    margin-top: 4px;
}

/* =========================================================
   TABLES
   ========================================================= */
.a-table-wrap {
    overflow-x: auto;
}

table.a-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.87rem;
}

table.a-table thead th {
    background: var(--a-gray-50);
    color: var(--a-primary);
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid var(--a-gray-200);
}

table.a-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--a-gray-100);
    vertical-align: middle;
}

table.a-table tbody tr:last-child td {
    border-bottom: none;
}

table.a-table tbody tr:hover {
    background: var(--a-gray-50);
}

/* =========================================================
   FORMS
   ========================================================= */
.a-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.a-form-group {
    margin-bottom: 20px;
}

.a-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--a-primary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.a-input,
.a-select,
.a-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--a-gray-200);
    border-radius: var(--a-radius);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--a-gray-800);
    background: var(--a-white);
    transition: var(--a-transition);
    outline: none;
}

.a-input:focus,
.a-select:focus,
.a-textarea:focus {
    border-color: var(--a-cyan);
    box-shadow: 0 0 0 3px rgba(64, 206, 227, 0.15);
}

.a-textarea {
    resize: vertical;
    min-height: 120px;
}

.a-hint {
    font-size: 0.75rem;
    color: var(--a-gray-600);
    margin-top: 4px;
}

/* =========================================================
   BUTTONS
   ========================================================= */
.a-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    border-radius: var(--a-radius);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: var(--a-transition);
    white-space: nowrap;
}

.a-btn-primary {
    background: var(--a-primary);
    color: #fff;
}

.a-btn-primary:hover {
    background: var(--a-primary-lt);
}

.a-btn-coral {
    background: var(--a-coral);
    color: #fff;
}

.a-btn-coral:hover {
    background: #d94443;
}

.a-btn-cyan {
    background: var(--a-cyan);
    color: var(--a-primary-dk);
}

.a-btn-cyan:hover {
    background: #2db8ca;
}

.a-btn-amber {
    background: var(--a-amber);
    color: var(--a-primary-dk);
}

.a-btn-amber:hover {
    background: #d99a1f;
}

.a-btn-outline {
    background: transparent;
    color: var(--a-primary);
    border: 1.5px solid var(--a-gray-200);
}

.a-btn-outline:hover {
    border-color: var(--a-primary);
    background: var(--a-gray-50);
}

.a-btn-sm {
    padding: 6px 14px;
    font-size: 0.78rem;
}

.a-btn-danger {
    background: rgba(246, 94, 93, 0.1);
    color: var(--a-coral);
    border: 1px solid rgba(246, 94, 93, 0.3);
}

.a-btn-danger:hover {
    background: var(--a-coral);
    color: #fff;
}

/* =========================================================
   BADGES
   ========================================================= */
.a-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
}

.a-badge-success {
    background: #d4edda;
    color: #155724;
}

.a-badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.a-badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.a-badge-warn {
    background: #fff3cd;
    color: #856404;
}

.a-badge-primary {
    background: rgba(29, 45, 95, 0.1);
    color: var(--a-primary);
}

/* =========================================================
   QUICK ACTIONS GRID
   ========================================================= */
.a-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
}

.a-quick-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 22px 16px;
    background: var(--a-white);
    border-radius: var(--a-radius);
    box-shadow: var(--a-shadow);
    text-decoration: none;
    color: var(--a-gray-800);
    border-bottom: 3px solid transparent;
    transition: var(--a-transition);
    text-align: center;
    gap: 10px;
}

.a-quick-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--a-shadow-lg);
}

.a-quick-card:nth-child(1) {
    border-bottom-color: var(--a-primary);
}

.a-quick-card:nth-child(2) {
    border-bottom-color: var(--a-coral);
}

.a-quick-card:nth-child(3) {
    border-bottom-color: var(--a-cyan);
}

.a-quick-card:nth-child(4) {
    border-bottom-color: var(--a-amber);
}

.a-quick-card:nth-child(5) {
    border-bottom-color: var(--a-primary);
}

.a-quick-card:nth-child(6) {
    border-bottom-color: var(--a-coral);
}

.a-quick-card:nth-child(7) {
    border-bottom-color: var(--a-cyan);
}

.a-quick-card:nth-child(8) {
    border-bottom-color: var(--a-amber);
}

.a-quick-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
}

.a-quick-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--a-gray-800);
}

.a-quick-sub {
    font-size: 0.7rem;
    color: var(--a-gray-600);
}

/* =========================================================
   ACTIVITY FEED
   ========================================================= */
.a-activity-feed {
    list-style: none;
}

.a-activity-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid var(--a-gray-100);
}

.a-activity-item:last-child {
    border-bottom: none;
}

.a-activity-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: #fff;
}

.a-activity-text {
    font-size: 0.83rem;
    color: var(--a-gray-800);
    line-height: 1.4;
}

.a-activity-time {
    font-size: 0.72rem;
    color: var(--a-gray-600);
    margin-top: 2px;
    display: block;
}

/* =========================================================
   LOGIN PAGE
   ========================================================= */
body.a-login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--a-primary-dk) 0%, var(--a-primary) 60%, var(--a-primary-lt) 100%);
    margin: 0;
}

.a-login-wrap {
    display: grid;
    grid-template-columns: 1fr 420px;
    max-width: 900px;
    width: 95%;
    background: var(--a-white);
    border-radius: 20px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.a-login-left {
    background: linear-gradient(160deg, var(--a-primary) 0%, var(--a-primary-lt) 100%);
    padding: 60px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.a-login-left::before {
    content: '';
    position: absolute;
    top: -100px;
    right: -100px;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(64, 206, 227, 0.25), transparent 70%);
}

.a-login-left::after {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -80px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(246, 94, 93, 0.2), transparent 70%);
}

.a-login-right {
    padding: 52px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.a-login-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--a-coral), var(--a-amber));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 28px;
}

.a-login-title {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.a-login-sub {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
    position: relative;
    z-index: 1;
    line-height: 1.7;
}

.a-login-features {
    list-style: none;
    margin-top: 28px;
    position: relative;
    z-index: 1;
}

.a-login-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.a-login-features li i {
    color: var(--a-cyan);
}

.a-login-form-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--a-primary);
    margin-bottom: 6px;
}

.a-login-form-sub {
    font-size: 0.83rem;
    color: var(--a-gray-600);
    margin-bottom: 28px;
}

.a-login-submit {
    width: 100%;
    padding: 13px;
    background: var(--a-coral);
    color: #fff;
    border: none;
    border-radius: var(--a-radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--a-transition);
    margin-top: 4px;
}

.a-login-submit:hover {
    background: #d94443;
}

/* =========================================================
   IMAGE PREVIEW
   ========================================================= */
.a-img-preview {
    max-height: 80px;
    border: 2px solid var(--a-gray-200);
    border-radius: var(--a-radius);
    padding: 4px;
}

.a-file-drop {
    border: 2px dashed var(--a-gray-400);
    border-radius: var(--a-radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--a-transition);
}

.a-file-drop:hover {
    border-color: var(--a-cyan);
    background: rgba(64, 206, 227, 0.04);
}

.a-file-drop i {
    font-size: 2rem;
    color: var(--a-gray-400);
    display: block;
    margin-bottom: 8px;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
    .a-sidebar {
        left: -var(--a-sidebar-w);
    }

    .a-sidebar.mobile-open {
        left: 0;
    }

    .a-main-wrapper {
        margin-left: 0;
    }

    .a-login-wrap {
        grid-template-columns: 1fr;
    }

    .a-login-left {
        display: none;
    }

    .a-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 540px) {
    .a-page-content {
        padding: 16px;
    }

    .a-stats-grid {
        grid-template-columns: 1fr;
    }

    .a-form-grid {
        grid-template-columns: 1fr;
    }
}