/*
 * AurBoss Brand Skin — global theme layer
 * ----------------------------------------
 * Purpose: bring the brand identity (cyan #1B8CBA + charcoal) to the whole app
 * and modernise the raw AdminLTE v2 / Bootstrap 3 *content* primitives, so every
 * page matches the already-modern ab-navbar / ab-sidebar shell — WITHOUT editing
 * any Blade view.
 *
 * Load order: AFTER redesign.css (so token overrides and chrome win on the cascade).
 *
 * SAFETY CONTRACT:
 *   1. All cosmetic chrome lives inside @media screen — print (ZATCA invoices,
 *      receipts, reports) is never touched and keeps the app's own print CSS.
 *   2. Button/input SIZING is never changed here — only colour, border, radius.
 *      POS action-button grids keep their exact dimensions and muscle memory.
 *   3. Only standard AdminLTE/Bootstrap classes are targeted (predictable markup).
 *
 * ROLLBACK: remove the single <link> for this file in
 *   resources/views/layouts/partials/css.blade.php. Nothing else depends on it.
 */

/* ==========================================================================
   1. Brand token retune — cascades through the entire ab- shell (92 refs)
   Tokens stay OUTSIDE @media screen (harmless values; print forces its own).
   ========================================================================== */
:root {
  /* AurBoss cyan ramp (brand = 600) */
  --ab-primary-50:  #E9F5FB;
  --ab-primary-100: #CDEAF5;
  --ab-primary-200: #A6D8EC;
  --ab-primary-500: #2A9FCF;
  --ab-primary-600: #1B8CBA; /* brand */
  --ab-primary-700: #136E94;
  --ab-primary-800: #0F5A79;
  --ab-primary-900: #0C4A64;

  /* keep the "info / partial" status in the brand family so it stops clashing */
  --ab-status-partial-bg:     #E9F5FB;
  --ab-status-partial-text:   #136E94;
  --ab-status-partial-border: #A6D8EC;
  --ab-status-partial-dot:    #2A9FCF;

  /* local brand aliases used below */
  --abs-brand:      #1B8CBA;
  --abs-brand-ink:  #136E94;
  --abs-brand-soft: #E9F5FB;
  --abs-ink:        #0F172A;
  --abs-ink-2:      #475569;
  --abs-line:       #E2E8F0;
  --abs-line-soft:  #EEF2F6;
  --abs-card:       #FFFFFF;
  --abs-bg:         #F6F8FB;
  --abs-radius:     12px;
  --abs-radius-sm:  8px;
  --abs-shadow:     0 1px 2px rgba(16,24,40,.05), 0 8px 24px -14px rgba(16,24,40,.12);
}

/* ==========================================================================
   2. Content primitives — screen only
   ========================================================================== */
