/* ========================================
   STANDALONE ADMIN TEMPLATE CSS - UPDATED
   Modern, premium admin dashboard styling
   All classes prefixed with 'admt-' to avoid conflicts
   FIXED: Proper centering for single and multiple cards
   ======================================== */

/* ========================================
   1. EASY COLOR CUSTOMIZATION
   Change these colors to match your brand
   ======================================== */
:root {
    /* PRIMARY BRAND COLORS - Change these to customize */
    --admt-primary-color: #4f46e5;          /* Main brand color (Indigo) */
    --admt-primary-hover: #4338ca;          /* Darker on hover */
    --admt-secondary-color: #06b6d4;        /* Accent color (Cyan) */
    --admt-success-color: #10b981;          /* Success/Green actions */
    --admt-warning-color: #f59e0b;          /* Warning/Orange alerts */
    --admt-danger-color: #ef4444;           /* Danger/Red urgent */
    --admt-info-color: #3b82f6;             /* Info/Blue */
    
    /* BUTTON PALETTE - Easy to change individual button colors */
    --admt-btn-settings: #6366f1;           /* Settings button */
    --admt-btn-statistics: #8b5cf6;         /* Statistics buttons */
    --admt-btn-suppliers: #ec4899;          /* Suppliers buttons */
    --admt-btn-inventory: #14b8a6;          /* Inventory buttons */
    --admt-btn-reports: #f97316;            /* Reports buttons */
    --admt-btn-management: #0ea5e9;         /* Management buttons */
    
    /* BACKGROUND COLORS */
    --admt-bg-main: #f8fafc;                /* Main page background */
    --admt-bg-card: #ffffff;                /* Card background */
    --admt-bg-section-header: linear-gradient(135deg, #4a69f5 0%, #7274fa 100%);  /* Section headers */
    
    /* TEXT COLORS */
    --admt-text-primary: #0f172a;           /* Main text */
    --admt-text-secondary: #64748b;         /* Secondary text */
    --admt-text-light: #94a3b8;             /* Light text */
    --admt-text-white: #ffffff;             /* White text */
    
    /* NEUTRAL COLORS */
    --admt-gray-50: #f9fafb;
    --admt-gray-100: #f3f4f6;
    --admt-gray-200: #e5e7eb;
    --admt-gray-300: #d1d5db;
    --admt-gray-400: #9ca3af;
    --admt-gray-500: #6b7280;
    --admt-gray-600: #4b5563;
    --admt-gray-700: #374151;
    --admt-gray-800: #1f2937;
    --admt-gray-900: #111827;
    
    /* SPACING SYSTEM */
    --admt-space-xs: 0.5rem;    /* 8px */
    --admt-space-sm: 0.75rem;   /* 12px */
    --admt-space-md: 1rem;      /* 16px */
    --admt-space-lg: 1.5rem;    /* 24px */
    --admt-space-xl: 2rem;      /* 32px */
    --admt-space-2xl: 3rem;     /* 48px */
    
    /* BORDER RADIUS */
    --admt-radius-sm: 0.375rem;   /* 6px */
    --admt-radius-md: 0.5rem;     /* 8px */
    --admt-radius-lg: 0.75rem;    /* 12px */
    --admt-radius-xl: 1rem;       /* 16px */
    --admt-radius-full: 9999px;   /* Fully rounded */
    
    /* SHADOWS */
    --admt-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --admt-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --admt-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --admt-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --admt-shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* TRANSITIONS */
    --admt-transition-fast: 150ms ease-in-out;
    --admt-transition-base: 250ms ease-in-out;
    --admt-transition-slow: 350ms ease-in-out;
}

/* ========================================
   2. GLOBAL RESETS & BASE STYLES
   ======================================== */
.admt-dashboard-wrapper * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ========================================
   3. MAIN DASHBOARD WRAPPER
   ======================================== */
.admt-dashboard-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--admt-space-xl);
    background: var(--admt-bg-main);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
}

/* ========================================
   4. ALERT COMPONENTS
   ======================================== */
