/* ==========================================================================
   Al-Ola Tech (العلا تيك) — Clean Unified Design System v2
   ========================================================================== */

:root {
    --bg-canvas: #090d16;
    --bg-surface: #0f1624;
    --bg-card: #131b2e;
    --bg-card-hover: #172138;
    --bg-input: #0b101d;

    --border-subtle: rgba(148, 163, 184, 0.13);
    --border-strong: rgba(148, 163, 184, 0.24);
    --border-accent: rgba(56, 189, 248, 0.45);

    --primary: #0ea5e9;
    --primary-bright: #38bdf8;
    --primary-soft: rgba(14, 165, 233, 0.12);
    --indigo: #6366f1;
    --indigo-soft: rgba(99, 102, 241, 0.14);
    --emerald: #10b981;
    --emerald-soft: rgba(16, 185, 129, 0.13);
    --amber: #f59e0b;
    --amber-soft: rgba(245, 158, 11, 0.14);
    --rose: #f43f5e;
    --rose-soft: rgba(244, 63, 94, 0.14);

    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #8b9bb4;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 22px;

    --shadow-sm: 0 4px 18px rgba(2, 6, 23, 0.32);
    --shadow-md: 0 14px 38px rgba(2, 6, 23, 0.48);

    --font-ar: 'Cairo', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html {
    scroll-behavior: smooth;
    background: var(--bg-canvas);
    color: var(--text-main);
    font-family: var(--font-ar);
}

body {
    background-color: var(--bg-canvas);
    background-image: radial-gradient(ellipse 60% 35% at 50% 0%, rgba(14, 165, 233, 0.09), transparent 70%);
    color: var(--text-main);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
}

main { flex: 1; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; color: inherit; }

.mono {
    font-family: var(--font-mono);
    direction: ltr;
    unicode-bidi: isolate;
}

.container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   Buttons & Pills
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.16s ease, border-color 0.16s ease;
    white-space: nowrap;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--primary);
    color: #031521;
}
.btn-primary:hover {
    background: var(--primary-bright);
    transform: translateY(-1px);
}

