/* ==========================================================================
   Admin Portal Stylesheet - Bharat Electricity Engineers Association (BEEA)
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --admin-primary: #082040;
    --admin-sidebar: #0b2246;
    --admin-sidebar-hover: rgba(251, 191, 36, 0.12);
    --admin-accent: #f59e0b;
    --admin-accent-dark: #d97706;
    --admin-bg: #f4f6f9;
    --admin-surface: #ffffff;
    --admin-border: #cbd5e1;
    --admin-border-light: #e2e8f0;
    --admin-text: #0f172a;
    --admin-text-secondary: #334155;
    --admin-muted: #64748b;
    --admin-navy: #082040;
}

body.admin-body {
    background-color: var(--admin-bg);
    color: var(--admin-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    min-height: 100vh;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background-color: var(--admin-sidebar);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-brand {
    padding: 1.25rem 1.5rem;
    background-color: var(--admin-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 3px solid var(--admin-accent);
}

.admin-brand h2 {
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
    letter-spacing: 0.5px;
}

.admin-nav {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.admin-nav-item a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1.5rem;
    color: #cbd5e1;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
}

.admin-nav-item a:hover,
.admin-nav-item.active a {
    background: var(--admin-sidebar-hover);
    color: #fbbf24;
    border-left: 4px solid var(--admin-accent);
}

.admin-sidebar-footer {
    padding: 1.25rem 1.5rem;
    background-color: var(--admin-primary);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

/* Main Content Wrapper */
.admin-main {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--admin-bg);
}

.admin-topbar {
    background-color: var(--admin-surface);
    border-bottom: 1px solid var(--admin-border-light);
    padding: 0.85rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 900;
}

.admin-content {
    padding: 2rem;
    flex: 1;
    max-width: 1400px;
    width: 100%;
}

/* Flash Alerts */
.flash-alert {
    padding: 0.9rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.flash-success {
    background-color: #f0fdf4;
    color: #166534;
    border-color: #bbf7d0;
}

.flash-danger {
    background-color: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.flash-warning {
    background-color: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.flash-info {
    background-color: #f0f9ff;
    color: #0369a1;
    border-color: #bae6fd;
}

/* Stat Cards */
.admin-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.admin-stat-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border-light);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.admin-stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.admin-stat-num {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--admin-text);
    line-height: 1;
}

.admin-stat-label {
    font-size: 0.825rem;
    color: var(--admin-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* Content Cards */
.admin-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border-light);
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    overflow: hidden;
    margin-bottom: 2rem;
}

.admin-card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--admin-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #ffffff;
}

.admin-card-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--admin-text);
    margin: 0;
}

/* Data Tables */
.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    background-color: #f8fafc;
    padding: 0.85rem 1.25rem;
    text-align: left;
    font-weight: 700;
    color: #334155;
    border-bottom: 1px solid var(--admin-border-light);
    font-size: 0.825rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

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

.action-btns {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* ==========================================================================
   FORM CONTROLS & LAYOUT (Complete, Modern Styling)
   ========================================================================== */

.admin-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
    margin-bottom: 0.25rem;
}

.form-group {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.45rem;
}

.form-control,
input[type="text"].form-control,
input[type="password"].form-control,
input[type="email"].form-control,
input[type="date"].form-control,
input[type="number"].form-control,
input[type="file"].form-control,
select.form-control,
textarea.form-control {
    display: block;
    width: 100%;
    padding: 0.65rem 0.9rem;
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.5;
    color: #0f172a;
    background-color: #ffffff;
    background-clip: padding-box;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    outline: none;
}

.form-control:focus,
input[type="text"].form-control:focus,
input[type="password"].form-control:focus,
input[type="email"].form-control:focus,
input[type="date"].form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.18);
    background-color: #ffffff;
}

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

select.form-control {
    appearance: auto;
    background-color: #ffffff;
    cursor: pointer;
}

input[type="file"].form-control {
    padding: 0.45rem 0.65rem;
    font-size: 0.85rem;
    cursor: pointer;
    background-color: #f8fafc;
}

/* Checkboxes & Radios */
input[type="checkbox"],
input[type="radio"] {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--admin-primary);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 1.4rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 6px;
    cursor: pointer;
    border: 1.5px solid transparent;
    text-decoration: none !important;
    transition: all 0.15s ease;
    line-height: 1.4;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--admin-primary);
    color: #ffffff !important;
    border-color: var(--admin-primary);
    box-shadow: 0 1px 3px rgba(8, 32, 64, 0.2);
}

.btn-primary:hover {
    background-color: #0c2b54;
    border-color: #0c2b54;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(8, 32, 64, 0.25);
}

.btn-outline {
    background-color: #ffffff;
    color: #334155 !important;
    border-color: #cbd5e1;
}

.btn-outline:hover {
    background-color: #f1f5f9;
    color: #0f172a !important;
    border-color: #94a3b8;
}

.btn-danger {
    background-color: #ef4444;
    color: #ffffff !important;
    border-color: #ef4444;
}

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

.btn-success {
    background-color: #10b981;
    color: #ffffff !important;
    border-color: #10b981;
}

.btn-success:hover {
    background-color: #059669;
    border-color: #059669;
    color: #ffffff !important;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 5px;
}

/* ==========================================================================
   BADGES & CHIPS
   ========================================================================== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 9999px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-navy {
    background-color: var(--admin-navy);
    color: #ffffff;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

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

.badge-info {
    background-color: #e0f2fe;
    color: #075985;
    border: 1px solid #bae6fd;
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */

@media (max-width: 992px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .admin-content {
        padding: 1.25rem;
    }
    .admin-form-row {
        grid-template-columns: 1fr;
    }
}
