/* ==========================================================================
   IMPLUS - Master Administration Console Stylesheet (Executive Architectural)
   ========================================================================== */

/* 1. RESET & CSS VARIABLES FOR ADMIN */
:root {
    --admin-navy-950: #050e17;
    --admin-navy-900: #07131e;
    --admin-navy-850: #0b1a28;
    --admin-navy-800: #0f2336;
    --admin-navy-700: #14324c;
    --admin-navy-600: #1a5783;
    
    --admin-gold-500: #c9bda7;
    --admin-gold-400: #d8cebe;
    --admin-gold-300: #e6dfd5;
    --admin-gold-100: #faf7f2;
    --admin-gold-dark: #8c7b64;

    --admin-bg: #f4f6fa;
    --admin-card-bg: #ffffff;
    --admin-border: #e2e8f0;
    --admin-border-subtle: #edf2f7;
    
    --admin-text-main: #0f172a;
    --admin-text-muted: #64748b;
    --admin-text-light: #94a3b8;
    
    --font-heading: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* 2. BASE & ADMIN LAYOUT */
body.admin-body {
    background-color: var(--admin-bg);
    color: var(--admin-text-main);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
    background-color: var(--admin-bg);
    position: relative;
    width: 100%;
}

/* 3. SIDEBAR STYLING */
.admin-sidebar {
    width: 270px;
    min-width: 270px;
    background-color: var(--admin-navy-900);
    background-image: linear-gradient(180deg, #07131e 0%, #050d15 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(201, 189, 167, 0.12);
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-sidebar::-webkit-scrollbar {
    width: 4px;
}
.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(201, 189, 167, 0.2);
    border-radius: 2px;
}

.admin-brand {
    padding: 1.75rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.admin-brand-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
    object-position: left;
}

.admin-brand-tag {
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--admin-gold-500);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.admin-brand-tag::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.25rem 1rem;
    flex: 1;
}

.admin-nav-section-title {
    font-family: var(--font-heading);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--admin-text-light);
    opacity: 0.6;
    padding: 0.75rem 0.85rem 0.25rem;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.admin-nav-item svg {
    flex-shrink: 0;
    stroke: currentColor;
    opacity: 0.8;
    transition: stroke 0.2s ease, opacity 0.2s ease;
}

.admin-nav-item:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
    border-left-color: rgba(201, 189, 167, 0.4);
}

.admin-nav-item:hover svg {
    opacity: 1;
    stroke: var(--admin-gold-500);
}

.admin-nav-item.active {
    color: #ffffff;
    background: linear-gradient(90deg, rgba(201, 189, 167, 0.16) 0%, rgba(201, 189, 167, 0.04) 100%);
    font-weight: 600;
    border-left-color: var(--admin-gold-500);
}

.admin-nav-item.active svg {
    opacity: 1;
    stroke: var(--admin-gold-500);
}

.admin-nav-badge {
    margin-left: auto;
    background: var(--admin-gold-500);
    color: var(--admin-navy-950);
    font-family: var(--font-heading);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    line-height: 1;
}

.admin-sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.825rem;
    color: var(--admin-gold-300);
    text-decoration: none;
    transition: color 0.2s ease;
    padding: 0.4rem 0.5rem;
    border-radius: 3px;
}

.admin-sidebar-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.admin-sidebar-link.logout {
    color: #fca5a5;
}

.admin-sidebar-link.logout:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
}

/* 4. MAIN CONTENT AREA */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background-color: var(--admin-bg);
}

.admin-topbar {
    height: 70px;
    background: #ffffff;
    border-bottom: 1px solid var(--admin-border);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: 0 1px 4px rgba(10, 27, 42, 0.03);
}

.admin-topbar-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.admin-topbar-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--admin-navy-900);
    margin: 0;
    letter-spacing: -0.01em;
}

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-user-pill {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    background: #f8fafc;
    border: 1px solid var(--admin-border);
    padding: 0.35rem 0.85rem;
    border-radius: 4px;
    font-size: 0.825rem;
    color: var(--admin-text-muted);
}

.admin-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--admin-navy-900);
    color: var(--admin-gold-500);
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-content {
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    flex: 1;
}

/* 5. CARDS & SECTIONS */
.admin-card {
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(10, 27, 42, 0.03);
    padding: 1.75rem;
    margin-bottom: 1.75rem;
}

.admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--admin-border-subtle);
}

.admin-card-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--admin-navy-900);
    margin: 0;
}

.admin-card-desc {
    font-size: 0.875rem;
    color: var(--admin-text-muted);
    margin: 0.25rem 0 0;
}

/* 6. STAT METRICS GRID */
.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .admin-stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .admin-stat-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.admin-stat-card {
    background: #ffffff;
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(10, 27, 42, 0.03);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    overflow: hidden;
}

.admin-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10, 27, 42, 0.06);
    border-color: rgba(201, 189, 167, 0.5);
}

.admin-stat-card.alert-card {
    background: linear-gradient(135deg, #ffffff 0%, #fdf8f4 100%);
    border-color: rgba(201, 189, 167, 0.6);
}

.admin-stat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.admin-stat-label {
    font-family: var(--font-heading);
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--admin-text-muted);
}

.admin-stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: #f1f5f9;
    color: var(--admin-navy-900);
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-stat-card.alert-card .admin-stat-icon {
    background: rgba(201, 189, 167, 0.25);
    color: var(--admin-gold-dark);
}

.admin-stat-number {
    font-family: var(--font-heading);
    font-size: 2.35rem;
    font-weight: 800;
    color: var(--admin-navy-900);
    line-height: 1;
    margin: 0.25rem 0 0.85rem;
}

