/**
 * Brookfield Institute UAE - Master Institutional ERP Theme & Stylesheet
 * Approved by Government of Ras Al Khaimah (RAK), UAE - Educational License No. 52001014
 */

:root {
    --primary: #0A192F;
    --primary-dark: #07111E;
    --primary-light: #172A45;
    --accent: #C5A869;
    --accent-hover: #D8BD7F;
    --accent-glow: rgba(197, 168, 105, 0.25);
    --bg-slate: #F8FAFC;
    --border: #E2E8F0;
    --border-dark: #1E293B;
    --text-dark: #0F172A;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --success: #059669;
    --success-bg: #D1FAE5;
    --warning: #D97706;
    --warning-bg: #FEF3C7;
    --danger: #DC2626;
    --danger-bg: #FEE2E2;
    --info: #2563EB;
    --info-bg: #DBEAFE;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: var(--bg-slate);
    color: var(--text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Master ERP Shell Layout */
.admin-wrapper,
.admin-app-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--bg-slate);
    width: 100%;
}

/* Master Sidebar Navigation */
.admin-sidebar {
    width: 260px;
    min-width: 260px;
    background: var(--primary);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    border-right: 1px solid var(--border-dark);
}

.sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-dark);
    display: flex;
    align-items: center;
}

.sidebar-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    background: white;
    padding: 3px 6px;
    border-radius: 6px;
}

.brand-text h3 {
    font-size: 15px;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0;
    letter-spacing: 0.3px;
}

.brand-text span {
    font-size: 10.5px;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-user-pill {
    margin: 16px 18px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}

.user-meta {
    min-width: 0;
    flex: 1;
}

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

.user-role-badge {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10B981;
    display: inline-block;
}

.sidebar-nav {
    padding: 8px 14px;
    flex: 1;
}

.nav-section-title {
    font-size: 9.5px;
    font-weight: 800;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 14px 8px 4px 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #CBD5E1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.sidebar-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
}

.sidebar-item.active {
    background: var(--accent);
    color: var(--primary);
    font-weight: 800;
}

.item-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
    display: inline-block;
}

.sidebar-badge {
    margin-left: auto;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
}

.sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--border-dark);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #EF4444;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.15s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Main Content Area */
.admin-main,
.admin-main-viewport {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.top-header,
.admin-top-header {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.header-title h1,
.admin-top-header h2 {
    font-size: 19px;
    font-weight: 800;
    color: var(--primary);
    margin: 0;
}

.header-title p,
.admin-top-header span {
    font-size: 12.5px;
    color: var(--text-muted);
    margin: 2px 0 0 0;
}

.content-body,
.container {
    padding: 24px 32px;
    max-width: 1500px;
    width: 100%;
    margin: 0 auto;
}

/* KPI Cards Grid */
.kpi-grid,
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: #FFFFFF;
    padding: 20px 22px;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.kpi-title,
.kpi-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.kpi-value,
.kpi-val {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
}

.kpi-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Cards & Panels */
.card,
.main-card {
    background: #FFFFFF;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    padding: 24px;
    margin-bottom: 24px;
}

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

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    background: var(--bg-slate);
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.data-table tr:hover {
    background: #FAFAFA;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--primary);
    color: #FFFFFF;
    border: 1px solid var(--accent);
}

.btn-primary:hover {
    background: var(--primary-light);
    color: #FFFFFF;
}

.btn-secondary {
    background: #F1F5F9;
    color: var(--text-dark);
    border: 1px solid var(--border);
}

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

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  }
.badge-info    { background: var(--info-bg);    color: var(--info);    }

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

.form-control,
.input-control,
.input-search,
.select-filter {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 13.5px;
    background: #FFFFFF;
    color: var(--text-dark);
    transition: border-color 0.15s ease;
}

.form-control:focus,
.input-control:focus,
.input-search:focus,
.select-filter:focus {
    outline: none;
    border-color: var(--accent);
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success { background: var(--success-bg); color: #065F46; border: 1px solid #A7F3D0; }
.alert-danger  { background: var(--danger-bg);  color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: var(--warning-bg); color: #92400E; border: 1px solid #FDE68A; }

/* Tabs Nav */
.tabs-nav {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tab-item {
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s ease;
}

.tab-item:hover {
    color: var(--primary);
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--accent);
}

/* Responsive */
@media (max-width: 1024px) {
    .admin-sidebar {
        display: none;
    }
    .admin-wrapper,
    .admin-app-wrapper {
        flex-direction: column;
    }
    .content-body,
    .container {
        padding: 16px 20px;
    }
}
