/* =====================================================================
   JABELTECH — GLOBAL DESIGN SYSTEM
   Phase 01 — Foundation

   Direction: corporate IT supplier, not a consumer storefront.
   The vocabulary is the datasheet: monospace SKUs, hairline rules,
   labelled spec strips. Warm, busy, or "startup SaaS" styling is
   deliberately avoided — see design notes at the end of this file.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    /* ---- Color: Dark Navy / White / Light Gray / Corporate Blue ---- */
    --navy-950: #0A1628;
    --navy-800: #142544;
    --navy-700: #1D3462;

    --blue-600: #2F5FE0;   /* primary corporate blue */
    --blue-500: #4C7BFF;
    --blue-100: #E8EEFD;

    --gray-50:  #F6F8FB;   /* page background */
    --gray-100: #EEF1F6;
    --line:     #E1E6EE;   /* hairline borders */

    --white:    #FFFFFF;
    --ink-900:  #101828;   /* primary text */
    --ink-600:  #4B5567;   /* secondary text */
    --ink-400:  #8891A1;   /* muted / placeholder */

    --success:  #1E7F4F;
    --warning:  #B7791F;
    --danger:   #C0362C;

    --gradient-soft: linear-gradient(135deg, #14264A 0%, #2F5FE0 100%);

    /* ---- Type ---- */
    --font-display: 'Sora', 'Segoe UI', sans-serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

    /* ---- Layout ---- */
    --container-max: 1240px;
    --radius-sm: 4px;
    --radius-md: 8px;
    --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
    --shadow-lift: 0 8px 24px rgba(16, 24, 40, 0.12);
}

/* ---------------------------------------------------------------------
   RESET & BASE
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink-900);
    background: var(--gray-50);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    color: var(--navy-950);
    line-height: 1.2;
    margin: 0 0 0.5em;
    letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 1.5rem + 2vw, 3.25rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 1.3rem + 1vw, 2.25rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 1em; color: var(--ink-600); }

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* Respect reduced-motion preference throughout the site */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------------------------------------------------------------------
   UTILITY / DATA TEXT — the signature motif
   Monospace is reserved for machine-facing values: SKUs, reference
   numbers, spec figures. It is never used for prose. This is what
   should make the site read as a spec sheet, not a generic storefront.
   --------------------------------------------------------------------- */
.data-text {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    color: var(--ink-600);
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--blue-600);
    font-weight: 500;
}

/* ---------------------------------------------------------------------
   BUTTONS
   --------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9375rem;
    border: 1px solid transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
    background: var(--blue-600);
    color: var(--white);
}
.btn-primary:hover { background: #2650C4; }

.btn-outline {
    background: transparent;
    border-color: var(--line);
    color: var(--navy-950);
}
.btn-outline:hover { border-color: var(--blue-600); color: var(--blue-600); }

.btn-whatsapp {
    background: var(--white);
    border-color: var(--line);
    color: var(--ink-900);
}
.btn-whatsapp:hover { border-color: #25D366; color: #1B9E4E; }

.btn-block { width: 100%; }

/* ---------------------------------------------------------------------
   FOCUS STATES — always visible, never suppressed
   --------------------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--blue-500);
    outline-offset: 2px;
}

/* ---------------------------------------------------------------------
   HEADER / NAVBAR
   --------------------------------------------------------------------- */
.site-header {
    background: var(--navy-950);
    color: var(--white);
}

.header-topbar {
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
}
.header-topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    padding-bottom: 8px;
}
.header-topbar a { color: rgba(255,255,255,0.75); }
.header-topbar a:hover { color: var(--white); }
.topbar-links { display: flex; gap: 20px; }

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 0;
}

.brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.375rem;
    color: var(--white);
    display: flex;
    align-items: baseline;
    gap: 2px;
}
.brand span { color: var(--blue-500); }

.nav-links {
    display: flex;
    gap: 28px;
    font-size: 0.9375rem;
    font-weight: 500;
}
.nav-links a { color: rgba(255,255,255,0.82); }
.nav-links a:hover { color: var(--white); }

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

.nav-search {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    min-width: 220px;
}
.nav-search input {
    background: transparent;
    border: none;
    color: var(--white);
    font-family: var(--font-body);
    font-size: 0.875rem;
    width: 100%;
}
.nav-search input::placeholder { color: rgba(255,255,255,0.45); }
.nav-search input:focus { outline: none; }

.icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    color: var(--white);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
}
.icon-btn:hover { background: rgba(255,255,255,0.16); }
.icon-btn .badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--blue-500);
    color: var(--white);
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
    padding: 3px 5px;
    border-radius: 999px;
    font-family: var(--font-body);
}

.mobile-toggle { display: none; }

/* ---------------------------------------------------------------------
   FOOTER
   --------------------------------------------------------------------- */
.site-footer {
    background: var(--navy-950);
    color: rgba(255,255,255,0.7);
    margin-top: 64px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
    gap: 32px;
    padding: 56px 0 32px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-col h4 {
    color: var(--white);
    font-size: 0.9375rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a, .footer-col p { color: rgba(255,255,255,0.65); font-size: 0.9375rem; }
.footer-col a:hover { color: var(--white); }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
}
.footer-legal { display: flex; gap: 18px; }
.footer-legal a { color: rgba(255,255,255,0.45); }
.footer-legal a:hover { color: rgba(255,255,255,0.8); }

/* ---------------------------------------------------------------------
   MOBILE DRAWER
   --------------------------------------------------------------------- */
.mobile-drawer {
    position: fixed;
    inset: 0;
    background: rgba(10,22,40,0.55);
    z-index: 50;
}
.mobile-drawer-panel {
    position: absolute;
    top: 0; right: 0;
    width: min(320px, 84vw);
    height: 100%;
    background: var(--navy-950);
    padding: 20px;
    box-shadow: -8px 0 24px rgba(0,0,0,0.25);
}
.mobile-drawer-close {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.75rem;
    line-height: 1;
    margin-bottom: 16px;
}
.mobile-drawer-links { display: flex; flex-direction: column; gap: 4px; }
.mobile-drawer-links a {
    display: block;
    padding: 12px 4px;
    color: rgba(255,255,255,0.85);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-weight: 500;
}

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------------------------------------------
   FLASH MESSAGES
   --------------------------------------------------------------------- */
.flash { padding: 12px 0; font-size: 0.9375rem; font-weight: 500; }
.flash-success { background: #E7F5EC; color: var(--success); }
.flash-error   { background: #FBEAE8; color: var(--danger); }

/* ---------------------------------------------------------------------
   HERO (homepage placeholder — extended with real content in Phase 12)
   --------------------------------------------------------------------- */
.hero {
    background: var(--gradient-soft);
    color: var(--white);
    position: relative;
    overflow: hidden;
}
.hero::before {
    /* faint schematic/trace-line texture, kept very restrained */
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}
.hero-inner {
    position: relative;
    padding: 88px 0 72px;
    max-width: 720px;
}
.hero-inner .eyebrow { color: var(--blue-500); }
.hero h1 { color: var(--white); margin-top: 12px; }
.hero-lead { color: rgba(255,255,255,0.78); font-size: 1.0625rem; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero-actions .btn-outline { color: var(--white); border-color: rgba(255,255,255,0.3); }
.hero-actions .btn-outline:hover { border-color: var(--white); color: var(--white); background: rgba(255,255,255,0.08); }

.spec-strip {
    position: relative;
    background: rgba(255,255,255,0.06);
    border-top: 1px solid rgba(255,255,255,0.1);
}
.spec-strip-inner {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 20px 0;
}
.spec-item { display: flex; flex-direction: column; gap: 4px; }
.spec-item .data-text { color: rgba(255,255,255,0.55); }
.spec-item strong { color: var(--white); font-family: var(--font-display); font-size: 1rem; font-weight: 600; }

.placeholder-note { padding: 56px 0; }
.notice-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 28px;
    max-width: 640px;
}

@media (max-width: 767px) {
    .spec-strip-inner { grid-template-columns: repeat(2, 1fr); }
    .hero-inner { padding: 56px 0 40px; }
}

/* ---------------------------------------------------------------------
   STICKY MOBILE ACTION BAR (product pages — wired up fully in Phase 08)
   --------------------------------------------------------------------- */
.sticky-actions {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--line);
    padding: 10px 16px;
    gap: 10px;
    z-index: 40;
    box-shadow: 0 -4px 16px rgba(16,24,40,0.08);
}

/* ---------------------------------------------------------------------
   ERROR PAGES
   --------------------------------------------------------------------- */
.error-page {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 24px;
}
.error-code {
    font-family: var(--font-mono);
    font-size: 4rem;
    font-weight: 500;
    color: var(--blue-600);
    line-height: 1;
    margin-bottom: 16px;
}
.error-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; justify-content: center; }

/* ---------------------------------------------------------------------
   ADMIN LAYOUT
   Phase 02 — Admin & Database Core
   --------------------------------------------------------------------- */
.admin-body { background: var(--gray-50); }

.admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: var(--navy-950);
    color: rgba(255,255,255,0.8);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
}
.admin-sidebar-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--white);
    padding: 8px 10px 20px;
}
.admin-sidebar-brand span { color: var(--blue-500); }

