/* ==========================================================================
   ADMIN DASHBOARD CSS - CLEAN MODERN & BRIGHT AESTHETICS
   ========================================================================== */

:root {
    --admin-primary: #0284c7;
    --admin-primary-dark: #0369a1;
    --admin-primary-light: #e0f2fe;
    --admin-accent: #f97316;
    --admin-success: #10b981;
    --admin-danger: #ef4444;
    --admin-warning: #f59e0b;
    
    --admin-sidebar-bg: #0f172a;
    --admin-sidebar-text: #94a3b8;
    --admin-sidebar-active: #ffffff;
    --admin-sidebar-active-bg: #1e293b;

    --admin-body-bg: #f8fafc;
    --admin-card-bg: #ffffff;
    --admin-border: #e2e8f0;
    --admin-text-main: #0f172a;
    --admin-text-muted: #64748b;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px -2px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.12);

    --font-admin: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-admin);
}

body.admin-body {
    background-color: var(--admin-body-bg);
    color: var(--admin-text-main);
    display: flex;
    min-height: 100vh;
    font-size: 14px;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background: var(--admin-sidebar-bg);
    color: var(--admin-sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    height: 70px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-close-btn {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.admin-mobile-toggle {
    display: none;
    background: white;
    border: 1px solid var(--admin-border);
    color: var(--admin-text-main);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.admin-mobile-toggle:hover {
    background: var(--admin-body-bg);
    border-color: #cbd5e1;
}

.admin-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.admin-sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

.sidebar-logo-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--admin-primary), #38bdf8);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.sidebar-logo-text {
    font-size: 16px;
    font-weight: 800;
    color: white;
    letter-spacing: -0.2px;
}

.sidebar-menu {
    list-style: none;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.menu-heading {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #64748b;
    padding: 12px 14px 6px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--admin-sidebar-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.2s ease;
}

.menu-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.menu-link.active {
    background: var(--admin-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--admin-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-name {
    font-weight: 700;
    color: white;
    font-size: 13px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.user-role {
    font-size: 11px;
    color: #64748b;
    text-transform: capitalize;
}

/* Main Content Area */
.admin-main {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Navbar */
.admin-topbar {
    height: 70px;
    background: white;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.topbar-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--admin-text-main);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Page Content */
.admin-content {
    padding: 28px;
    flex: 1;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.page-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--admin-text-main);
}

.page-subtitle {
    font-size: 13px;
    color: var(--admin-text-muted);
    margin-top: 4px;
}

/* Metric Cards */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.metric-card {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease;
}

.metric-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.metric-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.metric-icon.blue { background: linear-gradient(135deg, #0284c7, #38bdf8); }
.metric-icon.emerald { background: linear-gradient(135deg, #10b981, #34d399); }
.metric-icon.coral { background: linear-gradient(135deg, #f97316, #fb923c); }
.metric-icon.purple { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }

.metric-data {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--admin-text-main);
    line-height: 1.1;
}

.metric-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--admin-text-muted);
    margin-top: 4px;
}

/* Card Panel */
.panel {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
    overflow: hidden;
}

.panel-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--admin-text-main);
}

.panel-body {
    padding: 24px;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.admin-table th {
    background: #f8fafc;
    padding: 12px 18px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--admin-text-muted);
    border-bottom: 1px solid var(--admin-border);
}

.admin-table td {
    padding: 14px 18px;
    font-size: 13px;
    border-bottom: 1px solid var(--admin-border);
    vertical-align: middle;
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
}

.badge-blue { background: #e0f2fe; color: #0284c7; }
.badge-green { background: #d1fae5; color: #059669; }
.badge-orange { background: #ffedd5; color: #ea580c; }
.badge-purple { background: #f3e8ff; color: #7c3aed; }
.badge-gray { background: #f1f5f9; color: #64748b; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--admin-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--admin-primary-dark);
}

.btn-danger {
    background: #fef2f2;
    color: var(--admin-danger);
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background: var(--admin-danger);
    color: white;
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--admin-text-main);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* Forms */
.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--admin-text-main);
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--admin-border);
    outline: none;
    background: white;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Multi-Photo Upload Dropzone */
.dropzone-box {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 36px 20px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dropzone-box:hover, .dropzone-box.dragover {
    border-color: var(--admin-primary);
    background: #f0f9ff;
}

.dropzone-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    background: #e0f2fe;
    color: var(--admin-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.preview-item {
    position: relative;
    height: 120px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--admin-border);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Alert Notification */
.alert {
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Login Card Spec */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #fdf4ff 100%);
    padding: 24px;
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 440px;
    width: 100%;
    padding: 36px;
    position: relative;
    border: 1px solid var(--admin-border);
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #0284c7, #38bdf8, #f97316);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

/* ==========================================================================
   RESPONSIVE MEDIA QUERIES (TABLETS & PHONES)
   ========================================================================== */

@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    }

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

    .sidebar-close-btn {
        display: flex;
    }

    .admin-mobile-toggle {
        display: flex;
    }

    .admin-main {
        margin-left: 0;
        width: 100%;
    }

    .admin-topbar {
        padding: 0 16px;
        height: 64px;
    }

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

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .panel-header .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .topbar-title {
        font-size: 15px;
        max-width: 180px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-actions .btn {
        padding: 7px 10px;
        font-size: 12px;
    }

    .topbar-btn-web .btn-text {
        display: none;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .metric-card {
        padding: 16px;
    }

    .metric-number {
        font-size: 24px;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .page-header .btn {
        width: 100%;
        justify-content: center;
    }

    /* Stack form grid columns to single column on mobile */
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns: 1fr 2fr"],
    div[style*="grid-template-columns: 2fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    .admin-table th,
    .admin-table td {
        padding: 12px 14px;
        font-size: 13px;
    }

    .login-card {
        padding: 24px 20px;
    }
}

@media (max-width: 480px) {
    .topbar-title {
        max-width: 130px;
        font-size: 14px;
    }

    .topbar-actions .btn-text {
        display: none;
    }

    .admin-topbar {
        padding: 0 12px;
    }

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

    .panel-body {
        padding: 16px;
    }

    .dropzone-box {
        padding: 24px 16px;
    }
}
