/* =====================================================================
   SCHOLLORA STORE - PROFESSIONAL ADMIN DASHBOARD STYLESHEET
   Enterprise Education Hardware Control Center
   ===================================================================== */

body.admin-body {
    background-color: #f1f5f9;
    color: #0f172a;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------------------------------------------------------------------
   1. APP-MATCHING ADMIN TOPBAR
   --------------------------------------------------------------------- */
.admin-topbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.admin-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1.75rem;
    gap: 1.25rem;
    height: 64px;
    box-sizing: border-box;
}

/* Brand Section */
.admin-brand-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.admin-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: transform 0.15s ease;
}

.admin-brand-logo:hover .admin-brand-icon {
    transform: scale(1.05);
}

.admin-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.admin-brand-heading {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.admin-brand-title {
    font-weight: 800;
    font-size: 1.05rem;
    color: #0f172a;
    letter-spacing: -0.4px;
}

.admin-brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #dbeafe;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.admin-brand-sub {
    font-size: 0.725rem;
    color: #64748b;
    font-weight: 500;
}

/* App-Style Search Pill */
.admin-search-wrap {
    flex: 1;
    max-width: 440px;
}

.admin-search-form {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.admin-search-icon {
    position: absolute;
    left: 0.85rem;
    width: 16px;
    height: 16px;
    color: #94a3b8;
    pointer-events: none;
}

.admin-search-input {
    width: 100%;
    height: 38px;
    padding: 0 1rem 0 2.5rem;
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 9999px;
    font-size: 0.8rem;
    color: #0f172a;
    font-family: inherit;
    outline: none;
    transition: all 0.15s ease;
}

.admin-search-input:focus {
    background: #ffffff;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.admin-search-input::placeholder {
    color: #94a3b8;
}

/* Mobile Admin Toggle */
.admin-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.admin-mobile-toggle:hover {
    background: #e2e8f0;
}

.admin-mobile-toggle .lucide {
    width: 20px;
    height: 20px;
}

/* Quick Add Button */
.admin-quick-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #2563eb;
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    height: 36px;
    padding: 0 1rem;
    border-radius: 9999px;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
    transition: background 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}

.admin-quick-add-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    color: #ffffff;
}

/* View Storefront Pill Button */
.admin-storefront-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #f8fafc;
    color: #475569;
    font-size: 0.8rem;
    font-weight: 600;
    height: 36px;
    padding: 0 0.9rem;
    border-radius: 9999px;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.admin-storefront-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

/* User Profile Menu Pill */
.admin-user-pill {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 0.25rem 0.75rem 0.25rem 0.35rem;
    border-radius: 9999px;
    transition: all 0.15s ease;
}

.admin-user-pill:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.admin-avatar {
    width: 28px;
    height: 28px;
    background: #2563eb;
    color: #ffffff;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 800;
}

.admin-user-info-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.admin-user-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
}

.admin-user-role {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 600;
}

/* Clean Sign Out Button */
.admin-logout-btn {
    background: transparent;
    color: #64748b;
    border: 1px solid #e2e8f0;
    height: 36px;
    padding: 0 0.85rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.15s ease;
}

.admin-logout-btn:hover {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

.admin-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.admin-sidebar-overlay.open {
    display: block;
    opacity: 1;
}

.admin-sidebar-mobile-header {
    display: none;
}

/* ---------------------------------------------------------------------
   2. ADMIN MAIN LAYOUT & SIDEBAR
   --------------------------------------------------------------------- */
.admin-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: calc(100vh - 60px);
    width: 100%;
}

.admin-flash-bar {
    width: 100%;
    padding: 1rem 2rem 0.5rem 2rem;
    box-sizing: border-box;
    background: #f8fafc;
}

.admin-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

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

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

.admin-alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    display: flex;
    align-items: center;
    padding: 0.2rem;
}

.admin-alert-close:hover {
    opacity: 1;
}

.admin-layout {
    display: flex;
    flex-direction: row;
    flex: 1;
    width: 100%;
    min-height: 0;
}

.admin-sidebar {
    width: 260px;
    background: #0f172a;
    border-right: 1px solid #1e293b;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.admin-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #1e293b;
}