.admin-stat-link {
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--admin-navy-600);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.15s ease, transform 0.15s ease;
}

.admin-stat-link:hover {
    color: var(--admin-navy-900);
    transform: translateX(3px);
}

/* 7. TABLES & DATA */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    background: #ffffff;
}

.admin-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
    font-size: 0.875rem;
}

.admin-table th {
    background: #f8fafc;
    color: #475569;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.95rem 1.25rem;
    border-bottom: 1px solid var(--admin-border);
    white-space: nowrap;
}

.admin-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--admin-border-subtle);
    color: var(--admin-text-main);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tbody tr {
    transition: background-color 0.15s ease;
}

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

/* 8. BUTTONS & ACTIONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 0.825rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 0.65rem 1.35rem;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    line-height: 1.2;
}

.btn-primary {
    background: var(--admin-navy-900);
    color: #ffffff !important;
    border-color: var(--admin-navy-900);
    box-shadow: 0 2px 6px rgba(7, 19, 30, 0.15);
}

.btn-primary:hover {
    background: var(--admin-navy-700);
    border-color: var(--admin-navy-700);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(7, 19, 30, 0.2);
}

.btn-secondary {
    background: linear-gradient(135deg, #e4dacf 0%, #c9bda7 100%);
    color: var(--admin-navy-950) !important;
    border-color: var(--admin-gold-500);
    font-weight: 700;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #eee6dc 0%, #d8cebe 100%);
    transform: translateY(-1px);
}

.btn-outline {
    background: #ffffff;
    color: var(--admin-navy-900) !important;
    border-color: var(--admin-border);
}

.btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--admin-navy-950) !important;
}

.btn-outline-danger {
    background: #ffffff;
    color: #dc2626 !important;
    border-color: #fecaca;
}

.btn-outline-danger:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.775rem;
}

/* 9. BADGES & LABELS */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 3px;
    font-family: var(--font-heading);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1;
}

.badge-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.badge-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.badge-gold {
    background: var(--admin-gold-100);
    color: var(--admin-gold-dark);
    border: 1px solid var(--admin-gold-400);
}

/* 10. FORMS SYSTEM */
.form-group {
    margin-bottom: 1.35rem;
}

.form-label {
    display: block;
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--admin-navy-900);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.925rem;
    font-family: var(--font-sans);
    color: var(--admin-text-main);
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    box-sizing: border-box;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

.form-control:focus {
    border-color: var(--admin-navy-600);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 87, 131, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 90px;
    line-height: 1.6;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
    padding-right: 2.5rem;
    appearance: none;
    -webkit-appearance: none;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
}

.form-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border-radius: 3px;
    border: 1px solid #cbd5e1;
    accent-color: var(--admin-navy-900);
    cursor: pointer;
}

/* 11. ALERTS & FLASH MESSAGES */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.925rem;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

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

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

/* 12. RESPONSIVE GRID UTILITIES */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}
.grid-4 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
}

@media (min-width: 768px) {
    .grid-2, .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
}

@media (min-width: 1024px) {
    .grid-3, .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
    .grid-4, .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr) !important; }
    .lg\:hidden { display: none !important; }
}

/* 13. MOBILE SIDEBAR DRAWER & BACKDROP */
.admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 19, 30, 0.65);
    backdrop-filter: blur(4px);
    z-index: 95;
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media (max-width: 1023px) {
    .admin-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-100%);
        box-shadow: 0 0 35px rgba(0, 0, 0, 0.5);
    }
    
    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
    
    .admin-topbar {
        padding: 0 1.25rem;
    }

    .admin-content {
        padding: 1.25rem;
    }
}

/* 14. LOGIN VIEW SPECIALIZED STYLING */
.admin-login-body {
    background: radial-gradient(ellipse at 50% 20%, #11293e 0%, #07131e 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    font-family: var(--font-sans);
    position: relative;
    overflow: hidden;
}

.admin-login-body::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(rgba(201, 189, 167, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 189, 167, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.admin-login-card {
    background: rgba(11, 26, 40, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    max-width: 440px;
    border-radius: 6px;
    border: 1px solid rgba(201, 189, 167, 0.22);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 3rem 2.5rem;
    position: relative;
    z-index: 10;
}

.admin-login-header {
    text-align: center;
    margin-bottom: 2.25rem;
}

.admin-login-logo {
    height: 40px;
    width: auto;
    margin: 0 auto 1.5rem;
    display: block;
}

.admin-login-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 0.5rem;
    letter-spacing: -0.01em;
}

.admin-login-subtitle {
    font-size: 0.85rem;
    color: var(--admin-gold-300);
    margin: 0;
}

.admin-login-card .form-label {
    color: #e2e8f0;
}

.admin-login-card .form-control {
    background: rgba(7, 19, 30, 0.7);
    border-color: rgba(201, 189, 167, 0.3);
    color: #ffffff;
}

.admin-login-card .form-control:focus {
    border-color: var(--admin-gold-500);
    box-shadow: 0 0 0 3px rgba(201, 189, 167, 0.2);
}

.admin-login-card .btn-primary {
    background: linear-gradient(135deg, #e4dacf 0%, #c9bda7 100%);
    color: var(--admin-navy-950) !important;
    border: none;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.85rem;
    box-shadow: 0 4px 15px rgba(201, 189, 167, 0.25);
}

.admin-login-card .btn-primary:hover {
    background: linear-gradient(135deg, #f0e8de 0%, #d8cebe 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(201, 189, 167, 0.4);
}