.admt-alert {
    padding: var(--admt-space-lg);
    border-radius: var(--admt-radius-lg);
    margin-bottom: var(--admt-space-xl);
    border-left: 4px solid;
    box-shadow: var(--admt-shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.admt-alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: var(--admt-warning-color);
    color: #92400e;
}

.admt-alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: var(--admt-info-color);
    color: #1e40af;
}

.admt-alert-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--admt-space-md);
    width: 100%;
}

.admt-alert-content strong {
    font-weight: 700;
    font-size: 1.05rem;
}

.admt-alert-link {
    display: inline-flex;
    align-items: center;
    gap: var(--admt-space-xs);
    padding: var(--admt-space-sm) var(--admt-space-lg);
    background: var(--admt-warning-color);
    color: var(--admt-text-white);
    text-decoration: none;
    border-radius: var(--admt-radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all var(--admt-transition-base);
    box-shadow: var(--admt-shadow-sm);
}

.admt-alert-link:hover {
    background: #d97706;
    transform: translateY(-2px);
    box-shadow: var(--admt-shadow-lg);
}

/* ========================================
   5. SECTION CONTAINERS
   ======================================== */
.admt-section {
    background: var(--admt-bg-card);
    border-radius: var(--admt-radius-xl);
    margin-bottom: var(--admt-space-xl);
    box-shadow: var(--admt-shadow-lg);
    overflow: hidden;
    border: 1px solid var(--admt-gray-200);
    transition: all var(--admt-transition-base);
}

.admt-section:hover {
    box-shadow: var(--admt-shadow-xl);
    transform: translateY(-2px);
}

/* ========================================
   6. SECTION TOGGLE HEADER (CENTERED)
   ======================================== */
.admt-section-toggle {
    width: 100%;
    padding: var(--admt-space-lg) var(--admt-space-xl);
    background: var(--admt-bg-section-header);
    border: none;
    cursor: pointer;
    display: flex;
    justify-content: center;  /* CENTERED */
    align-items: center;
    position: relative;
    transition: all var(--admt-transition-base);
}

.admt-section-toggle:hover {
    filter: brightness(1.1);
}

.admt-section-toggle:active {
    transform: scale(0.98);
}

.admt-section-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--admt-text-white);
    text-align: center;  /* CENTERED */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex: 1;
}

.admt-chevron {
    width: 28px;
    height: 28px;
    transition: transform var(--admt-transition-base);
    stroke: var(--admt-text-white);
    position: absolute;
    right: var(--admt-space-lg);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* ========================================
   7. COLLAPSIBLE CONTENT AREA
   ======================================== */
.admt-section-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--admt-transition-slow) cubic-bezier(0.4, 0, 0.2, 1),
                padding var(--admt-transition-base);
    padding: 0;
}

.admt-section-content.admt-section-active {
    max-height: 3000px;
    padding: var(--admt-space-2xl) var(--admt-space-xl);
}

/* ========================================
   8. CENTERED GRID SYSTEM (FIXED FOR SINGLE & MULTIPLE CARDS)
   ======================================== */
.admt-grid-container {
    display: flex;
    justify-content: center;  /* Centers the grid horizontally */
    width: 100%;
}

.admt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
    gap: var(--admt-space-lg);
    width: 100%;
    max-width: 1200px;
    justify-content: center;  /* ✅ Centers cards when fewer than full row */
    justify-items: center;    /* ✅ Centers each card in its cell */
}

/* ========================================
   9. CARD COMPONENTS (MODERN DESIGN)
   ======================================== */
.admt-card {
    background: var(--admt-bg-card);
    border: 1px solid var(--admt-gray-200);
    border-radius: var(--admt-radius-lg);
    box-shadow: var(--admt-shadow-md);
    transition: all var(--admt-transition-base);
    overflow: hidden;
    width: 100%;
    max-width: 320px;  /* ✅ Consistent card width */
    position: relative;
}

.admt-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--admt-primary-color), var(--admt-secondary-color));
    opacity: 0;
    transition: opacity var(--admt-transition-base);
}