.admin-nav-group { margin-bottom: 18px; }
.admin-nav-label {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.35);
    padding: 0 10px 8px;
}
.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.75);
}
.admin-nav-link:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.admin-nav-link.active { background: var(--blue-600); color: var(--white); }
.admin-nav-link.disabled { color: rgba(255,255,255,0.3); cursor: default; }
.admin-nav-link.disabled:hover { background: none; }
.admin-nav-link .phase-tag {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.625rem;
    background: rgba(255,255,255,0.08);
    padding: 2px 6px;
    border-radius: 999px;
}

.admin-content { display: flex; flex-direction: column; min-width: 0; }

.admin-topbar {
    background: var(--white);
    border-bottom: 1px solid var(--line);
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-topbar-title { font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; color: var(--navy-950); }
.admin-topbar-user { display: flex; align-items: center; gap: 14px; font-size: 0.875rem; }
.admin-topbar-user .role-pill {
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--blue-100);
    color: var(--blue-600);
    padding: 3px 8px;
    border-radius: 999px;
}
.admin-topbar-user a.logout { color: var(--ink-600); }
.admin-topbar-user a.logout:hover { color: var(--danger); }

.admin-main { padding: 28px; flex: 1; }

/* ---- Stat cards ---- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow-card);
}
.stat-card .data-text { display: block; margin-bottom: 8px; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; color: var(--navy-950); }
.stat-card.stat-pending .stat-value { color: var(--ink-400); font-size: 1.125rem; }
.stat-card .stat-caption { font-size: 0.75rem; color: var(--ink-400); margin-top: 4px; }

/* ---- Panels / tables ---- */
.admin-panel {
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
}
.admin-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
}
.admin-panel-head h3 { margin: 0; }
.admin-panel-body { padding: 20px; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.admin-table th {
    text-align: left;
    font-family: var(--font-mono);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-400);
    padding: 10px 20px;
    border-bottom: 1px solid var(--line);
}
.admin-table td { padding: 12px 20px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .muted { color: var(--ink-400); }

.status-pill {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
}
.status-active   { background: #E7F5EC; color: var(--success); }
.status-inactive { background: #F1F2F5; color: var(--ink-400); }

/* ---- Forms ---- */
.admin-form .field { margin-bottom: 18px; max-width: 420px; }
.admin-form label { display:block; font-size:0.875rem; font-weight:600; margin-bottom:6px; color: var(--navy-950); }
.admin-form input, .admin-form select, .admin-form textarea {
    width:100%; padding:10px 12px; border:1px solid var(--line); border-radius: var(--radius-sm);
    font-family: var(--font-body); font-size:0.9375rem; background: var(--white);
}
.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus {
    outline:2px solid var(--blue-500); outline-offset:1px; border-color: transparent;
}
.admin-form .hint { font-size: 0.8125rem; color: var(--ink-400); margin-top: 4px; }
.admin-form .form-actions { display:flex; gap:10px; margin-top: 24px; }

.btn-sm { padding: 6px 12px; font-size: 0.8125rem; }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #A02A22; }

@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .admin-sidebar { display: none; } /* Phase 19 (Mobile & UX) adds a collapsible admin drawer */
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------------------------------------------------------------------
   DESIGN NOTES (kept for future sessions / other admins on this project)
   ---------------------------------------------------------------------
   - Palette and type are locked by the master plan (dark navy / white /
     light gray / corporate blue). Do not introduce warm cream or
     terracotta tones — off-brief for a Saudi B2B IT supplier.
   - Mono face (IBM Plex Mono) is reserved for SKUs, reference numbers,
     and spec values only — this is the site's signature and must stay
     disciplined, not spread into headings or body copy.
   - Avoid rounded-pill buttons and bright acid-green accents — keep the
     restrained, technical-datasheet feel over a "SaaS landing page" look.
   ===================================================================== */