.btn-indigo { background: var(--indigo); color: #fff; }
.btn-indigo:hover { background: #4f46e5; transform: translateY(-1px); }

.btn-emerald { background: var(--emerald); color: #031f16; }
.btn-emerald:hover { background: #34d399; transform: translateY(-1px); }

.btn-danger {
    background: var(--rose-soft);
    color: #fda4af;
    border-color: rgba(244, 63, 94, 0.3);
}
.btn-danger:hover { background: var(--rose); color: #fff; }

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-main);
    border-color: var(--border-subtle);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.btn-sm { padding: 7px 14px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: 13px; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}
.pill-cyan    { background: var(--primary-soft); color: var(--primary-bright); }
.pill-indigo  { background: var(--indigo-soft); color: #a5b4fc; }
.pill-emerald { background: var(--emerald-soft); color: #34d399; }
.pill-amber   { background: var(--amber-soft); color: #fbbf24; }
.pill-rose    { background: var(--rose-soft); color: #fda4af; }
.pill-muted   { background: rgba(148, 163, 184, 0.12); color: var(--text-secondary); }

/* ==========================================================================
   Header & Navbar (Clean Public Nav)
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(9, 13, 22, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav-bar {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--indigo) 100%);
    display: grid;
    place-items: center;
    color: #fff;
    flex-shrink: 0;
}

.brand-meta strong {
    display: block;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.15;
}
.brand-meta span {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 1.4px;
    color: var(--primary-bright);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.nav-links a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-links a.active {
    background: var(--primary-soft);
    color: var(--primary-bright);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu-btn {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    place-items: center;
    cursor: pointer;
}

/* ==========================================================================
   Clean Centered Hero & Page Header
   ========================================================================== */
.hero-clean {
    padding: 88px 0 64px;
    text-align: center;
}

.hero-clean .hero-inner {
    max-width: 780px;
    margin: 0 auto;
}

.hero-clean h1 {
    font-size: clamp(32px, 4.6vw, 52px);
    font-weight: 900;
    line-height: 1.24;
    letter-spacing: -0.4px;
    margin: 18px 0 18px;
}

.hero-clean p {
    font-size: 17px;
    color: var(--text-secondary);
    max-width: 640px;
    margin: 0 auto 30px;
}

.hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.page-hero {
    padding: 56px 0 36px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 40px;
}

.page-hero h1 {
    font-size: clamp(26px, 3.6vw, 40px);
    font-weight: 900;
    margin: 12px 0 10px;
    line-height: 1.25;
}

.page-hero p {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 680px;
}

/* ==========================================================================
   Sections & Cards (Spacious & Uncluttered)
   ========================================================================== */
.section {
    padding: 56px 0;
}

.section-header {
    margin-bottom: 32px;
}

.section-header h2 {
    font-size: clamp(22px, 2.8vw, 32px);
    font-weight: 800;
    margin-top: 8px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 6px;
    max-width: 600px;
}

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 26px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.card-link:hover {
    transform: translateY(-3px);
    border-color: var(--border-accent);
    background: var(--bg-card-hover);
}

.card-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--primary-soft);
    color: var(--primary-bright);
}

.card h3 {
    font-size: 19px;
    font-weight: 800;
    line-height: 1.35;
}

.card p {
    font-size: 14.5px;
    color: var(--text-secondary);
}

.check-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.check-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}

.check-list li svg {
    flex-shrink: 0;
    margin-top: 4px;
    color: var(--emerald);
}

.card-footer {
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* Search bar */
.search-bar {
    position: relative;
    max-width: 420px;
    margin-bottom: 24px;
}

.search-bar input {
    width: 100%;
    padding: 11px 16px 11px 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    font-size: 14px;
    outline: none;
}

.search-bar input:focus { border-color: var(--primary-bright); }
.search-bar svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* CTA Banner */
.cta-strip {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(99, 102, 241, 0.12));
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

/* Footer */
.site-footer {
    margin-top: 72px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface);
    padding: 36px 0 28px;
}

.footer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border-subtle);
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 14px;
    color: var(--text-muted);
}
.footer-links a:hover { color: var(--text-main); }

.footer-bottom {
    padding-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ==========================================================================
   Admin Command Center (Used ONLY on /alola-admin)
   ========================================================================== */
.admin-shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar {
    background: var(--bg-surface);
    border-left: 1px solid var(--border-subtle);
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.sidebar-group-title { font-size: 11px; font-weight: 800; color: var(--text-muted); padding: 0 12px; margin-bottom: 6px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.side-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    text-align: right;
    transition: all 0.15s ease;
}
.side-btn-left { display: inline-flex; align-items: center; gap: 10px; }
.side-btn:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-main); }
.side-btn.active { background: var(--primary-soft); color: var(--primary-bright); border-color: rgba(56, 189, 248, 0.28); }
.admin-main { display: flex; flex-direction: column; min-width: 0; }
.admin-topbar {
    position: sticky; top: 0; z-index: 40; height: 68px; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    background: rgba(9, 13, 22, 0.88); backdrop-filter: blur(16px); border-bottom: 1px solid var(--border-subtle);
}
.admin-content { padding: 24px; display: flex; flex-direction: column; gap: 20px; flex: 1; }
.panel-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 20px; }
.panel-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.panel-card-head h3 { font-size: 16.5px; font-weight: 800; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi-card .kpi-label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.kpi-card .kpi-val { font-size: 28px; font-weight: 900; line-height: 1.15; }
.portals-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.portal-card { background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.portal-card h3 { font-size: 15.5px; font-weight: 800; }
.portal-card p { font-size: 13px; color: var(--text-muted); flex: 1; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td { padding: 12px 10px; border-bottom: 1px solid var(--border-subtle); text-align: right; vertical-align: middle; }
.data-table th { color: var(--text-muted); font-size: 12px; font-weight: 700; background: rgba(255, 255, 255, 0.02); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.form-control { width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-subtle); background: var(--bg-input); color: var(--text-main); font-size: 13.5px; outline: none; }
.form-control:focus { border-color: var(--primary-bright); }
textarea.form-control { min-height: 86px; resize: vertical; }
.dropzone { border: 2px dashed rgba(56, 189, 248, 0.35); border-radius: var(--radius-lg); padding: 28px 20px; text-align: center; background: rgba(14, 165, 233, 0.04); cursor: pointer; }
.dropzone:hover, .dropzone.dragover { background: rgba(14, 165, 233, 0.1); border-color: var(--primary-bright); }
.progress-bar { width: 100%; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; margin-top: 12px; display: none; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--primary), var(--emerald)); transition: width 0.15s ease; }
.embed-shell { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; height: calc(100vh - 132px); min-height: 580px; }
.embed-bar { padding: 12px 16px; background: var(--bg-surface); border-bottom: 1px solid var(--border-subtle); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.embed-frame { width: 100%; flex: 1; border: 0; background: #0b1120; }
.modal-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(2, 6, 23, 0.78); backdrop-filter: blur(8px); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal-box { width: 100%; max-width: 680px; max-height: 90vh; overflow-y: auto; background: var(--bg-surface); border: 1px solid var(--border-strong); border-radius: var(--radius-xl); padding: 24px; box-shadow: var(--shadow-md); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--border-subtle); }
.toast-stack { position: fixed; bottom: 20px; left: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 16px; border-radius: var(--radius-md); background: var(--bg-surface); border: 1px solid var(--border-accent); color: var(--text-main); font-size: 13.5px; font-weight: 700; box-shadow: var(--shadow-md); }
.toast.err { border-color: rgba(244, 63, 94, 0.6); color: #fecdd3; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .grid-3, .grid-4, .portals-grid, .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .nav-links, .nav-actions { display: none; }
    .mobile-menu-btn { display: grid; }
    .nav-bar.open .nav-links {
        display: flex;
        position: absolute;
        top: 72px; right: 0; left: 0;
        flex-direction: column;
        background: var(--bg-surface);
        padding: 16px 24px;
        border-bottom: 1px solid var(--border-subtle);
    }
    .grid-2 { grid-template-columns: 1fr; }
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { position: fixed; right: -290px; top: 0; width: 268px; z-index: 120; transition: right 0.22s ease; }
    .admin-sidebar.open { right: 0; }
}
@media (max-width: 600px) {
    .grid-3, .grid-4, .portals-grid, .form-grid { grid-template-columns: 1fr; }
    .container { padding: 0 16px; }
    .hero-clean { padding: 56px 0 40px; }
}