.admt-card:hover::before {
    opacity: 1;
}

.admt-card:hover {
    box-shadow: var(--admt-shadow-xl);
    transform: translateY(-4px) scale(1.02);
    border-color: var(--admt-primary-color);
}

.admt-card-single {
    background: var(--admt-bg-card);
    border: 1px solid var(--admt-gray-200);
    border-radius: var(--admt-radius-lg);
    box-shadow: var(--admt-shadow-md);
    margin-bottom: var(--admt-space-xl);
    padding: var(--admt-space-xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.admt-card-content {
    padding: var(--admt-space-xl);
    display: flex;
    flex-direction: column;
    gap: var(--admt-space-md);
    align-items: center;  /* CENTERS CONTENT */
    justify-content: center;  /* CENTERS CONTENT */
    text-align: center;  /* CENTERS TEXT */
}

/* ========================================
   10. STATISTICS DISPLAY
   ======================================== */
.admt-stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--admt-text-primary);
    margin: 0 0 var(--admt-space-sm) 0;
    background: linear-gradient(135deg, var(--admt-primary-color), var(--admt-secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.admt-stat-highlight {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.admt-stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--admt-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--admt-space-sm);
}

/* ========================================
   11. MODERN BUTTON STYLES
   ======================================== */
.admt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--admt-space-xs);
    padding: var(--admt-space-md) var(--admt-space-xl);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--admt-radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--admt-transition-base);
    box-shadow: var(--admt-shadow-md);
    position: relative;
    overflow: hidden;
    min-width: 180px;
}

.admt-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.admt-btn:hover::before {
    width: 300px;
    height: 300px;
}

.admt-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--admt-shadow-xl);
}

.admt-btn:active {
    transform: translateY(0);
}

/* Button Color Variants */
.admt-btn-settings {
    background: linear-gradient(135deg, var(--admt-btn-settings), #4f46e5);
    color: var(--admt-text-white);
}

.admt-btn-statistics {
    background: linear-gradient(135deg, var(--admt-btn-statistics), #7c3aed);
    color: var(--admt-text-white);
}

.admt-btn-suppliers {
    background: linear-gradient(135deg, var(--admt-btn-suppliers), #db2777);
    color: var(--admt-text-white);
}

.admt-btn-inventory {
    background: linear-gradient(135deg, var(--admt-btn-inventory), #0d9488);
    color: var(--admt-text-white);
}

.admt-btn-reports {
    background: linear-gradient(135deg, var(--admt-btn-reports), #ea580c);
    color: var(--admt-text-white);
}

.admt-btn-management {
    background: linear-gradient(135deg, var(--admt-btn-management), #0284c7);
    color: var(--admt-text-white);
}

.admt-btn-primary {
    background: linear-gradient(135deg, var(--admt-primary-color), var(--admt-primary-hover));
    color: var(--admt-text-white);
}

.admt-btn-warning {
    background: linear-gradient(135deg, var(--admt-warning-color), #d97706);
    color: var(--admt-text-white);
}

/* ========================================
   12. RESPONSIVE DESIGN
   ======================================== */

/* Extra Large Screens (1400px+) */
@media (min-width: 1400px) {
    .admt-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
    }
}

/* Large Desktop (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .admt-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
    }
}

/* Desktop (992px - 1199px) */
@media (max-width: 1199px) {
    .admt-dashboard-wrapper {
        padding: var(--admt-space-lg);
    }
    
    .admt-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 300px));
    }
}

/* Tablet (768px - 991px) */
@media (max-width: 991px) {
    .admt-dashboard-wrapper {
        padding: var(--admt-space-md);
    }
    
    .admt-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 280px));
        gap: var(--admt-space-md);
    }
    
    .admt-section-title {
        font-size: 1.1rem;
    }
    
    .admt-stat-number {
        font-size: 2rem;
    }
    
    .admt-section-content.admt-section-active {
        padding: var(--admt-space-xl) var(--admt-space-md);
    }
}

