/* ─────────────────────────────────────────────────────────────────────
   Halo Admin Design System — global overrides
   ────────────────────────────────────────────────────────────────────
   Loaded AFTER NobleUI's demo1/style.min.css in layouts/appv2.blade.php.
   Brings every existing admin page in line with the May 2026 redesign
   without touching individual Blade files. Where a page already uses
   the new prefixed namespaces (.hsb-*, .cp-*, .kq-*, etc.) those styles
   take precedence and these overrides are no-ops.

   Tokens are mirrored from the rebuilt pages so a designer can change
   one variable and shift the whole system.
   ────────────────────────────────────────────────────────────────── */

:root {
    --halo-primary:        #1f3b73;
    --halo-primary-soft:   #5b8def;
    --halo-primary-bg:     rgba(31, 59, 115, 0.07);
    --halo-success:        #0f8a4e;
    --halo-success-bg:     #e7f8ee;
    --halo-warning:        #a4711b;
    --halo-warning-bg:     #fff5e0;
    --halo-danger:         #c2362b;
    --halo-danger-bg:      #fdecec;
    --halo-info:           #1f3b73;
    --halo-info-bg:        #e6effd;

    --halo-border:         #eef0f4;
    --halo-border-strong:  #d4d8e0;
    --halo-surface:        #ffffff;
    --halo-surface-alt:    #fbfcfd;
    --halo-surface-muted:  #f7f8fb;

    --halo-text:           #1f2940;
    --halo-text-muted:     #4f5b75;
    --halo-text-soft:      #6b7280;
    --halo-text-faint:     #8b95a7;
    --halo-text-disabled:  #b3bac7;

    --halo-radius-lg:      14px;
    --halo-radius:         12px;
    --halo-radius-sm:      8px;
    --halo-radius-xs:      6px;

    --halo-shadow:         0 1px 0 rgba(15, 30, 60, 0.02);
}

/* ─── Page chrome ──────────────────────────────────────────────────── */

body { background: var(--halo-surface-muted); color: var(--halo-text); }

.page-content { background: var(--halo-surface-muted); padding: 22px 24px 32px; }

/* ─── Breadcrumbs ─────────────────────────────────────────────────── */

.page-breadcrumb { margin-bottom: 14px; }
.page-breadcrumb .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--halo-text-faint);
}
.page-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    color: var(--halo-text-disabled);
    content: "/";
    padding: 0 6px;
}
.page-breadcrumb .breadcrumb-item a {
    color: var(--halo-text-faint);
    text-decoration: none;
}
.page-breadcrumb .breadcrumb-item a:hover { color: var(--halo-primary); }
.page-breadcrumb .breadcrumb-item.active { color: var(--halo-text); }

/* ─── Cards ───────────────────────────────────────────────────────── */

.card {
    background: var(--halo-surface);
    border: 1px solid var(--halo-border);
    border-radius: var(--halo-radius);
    box-shadow: var(--halo-shadow);
}
.card-header {
    padding: 14px 18px;
    background: transparent;
    border-bottom: 1px solid var(--halo-border);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--halo-text-soft);
    font-weight: 700;
}
.card-body { padding: 18px; }
.card-footer {
    background: transparent;
    border-top: 1px solid var(--halo-border);
    padding: 12px 18px;
}

/* `.card-title` and `h6.card-title` — legacy pages use these as the visible
   page-level title (since they don't have a separate <h1>). Render them as
   a readable section title rather than the tiny uppercase label, so the
   pages keep a clear visual anchor. Pages that use `.card-header` instead
   get the proper tiny-uppercase label via the rule above. */
.card-title, h6.card-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: var(--halo-text) !important;
    margin-bottom: 4px !important;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: 0;
}
.card-title + p,
.card-title + .text-muted,
h6.card-title + p,
h6.card-title + .text-muted {
    font-size: 12.5px;
    color: var(--halo-text-soft);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    margin-bottom: 14px;
    line-height: 1.5;
}

/* Cards with stretch-card layout (NobleUI default) */
.grid-margin { margin-bottom: 14px !important; }

/* ─── Tables ──────────────────────────────────────────────────────── */

.table {
    color: var(--halo-text);
    font-size: 12.5px;
    margin-bottom: 0;
}
.table thead th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--halo-text-faint);
    font-weight: 700;
    background: var(--halo-surface-alt);
    border-bottom: 1px solid var(--halo-border);
    border-top: 0;
    padding: 11px 14px;
}
.table tbody td {
    padding: 11px 14px;
    border-top: 0;
    border-bottom: 1px solid #f3f5f8;
    color: var(--halo-text);
    vertical-align: middle;
}
.table tbody tr:hover td { background: var(--halo-surface-alt); }
.table tbody tr:last-child td { border-bottom: 0; }