.admin-nav-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 1.25rem 1.5rem 0.5rem 1.5rem;
}

.admin-nav {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.admin-nav-item a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s ease;
}

.admin-nav-item a:hover {
    background: #1e293b;
    color: #ffffff;
}

.admin-nav-item.active a {
    background: #1e3a8a;
    color: #ffffff;
    font-weight: 700;
}

.admin-nav-icon {
    font-size: 1.15rem;
}

/* ---------------------------------------------------------------------
   3. ADMIN CONTENT AREA
   --------------------------------------------------------------------- */
.admin-content {
    flex: 1;
    background: #f8fafc;
    padding: 2.25rem 3rem;
    overflow-y: auto;
}

.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-page-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.admin-page-subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

/* ---------------------------------------------------------------------
   4. METRIC KPI CARDS
   --------------------------------------------------------------------- */
.admin-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.25rem;
}

.metric-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.06);
    border-color: #cbd5e1;
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #3b82f6;
}

.metric-card.metric-sales::before { background: #059669; }
.metric-card.metric-orders::before { background: #2563eb; }
.metric-card.metric-customers::before { background: #7c3aed; }
.metric-card.metric-quotes::before { background: #d97706; }
.metric-card.metric-stock::before { background: #dc2626; }

.metric-label {
    font-size: 0.775rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.metric-value {
    font-size: 1.95rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

/* ---------------------------------------------------------------------
   5. TABLES & CARDS
   --------------------------------------------------------------------- */
.admin-table-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.admin-table-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.admin-table-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

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

.admin-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    font-size: 0.75rem;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
}

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

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

/* ---------------------------------------------------------------------
   6. STATUS BADGES
   --------------------------------------------------------------------- */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    border: 1px solid transparent;
}

.status-paid, .status-delivered, .status-completed {
    background: #ecfdf5;
    color: #047857;
    border-color: #a7f3d0;
}

.status-pending, .status-unpaid {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}

.status-shipped, .status-processing, .status-quoted {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

.status-cancelled, .status-declined {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

/* Dashboard Two-Column Grid */
.admin-dashboard-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 2rem;
}

@media (max-width: 1100px) {
    .admin-dashboard-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ---------------------------------------------------------------------
   7. ADMIN FOOTER
   --------------------------------------------------------------------- */
.admin-footer {
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    padding: 1rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #64748b;
}

@media (max-width: 992px) {
    .admin-mobile-toggle {
        display: flex;
    }
    .admin-hide-sm {
        display: none !important;
    }
    .admin-topbar-inner {
        padding: 0.65rem 1rem;
    }
    .admin-wrapper {
        display: block;
        width: 100%;
    }
    .admin-layout {
        display: block;
        width: 100%;
    }
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: -290px;
        width: 275px;
        height: 100vh;
        z-index: 1100;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
        transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }
    .admin-sidebar.open {
        left: 0 !important;
    }
    .admin-sidebar-mobile-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 1.25rem 1.25rem 0.75rem 1.25rem;
        border-bottom: 1px solid #1e293b;
    }
    .admin-sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
        background: #1e293b;
        border: 1px solid #334155;
        color: #ffffff;
        border-radius: 6px;
        width: 32px;
        height: 32px;
        cursor: pointer;
    }
    .admin-content {
        padding: 1.25rem 0.85rem !important;
        width: 100% !important;
        max-width: 100vw !important;
        box-sizing: border-box;
    }
    .admin-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    .admin-page-title {
        font-size: 1.45rem;
    }
    .admin-metrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        margin-bottom: 1.5rem;
    }
    .metric-card {
        padding: 1.15rem;
    }
    .metric-value {
        font-size: 1.45rem;
    }
    .admin-table-card {
        padding: 1rem 0.75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
    }
    .admin-table {
        min-width: 620px;
    }
    .admin-footer {
        flex-direction: column;
        gap: 0.5rem;
        padding: 1rem;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .admin-metrics-grid {
        grid-template-columns: 1fr !important;
    }
    .admin-content {
        padding: 1rem 0.65rem !important;
    }
}