/* Mobile (576px - 767px) */
@media (max-width: 767px) {
    .admt-dashboard-wrapper {
        padding: var(--admt-space-sm);
    }
    
    .admt-grid {
        grid-template-columns: 1fr;
        gap: var(--admt-space-md);
    }
    
    .admt-card {
        max-width: 100%;
    }
    
    .admt-section-toggle {
        padding: var(--admt-space-md);
    }
    
    .admt-section-title {
        font-size: 1rem;
        letter-spacing: 0.5px;
    }
    
    .admt-chevron {
        width: 24px;
        height: 24px;
        right: var(--admt-space-md);
    }
    
    .admt-section-content.admt-section-active {
        padding: var(--admt-space-lg) var(--admt-space-sm);
    }
    
    .admt-card-content {
        padding: var(--admt-space-lg);
    }
    
    .admt-stat-number {
        font-size: 1.75rem;
    }
    
    .admt-btn {
        padding: var(--admt-space-sm) var(--admt-space-lg);
        font-size: 0.875rem;
        min-width: 160px;
    }
}

/* Small Mobile (below 576px) */
@media (max-width: 575px) {
    .admt-dashboard-wrapper {
        padding: var(--admt-space-xs);
    }
    
    .admt-section-title {
        font-size: 0.95rem;
    }
    
    .admt-stat-number {
        font-size: 1.5rem;
    }
    
    .admt-btn {
        width: 100%;
        min-width: auto;
    }
    
    .admt-alert-content {
        flex-direction: column;
    }
}

/* ========================================
   13. ACCESSIBILITY & FOCUS STATES
   ======================================== */
.admt-section-toggle:focus,
.admt-btn:focus {
    outline: 3px solid var(--admt-primary-color);
    outline-offset: 2px;
}

.admt-btn:focus-visible {
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.3);
}

/* ========================================
   14. PRINT STYLES
   ======================================== */
@media print {
    .admt-dashboard-wrapper {
        background: white;
        padding: 0;
    }
    
    .admt-section {
        box-shadow: none;
        page-break-inside: avoid;
    }
    
    .admt-section-toggle {
        display: none;
    }
    
    .admt-section-content {
        max-height: none !important;
        padding: var(--admt-space-md) !important;
    }
    
    .admt-card {
        box-shadow: none;
        border: 1px solid var(--admt-gray-300);
    }
}

/* ========================================
   15. UTILITY CLASSES
   ======================================== */
.admt-text-center { text-align: center; }
.admt-mt-sm { margin-top: var(--admt-space-sm); }
.admt-mt-md { margin-top: var(--admt-space-md); }
.admt-mt-lg { margin-top: var(--admt-space-lg); }
.admt-mb-sm { margin-bottom: var(--admt-space-sm); }
.admt-mb-md { margin-bottom: var(--admt-space-md); }
.admt-mb-lg { margin-bottom: var(--admt-space-lg); }

/* ========================================
   16. ANIMATIONS
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.admt-section-content.admt-section-active .admt-card {
    animation: fadeInUp 0.4s ease-out backwards;
}

.admt-section-content.admt-section-active .admt-card:nth-child(1) { animation-delay: 0.05s; }
.admt-section-content.admt-section-active .admt-card:nth-child(2) { animation-delay: 0.1s; }
.admt-section-content.admt-section-active .admt-card:nth-child(3) { animation-delay: 0.15s; }
.admt-section-content.admt-section-active .admt-card:nth-child(4) { animation-delay: 0.2s; }
.admt-section-content.admt-section-active .admt-card:nth-child(5) { animation-delay: 0.25s; }
.admt-section-content.admt-section-active .admt-card:nth-child(6) { animation-delay: 0.3s; }
.admt-section-content.admt-section-active .admt-card:nth-child(7) { animation-delay: 0.35s; }
.admt-section-content.admt-section-active .admt-card:nth-child(8) { animation-delay: 0.4s; }
.admt-section-content.admt-section-active .admt-card:nth-child(9) { animation-delay: 0.45s; }
.admt-section-content.admt-section-active .admt-card:nth-child(10) { animation-delay: 0.5s; }