.table-hover tbody tr:hover { background-color: var(--halo-surface-alt); }
.table-bordered { border: 1px solid var(--halo-border); }
.table-bordered td, .table-bordered th { border: 1px solid var(--halo-border); }

/* DataTables tweaks — applies to existing pages with `#dt`-style DataTables */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate { font-size: 12px; color: var(--halo-text-soft); }
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--halo-border-strong);
    border-radius: var(--halo-radius-xs);
    padding: 5px 10px;
    margin-left: 6px;
}
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--halo-border-strong);
    border-radius: var(--halo-radius-xs);
    padding: 4px 8px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: var(--halo-radius-xs) !important;
    padding: 4px 10px !important;
    margin: 0 2px !important;
    font-size: 12px !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--halo-primary) !important;
    color: #fff !important;
    border-color: var(--halo-primary) !important;
}

/* ─── Buttons ─────────────────────────────────────────────────────── */

.btn {
    font-size: 12.5px;
    font-weight: 600;
    border-radius: var(--halo-radius-xs);
    padding: 7px 14px;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-sm { font-size: 11px; padding: 5px 10px; }
.btn-lg { font-size: 13px; padding: 9px 18px; }

.btn-primary, .btn.btn-primary {
    background: var(--halo-primary);
    border-color: var(--halo-primary);
    color: #fff;
}
.btn-primary:hover, .btn.btn-primary:hover {
    background: #18305d;
    border-color: #18305d;
    color: #fff;
}
.btn-outline-primary {
    color: var(--halo-primary);
    border-color: var(--halo-border-strong);
    background: var(--halo-surface);
}
.btn-outline-primary:hover {
    background: var(--halo-primary);
    border-color: var(--halo-primary);
    color: #fff;
}

.btn-success { background: var(--halo-success); border-color: var(--halo-success); color: #fff; }
.btn-success:hover { background: #0c6f3f; border-color: #0c6f3f; color: #fff; }

.btn-danger { background: var(--halo-danger); border-color: var(--halo-danger); color: #fff; }
.btn-danger:hover { background: #9e2b22; border-color: #9e2b22; color: #fff; }

.btn-warning {
    background: var(--halo-warning-bg);
    border-color: var(--halo-warning-bg);
    color: var(--halo-warning);
}
.btn-warning:hover { background: #f4e2bf; border-color: #f4e2bf; color: var(--halo-warning); }

.btn-info, .btn-secondary {
    background: var(--halo-surface-muted);
    border-color: var(--halo-border);
    color: var(--halo-text);
}
.btn-info:hover, .btn-secondary:hover {
    background: var(--halo-border);
    border-color: var(--halo-border-strong);
    color: var(--halo-text);
}

.btn-link { color: var(--halo-primary); padding: 0; font-weight: 600; }
.btn-link:hover { color: #18305d; text-decoration: none; }

/* ─── Badges / Pills ──────────────────────────────────────────────── */

.badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.badge.bg-success, .badge-success { background: var(--halo-success-bg) !important; color: var(--halo-success) !important; }
.badge.bg-danger, .badge-danger   { background: var(--halo-danger-bg) !important;  color: var(--halo-danger) !important; }
.badge.bg-warning, .badge-warning { background: var(--halo-warning-bg) !important; color: var(--halo-warning) !important; }
.badge.bg-info, .badge-info       { background: var(--halo-info-bg) !important;    color: var(--halo-info) !important; }
.badge.bg-secondary, .badge-secondary { background: #eef0f4 !important;            color: var(--halo-text-soft) !important; }
.badge.bg-primary, .badge-primary { background: var(--halo-info-bg) !important;    color: var(--halo-primary) !important; }
.badge.bg-light, .badge-light     { background: #eef0f4 !important;                color: var(--halo-text-soft) !important; }

/* ─── Alerts ──────────────────────────────────────────────────────── */

.alert {
    border-radius: var(--halo-radius);
    font-size: 13px;
    padding: 12px 16px;
    border: 1px solid transparent;
    line-height: 1.5;
}
.alert-success { background: var(--halo-success-bg); border-color: #c8ecd3;   color: var(--halo-success); }
.alert-danger  { background: var(--halo-danger-bg);  border-color: #f4cbc7;   color: var(--halo-danger); }
.alert-warning { background: var(--halo-warning-bg); border-color: #f4e2bf;   color: var(--halo-warning); }
.alert-info    { background: var(--halo-info-bg);    border-color: #c9d8f5;   color: var(--halo-primary); }
.alert-primary { background: var(--halo-info-bg);    border-color: #c9d8f5;   color: var(--halo-primary); }

/* ─── Form controls ───────────────────────────────────────────────── */

.form-control, .form-select {
    font-size: 13px;
    color: var(--halo-text);
    border: 1px solid var(--halo-border-strong);
    border-radius: var(--halo-radius-xs);
    padding: 7px 11px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--halo-primary-soft);
    box-shadow: 0 0 0 3px rgba(91, 141, 239, 0.15);
}
.form-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--halo-text-soft); margin-bottom: 4px; }

.input-group-text {
    background: var(--halo-surface-alt);
    border: 1px solid var(--halo-border-strong);
    font-size: 13px;
    color: var(--halo-text-soft);
}

/* ─── Modals ──────────────────────────────────────────────────────── */

.modal-content {
    border: 0;
    border-radius: var(--halo-radius-lg);
    box-shadow: 0 20px 60px rgba(15, 30, 60, 0.3);
}
.modal-header {
    border-bottom: 1px solid var(--halo-border);
    padding: 16px 20px;
}
.modal-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--halo-text);
}
.modal-body { padding: 20px; font-size: 13px; }
.modal-footer { border-top: 1px solid var(--halo-border); padding: 12px 20px; }

/* ─── Dropdowns ───────────────────────────────────────────────────── */

.dropdown-menu {
    border: 1px solid var(--halo-border);
    border-radius: var(--halo-radius-sm);
    padding: 6px;
    font-size: 13px;
    box-shadow: 0 8px 24px rgba(15, 30, 60, 0.08);
}
.dropdown-item {
    border-radius: var(--halo-radius-xs);
    font-size: 13px;
    padding: 6px 10px;
    color: var(--halo-text);
}
.dropdown-item:hover { background: var(--halo-surface-muted); color: var(--halo-primary); }
.dropdown-item:active { background: var(--halo-primary-bg); color: var(--halo-primary); }
.dropdown-divider { border-color: var(--halo-border); margin: 4px 0; }

/* ─── Pagination ──────────────────────────────────────────────────── */

.pagination { font-size: 12px; }
.pagination .page-link {
    border: 1px solid var(--halo-border);
    color: var(--halo-text);
    padding: 6px 11px;
    margin: 0 2px;
    border-radius: var(--halo-radius-xs) !important;
}
.pagination .page-item.active .page-link {
    background: var(--halo-primary);
    border-color: var(--halo-primary);
    color: #fff;
}
.pagination .page-link:hover { background: var(--halo-surface-alt); color: var(--halo-primary); }

/* ─── Tabs (Bootstrap nav-tabs) ───────────────────────────────────── */

.nav-tabs {
    border-bottom: 1px solid var(--halo-border);
    margin-bottom: 16px;
}
.nav-tabs .nav-link {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--halo-text-soft);
    border: 0;
    padding: 9px 14px;
    border-bottom: 2px solid transparent;
    border-radius: 0;
}
.nav-tabs .nav-link:hover { color: var(--halo-primary); background: transparent; }
.nav-tabs .nav-link.active {
    color: var(--halo-primary);
    background: transparent;
    border-bottom-color: var(--halo-primary);
}

/* ─── Page header pattern ─────────────────────────────────────────── */
/*
  Existing pages tend to follow the awkward:
     nav.page-breadcrumb → row → col → card → card-body → h6.card-title

  After these overrides, that pattern renders cleanly. For pages that
  go further and adopt the new pattern, use:
     <h1 class="halo-page-title">Title</h1>
     <p class="halo-page-subtitle">Description</p>
*/
.halo-page-title { font-size: 20px; font-weight: 700; color: var(--halo-text); margin: 0 0 4px; }
.halo-page-subtitle { font-size: 13px; color: var(--halo-text-soft); margin-bottom: 14px; line-height: 1.5; }

/* ─── Misc cleanups ───────────────────────────────────────────────── */

.text-muted { color: var(--halo-text-soft) !important; }
.text-primary { color: var(--halo-primary) !important; }
.text-success { color: var(--halo-success) !important; }
.text-danger  { color: var(--halo-danger) !important; }
.text-warning { color: var(--halo-warning) !important; }

a { color: var(--halo-primary); }
a:hover { color: #18305d; }

/* Soften any old gradient buttons / cards from NobleUI demo */
.bg-gradient-primary { background: var(--halo-primary) !important; background-image: none !important; }
.bg-gradient-success { background: var(--halo-success) !important; background-image: none !important; }
.bg-gradient-danger  { background: var(--halo-danger) !important;  background-image: none !important; }
.bg-gradient-warning { background: var(--halo-warning-bg) !important; background-image: none !important; color: var(--halo-warning); }

/* Footer cleanup — used at the bottom of most legacy pages */
.footer {
    background: var(--halo-surface);
    color: var(--halo-text-faint);
    font-size: 12px;
}
.footer a { color: var(--halo-primary); }

/* Hide the Bootstrap-default copy-of-card-title flicker between page-breadcrumb and card */
nav.page-breadcrumb + .row > .col > .card { margin-top: 0; }