@media screen {

  /* --- Page title area ------------------------------------------------- */
  .content-header > h1 {
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--abs-ink);
  }
  .content-header > h1 > small { color: var(--abs-ink-2); }
  .content-header > .breadcrumb {
    background: transparent;
    border-radius: var(--abs-radius-sm);
    font-size: 12.5px;
  }

  /* --- Box (AdminLTE content panel — the #1 surface, 106 pages) --------- */
  .box {
    background: var(--abs-card);
    border: 1px solid var(--abs-line);
    border-top-width: 1px;                /* kill AdminLTE's chunky 3px top rail */
    border-radius: var(--abs-radius);
    box-shadow: var(--abs-shadow);
  }
  /* coloured solid boxes keep their accent header but gain the soft frame */
  .box.box-primary  { border-top-color: var(--abs-brand); }
  .box.box-info     { border-top-color: var(--ab-primary-500); }
  .box-header {
    padding: 15px 18px;
    border-bottom: 1px solid var(--abs-line-soft);
    color: var(--abs-ink);
  }
  .box-header.with-border { border-bottom: 1px solid var(--abs-line-soft); }
  .box-header > .box-title {
    font-weight: 700;
    font-size: 16px;
  }
  .box-body { padding: 16px 18px; }
  .box-footer {
    border-top: 1px solid var(--abs-line-soft);
    background: transparent;
    border-radius: 0 0 var(--abs-radius) var(--abs-radius);
  }

  /* --- Buttons (colour + radius ONLY — no size changes) ----------------- */
  .btn {
    border-radius: var(--abs-radius-sm);
    font-weight: 600;
    border-width: 1px;
    transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease;
  }
  .btn-primary {
    background-color: var(--abs-brand);
    border-color: var(--abs-brand);
    color: #fff;
  }
  .btn-primary:hover, .btn-primary:focus, .btn-primary:active,
  .btn-primary.active, .open > .dropdown-toggle.btn-primary {
    background-color: var(--abs-brand-ink);
    border-color: var(--abs-brand-ink);
    color: #fff;
  }
  .btn-info {
    background-color: var(--ab-primary-500);
    border-color: var(--ab-primary-500);
  }
  .btn-info:hover, .btn-info:focus, .btn-info:active {
    background-color: var(--abs-brand);
    border-color: var(--abs-brand);
  }
  .btn-success { background-color: #15803D; border-color: #15803D; }
  .btn-success:hover, .btn-success:focus, .btn-success:active { background-color: #116633; border-color: #116633; }
  .btn-danger  { background-color: #DC2626; border-color: #DC2626; }
  .btn-danger:hover, .btn-danger:focus, .btn-danger:active { background-color: #B91C1C; border-color: #B91C1C; }
  .btn-warning { background-color: #D97706; border-color: #D97706; color: #fff; }
  .btn-warning:hover, .btn-warning:focus, .btn-warning:active { background-color: #B45309; border-color: #B45309; color: #fff; }
  .btn-default {
    background-color: #fff;
    border-color: var(--abs-line);
    color: var(--abs-ink-2);
  }
  .btn-default:hover, .btn-default:focus { background-color: #F1F5F9; border-color: #CBD5E1; color: var(--abs-ink); }
  .btn-link { color: var(--abs-brand-ink); }
  .btn.active, .btn:active { box-shadow: inset 0 2px 4px rgba(0,0,0,.08); }

  /* --- Tables ----------------------------------------------------------- */
  .table {
    color: var(--abs-ink);
    font-variant-numeric: tabular-nums;
  }
  .table > thead > tr > th {
    border-bottom: 1px solid var(--abs-line);
    background: var(--abs-bg);
    color: var(--abs-ink-2);
    font-weight: 700;
    font-size: 12.5px;
    vertical-align: middle;
  }
  .table > tbody > tr > td,
  .table > tfoot > tr > td {
    border-top: 1px solid var(--abs-line-soft);
    vertical-align: middle;
  }
  .table-hover > tbody > tr:hover { background-color: #FAFBFC; }
  .table-striped > tbody > tr:nth-of-type(odd) { background-color: #FBFCFD; }
  .box-body > .table { margin-bottom: 0; }

  /* DataTables chrome to match */
  .dataTables_wrapper .dataTables_filter input,
  .dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--abs-line);
    border-radius: var(--abs-radius-sm);
    padding: 4px 10px;
    background: #fff;
  }
  .dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--abs-radius-sm) !important;
    border: 1px solid var(--abs-line) !important;
    margin-inline-start: 3px;
  }
  .dataTables_wrapper .dataTables_paginate .paginate_button.current,
  .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--abs-brand) !important;
    border-color: var(--abs-brand) !important;
    color: #fff !important;
  }

  /* --- Forms ------------------------------------------------------------ */
  .form-control {
    border: 1px solid var(--abs-line);
    border-radius: var(--abs-radius-sm);
    box-shadow: none;
    color: var(--abs-ink);
  }
  .form-control:focus {
    border-color: var(--ab-primary-500);
    box-shadow: 0 0 0 3px var(--abs-brand-soft);
  }
  .input-group-addon {
    border: 1px solid var(--abs-line);
    background: var(--abs-bg);
    border-radius: var(--abs-radius-sm);
  }
  /* select2 single to match input height/shape */
  .select2-container--default .select2-selection--single,
  .select2-container--default .select2-selection--multiple {
    border: 1px solid var(--abs-line) !important;
    border-radius: var(--abs-radius-sm) !important;
  }
  .select2-container--default.select2-container--focus .select2-selection--multiple,
  .select2-container--default .select2-selection--single:focus {
    border-color: var(--ab-primary-500) !important;
  }
  .control-label { color: var(--abs-ink-2); font-weight: 700; }

  /* --- Tabs ------------------------------------------------------------- */
  .nav-tabs { border-bottom: 1px solid var(--abs-line); }
  .nav-tabs > li > a {
    border: none;
    border-radius: 0;
    color: var(--abs-ink-2);
    font-weight: 600;
    margin-inline-end: 2px;
  }
  .nav-tabs > li > a:hover { background: transparent; color: var(--abs-brand-ink); }
  .nav-tabs > li.active > a,
  .nav-tabs > li.active > a:hover,
  .nav-tabs > li.active > a:focus {
    border: none;
    border-bottom: 2px solid var(--abs-brand);
    background: transparent;
    color: var(--abs-brand-ink);
  }
  .nav-tabs-custom { box-shadow: var(--abs-shadow); border-radius: var(--abs-radius); }
  .nav-tabs-custom > .nav-tabs > li.active { border-top-color: var(--abs-brand); }

  /* --- Labels / badges / pills ----------------------------------------- */
  .label {
    border-radius: 999px;
    font-weight: 700;
    padding: .28em .72em;
    font-size: 84%;
  }
  .badge { border-radius: 999px; font-weight: 700; }
  .label-primary { background-color: var(--abs-brand); }
  .label-info    { background-color: var(--ab-primary-500); }

  /* --- Pagination ------------------------------------------------------- */
  .pagination > li > a, .pagination > li > span {
    color: var(--abs-ink-2);
    border-color: var(--abs-line);
  }
  .pagination > li:first-child > a, .pagination > li:first-child > span { border-radius: 0 var(--abs-radius-sm) var(--abs-radius-sm) 0; }
  .pagination > li:last-child > a, .pagination > li:last-child > span { border-radius: var(--abs-radius-sm) 0 0 var(--abs-radius-sm); }
  .pagination > .active > a, .pagination > .active > span,
  .pagination > .active > a:hover, .pagination > .active > a:focus {
    background-color: var(--abs-brand);
    border-color: var(--abs-brand);
  }

  /* --- Dashboard tiles -------------------------------------------------- */
  .small-box, .info-box {
    border-radius: var(--abs-radius);
    box-shadow: var(--abs-shadow);
    overflow: hidden;
  }
  .small-box > .inner > h3 { font-weight: 800; font-variant-numeric: tabular-nums; }

  /* --- Alerts / callouts ------------------------------------------------ */
  .alert { border-radius: var(--abs-radius-sm); border: 1px solid transparent; }
  .callout { border-radius: var(--abs-radius-sm); box-shadow: none; }

  /* --- Modals ----------------------------------------------------------- */
  .modal-content { border-radius: var(--abs-radius); border: none; box-shadow: 0 20px 60px -20px rgba(16,24,40,.35); }
  .modal-header { border-bottom: 1px solid var(--abs-line-soft); }
  .modal-footer { border-top: 1px solid var(--abs-line-soft); }

  /* --- Links in content ------------------------------------------------- */
  a { color: var(--abs-brand-ink); }
  a:hover, a:focus { color: var(--abs-brand); }

  /* Never recolour a link that is really a control, nor a link sitting on a
     coloured / dark surface (where the text is meant to stay white). This is
     the guard that keeps white links from turning low-contrast cyan — e.g. the
     navy page banner and AdminLTE .bg-* / .box-solid headers / dashboard tiles.
     Each resets to inherit, so the surface's own colour wins. */
  a.btn, .btn a, .nav > li > a, .nav-tabs > li > a,
  .ab-navbar a, .ab-sidebar a, a.label, a.badge,
  .label a, .badge a,
  .callout a, .alert a,
  .small-box a, .info-box a,
  .box-solid > .box-header a,
  .bg-red a, .bg-green a, .bg-aqua a, .bg-blue a, .bg-light-blue a,
  .bg-yellow a, .bg-orange a, .bg-navy a, .bg-black a, .bg-purple a,
  .bg-maroon a, .bg-teal a, .bg-olive a, .bg-lime a, .bg-fuchsia a,
  .bg-primary a, .bg-success a, .bg-info a, .bg-warning a, .bg-danger a,
  [class*="tw-bg-gradient"] a, [class*="tw-text-white"],
  [class*="tw-text-white"] a, [class*="tw-bg-primary"] a {
    color: inherit;
  }

  /* --- Sidebar: hover feedback + smooth motion (active accent bar already
         exists in redesign.css and is cyan via the token retune) ----------- */
  .ab-sidebar .ab-sidebar-item {
    transition: background-color .14s ease, color .14s ease, border-color .14s ease;
  }
  .ab-sidebar .ab-sidebar-item:hover {
    background: var(--abs-brand-soft);
    color: var(--abs-brand-ink);
  }
  .ab-sidebar .ab-sidebar-item:hover svg,
  .ab-sidebar .ab-sidebar-item:hover i { color: var(--abs-brand); }
  /* active item keeps its own stronger state (it uses !important), hover won't fight it */

  /* --- Content: smooth transitions + a subtle lift on clickable tiles ----- */
  .box, .ab-card, .small-box, .info-box {
    transition: box-shadow .16s ease, transform .16s ease;
  }
  .small-box:hover, .info-box:hover,
  a.box:hover, a.ab-card:hover {
    box-shadow: var(--ab-shadow-lg);
    transform: translateY(-2px);
  }
  /* buttons/rows already transition (set earlier); nothing lifts that shouldn't */

  /* ======================================================================
     Dark premium shell (owner-chosen 11-29): charcoal sidebar + cyan accents.
     Every text/icon/label colour is flipped to light so NOTHING disappears on
     the dark ground. Targets the real ab-sidebar markup + its Tailwind utility
     colours (overridden with !important to win regardless of Tailwind config).
     ====================================================================== */
  .ab-sidebar.side-bar {
    background: linear-gradient(180deg, #262a30 0%, #1b1e23 100%) !important;
    border-inline-end: 1px solid #30353c !important;
  }
  /* logo block */
  .ab-sidebar .ab-sidebar__logo-name { color: #ffffff !important; }
  .ab-sidebar .ab-sidebar__logo-sub  { color: #8b929b !important; }
  .ab-sidebar .ab-sidebar__logo:hover { background: rgba(255,255,255,.05) !important; }
  .ab-sidebar .ab-sidebar__logo-icon {
    background: linear-gradient(135deg, var(--abs-brand), #36a6d4) !important;
    color: #fff !important;
  }
  /* section headers (div[role=heading].ab-sidebar-label) */
  .ab-sidebar [role="heading"].ab-sidebar-label { color: #7f8893 !important; }
  /* menu items — base light text + icons */
  .ab-sidebar .ab-sidebar-item { color: #c5cbd3 !important; }
  .ab-sidebar .ab-sidebar-item .ab-sidebar-icon,
  .ab-sidebar .ab-sidebar-item .ab-sidebar-icon svg,
  .ab-sidebar .ab-sidebar-item .ab-sidebar-icon i { color: #aeb6c0 !important; }
  .ab-sidebar .ab-sidebar-chevron { color: #6c7480 !important; }
  /* hover */
  .ab-sidebar .ab-sidebar-item:hover,
  .ab-sidebar .ab-sidebar-item:focus {
    background: rgba(255,255,255,.06) !important;
    color: #ffffff !important;
  }
  .ab-sidebar .ab-sidebar-item:hover .ab-sidebar-icon svg,
  .ab-sidebar .ab-sidebar-item:hover .ab-sidebar-icon i { color: #36a6d4 !important; }
  /* active parent (accent bar from redesign.css stays cyan; make fill a soft glow) */
  .ab-sidebar .ab-sidebar-item--active {
    background: linear-gradient(90deg, rgba(27,140,186,.22), rgba(27,140,186,.04)) !important;
    color: #ffffff !important;
  }
  .ab-sidebar .ab-sidebar-item--active .ab-sidebar-icon svg,
  .ab-sidebar .ab-sidebar-item--active .ab-sidebar-icon i { color: #36a6d4 !important; }
  .ab-sidebar .ab-sidebar-child--active { color: #7cc7e6 !important; }
  /* dividers + dropdown tree lines (were near-white, would glare on dark) */
  .ab-sidebar .tw-border-t,
  .ab-sidebar [class*="tw-border-gray-"] { border-color: rgba(255,255,255,.08) !important; }
  .ab-sidebar .chiled [class*="tw-bg-gray-"] { background: rgba(255,255,255,.12) !important; }
  /* child (sub) items */
  .ab-sidebar .chiled .ab-sidebar-item { color: #9aa3ae !important; }
  .ab-sidebar .chiled .ab-sidebar-item:hover { color: #ffffff !important; background: transparent !important; }
  /* collapse toggle at the bottom (was a white strip + white boxed button) */
  .ab-sidebar .ab-sidebar__toggle {
    background: transparent !important;
    border-top: 1px solid rgba(255,255,255,.07) !important;
  }
  .ab-sidebar .ab-sidebar__toggle-btn {
    background: rgba(255,255,255,.04) !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    color: #aeb6c0 !important;
  }
  .ab-sidebar .ab-sidebar__toggle-btn:hover {
    background: rgba(255,255,255,.10) !important;
    color: #fff !important;
  }
  /* scrollbar on the dark menu */
  .ab-sidebar .ab-sidebar__menu::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14) !important; }

  /* Top bar — subtle glass polish (stays light) */
  .ab-navbar {
    background: rgba(255,255,255,.82) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  /* --- Navbar: ONE consistent button system --------------------------------
     Primary = «نقطة بيع» (.ab-navbar__pos) cyan filled. Module buttons still
     ship old Bootstrap utilities (pull-left + m-8/mt-10 + colour fills: the
     green «الصيانة», the blue/yellow clock-in/out) that broke the row. Fold
     them in — all 36px tall, aligned:
       · text buttons  → cyan OUTLINE secondary
       · icon buttons  → transparent ghost, exactly like .ab-navbar__btn       */
  .ab-navbar .btn {
    float: none !important;
    margin: 0 !important;
    height: 36px;
    padding: 0 14px;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    border-radius: var(--abs-radius-sm) !important;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
    box-shadow: none !important;
  }
  .ab-navbar .btn .fa,
  .ab-navbar .btn .fas,
  .ab-navbar .btn > i { font-size: 15px; margin: 0; }
  .ab-navbar__end { gap: 8px; }
  .ab-navbar__pos { height: 36px; }

  /* text buttons (الصيانة …) → cyan outline secondary */
  .ab-navbar .btn.btn-success,
  .ab-navbar .btn.btn-primary,
  .ab-navbar .btn.btn-info,
  .ab-navbar .btn.btn-warning {
    background: #fff !important;
    border: 1px solid var(--abs-brand) !important;
    color: var(--abs-brand-ink) !important;
  }
  .ab-navbar .btn.btn-success:hover, .ab-navbar .btn.btn-primary:hover,
  .ab-navbar .btn.btn-info:hover,    .ab-navbar .btn.btn-warning:hover,
  .ab-navbar .btn.btn-success:focus, .ab-navbar .btn.btn-primary:focus,
  .ab-navbar .btn.btn-info:focus,    .ab-navbar .btn.btn-warning:focus {
    background: var(--abs-brand-soft) !important;
    color: var(--abs-brand-ink) !important;
    border-color: var(--abs-brand) !important;
  }

  /* icon-only module buttons (clock in/out, etc.) → ghost, like .ab-navbar__btn */
  .ab-navbar .btn.bg-blue,  .ab-navbar .btn.bg-yellow,
  .ab-navbar .btn.bg-green, .ab-navbar .btn.bg-red,
  .ab-navbar .btn.bg-aqua,  .ab-navbar .clock_in_btn, .ab-navbar .clock_out_btn {
    width: 36px;
    padding: 0 !important;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    color: var(--abs-ink-2) !important;
  }
  .ab-navbar .btn.bg-blue:hover,  .ab-navbar .btn.bg-yellow:hover,
  .ab-navbar .btn.bg-green:hover, .ab-navbar .btn.bg-red:hover,
  .ab-navbar .clock_in_btn:hover, .ab-navbar .clock_out_btn:hover {
    background: #f1f5f9 !important;
    color: var(--abs-brand) !important;
  }

  /* Footer — clean, centered, quiet */
  .ab-footer {
    text-align: center;
    padding: 16px;
    margin-top: 10px;
    border-top: 1px solid var(--abs-line-soft);
  }
  .ab-footer p { margin: 0; font-size: 12px; color: var(--abs-ink-2); opacity: .75; }

  /* ======================================================================
     Dashboard polish — additive on the existing ab-dashboard markup
     ====================================================================== */
  .ab-dashboard__title { font-weight: 800; letter-spacing: -.02em; }

  /* Period filter → crisp cyan segmented control */
  .ab-dashboard .ab-period-selector {
    background: #eef2f7 !important;
    border: 1px solid var(--abs-line) !important;
    border-radius: 12px !important;
    padding: 3px;
    gap: 2px;
    overflow: visible;
  }
  .ab-dashboard .ab-period-btn {
    border: none !important;
    border-radius: 9px !important;
    font-weight: 700 !important;
    color: var(--abs-ink-2) !important;
    background: transparent !important;
    transition: background .14s ease, color .14s ease;
  }
  .ab-dashboard .ab-period-btn:hover {
    color: var(--abs-ink) !important;
    background: rgba(255,255,255,.65) !important;
  }
  .ab-dashboard .ab-period-btn.active {
    background: var(--abs-brand) !important;
    color: #fff !important;
    box-shadow: 0 2px 6px -2px rgba(27,140,186,.55);
  }

  /* Stat cards — depth, hover lift, brand icon, bolder figure */
  .ab-dashboard .ab-stat-card {
    transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease;
  }
  .ab-dashboard .ab-stat-card:hover {
    box-shadow: var(--ab-shadow-lg) !important;
    transform: translateY(-2px);
    border-color: #cfe6f2 !important;
  }
  .ab-dashboard .ab-stat-card .ab-stat-icon { box-shadow: inset 0 0 0 1px rgba(16,24,40,.03); }
  .ab-dashboard .ab-stat-icon--blue {
    background: var(--abs-brand-soft) !important;
    color: var(--abs-brand) !important;
  }
  .ab-dashboard .ab-stat-card .ab-stat-value { font-size: 22px !important; letter-spacing: -.01em; }
  .ab-dashboard .ab-stat-label { font-weight: 700; }
}

/* Respect reduced-motion: no transforms/transitions for users who ask for it */
@media (prefers-reduced-motion: reduce) {
  .box, .ab-card, .small-box, .info-box,
  .ab-sidebar .ab-sidebar-item, .btn { transition: none !important; }
  .small-box:hover, .info-box:hover, a.box:hover, a.ab-card:hover { transform: none !important; }
}
