/* ==========================================================================
   Custom modern overrides — re-skins Bootstrap 4 markup used inside views
   Theme: teal #008777 (Sanatmetal)
   ========================================================================== */
:root {
    --brand:          #008777;
    --brand-2:        #029f8d;
    --brand-3:        #00b89e;
    --brand-soft:     #e6f5f3;
    --brand-soft-2:   #f0faf9;
    --ink:            #1b2733;
    --ink-soft:       #4d5c5a;
    --line:           #e2e8f0;
    --line-2:         #edf2f7;
    --bg:             #f7fafb;
    --warn:           #d97706;
    --danger:         #e11d48;
    --ok:             #16a34a;
    --shadow-sm:      0 1px 2px rgba(0,0,0,.04), 0 1px 3px rgba(0,0,0,.05);
    --shadow-md:      0 4px 12px -2px rgba(15,42,57,.08), 0 2px 4px -1px rgba(15,42,57,.06);
    --shadow-lg:      0 10px 25px -8px rgba(15,42,57,.12), 0 4px 10px -4px rgba(15,42,57,.08);
    --radius:         12px;
    --radius-sm:      8px;
    --radius-lg:      16px;
}

/* Page bg + base typography */
html, body { background: var(--bg) !important; color: var(--ink) !important; font-family: 'Instrument Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { font-size: 14px; line-height: 1.55; }
h1,h2,h3,h4,h5,h6 { color: var(--ink); font-weight: 600; }
.text-secondary, .text-muted { color: var(--ink-soft) !important; }

/* Bootstrap container width inside our modern shell */
.container-fluid { padding-left: 0 !important; padding-right: 0 !important; }

/* ============== CARDS ============== */
.card {
    border: 1px solid var(--line) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-sm) !important;
    background: #fff !important;
}
.card-header {
    background: linear-gradient(180deg,#fafcfd,#f3f7f9) !important;
    border-bottom: 1px solid var(--line) !important;
    border-top-left-radius: var(--radius) !important;
    border-top-right-radius: var(--radius) !important;
    font-weight: 600;
    color: var(--ink) !important;
}
.card-footer {
    background: #fafcfd !important;
    border-top: 1px solid var(--line) !important;
    border-bottom-left-radius: var(--radius) !important;
    border-bottom-right-radius: var(--radius) !important;
}
.card-body { padding: 1.25rem; }

/* ============== BUTTONS ============== */
.btn {
    border-radius: var(--radius-sm) !important;
    font-weight: 500;
    padding: .5rem 1rem;
    transition: all .15s ease-in-out;
    border-width: 1px;
    box-shadow: 0 1px 1px rgba(0,0,0,.03);
}
.btn-sm { padding: .3rem .65rem; font-size: 12.5px; border-radius: 7px !important; }
.btn-lg { padding: .65rem 1.4rem; font-size: 16px; }
.btn:focus, .btn:active { box-shadow: 0 0 0 3px rgba(2,159,141,.18) !important; outline: none; }

.btn-primary {
    background: var(--brand) !important;
    border-color: var(--brand) !important;
    color: #fff !important;
}
.btn-primary:hover { background: #006d61 !important; border-color: #006d61 !important; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-success { background: var(--ok) !important; border-color: var(--ok) !important; color: #fff !important; }
.btn-success:hover { background: #15803d !important; border-color: #15803d !important; }

.btn-info { background: #0ea5e9 !important; border-color: #0ea5e9 !important; color: #fff !important; }
.btn-info:hover { background: #0284c7 !important; border-color: #0284c7 !important; }

.btn-warning { background: #f59e0b !important; border-color: #f59e0b !important; color: #fff !important; }
.btn-warning:hover { background: #d97706 !important; border-color: #d97706 !important; color: #fff !important; }

.btn-danger { background: var(--danger) !important; border-color: var(--danger) !important; color: #fff !important; }
.btn-danger:hover { background: #be123c !important; border-color: #be123c !important; }

.btn-secondary { background: #64748b !important; border-color: #64748b !important; color: #fff !important; }
.btn-secondary:hover { background: #475569 !important; border-color: #475569 !important; }

.btn-outline-primary { color: var(--brand) !important; border-color: var(--brand) !important; background: #fff !important; }
.btn-outline-primary:hover { background: var(--brand) !important; color: #fff !important; }
.btn-outline-secondary { color: #64748b !important; border-color: #cbd5e1 !important; background: #fff !important; }
.btn-outline-secondary:hover { background: #f1f5f9 !important; border-color: #94a3b8 !important; color: #475569 !important; }
.btn-outline-danger { color: var(--danger) !important; border-color: var(--danger) !important; background: #fff !important; }
.btn-outline-danger:hover { background: var(--danger) !important; color: #fff !important; }

.btn-link { color: var(--brand) !important; }
.btn-link:hover { color: #006d61 !important; }

/* ============== FORMS ============== */
.form-control, .custom-select {
    border: 1px solid var(--line) !important;
    border-radius: var(--radius-sm) !important;
    padding: .5rem .75rem;
    font-size: 14px;
    color: var(--ink) !important;
    background-color: #fff !important;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    height: auto;
}
.form-control:focus, .custom-select:focus {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 3px rgba(2,159,141,.15) !important;
    outline: none !important;
}
.form-control:disabled, .form-control[readonly] {
    background-color: #f8fafc !important;
    color: #64748b !important;
}
.form-control-sm { padding: .3rem .55rem; font-size: 12.5px; }
.input-group-text {
    background: #f1f5f9 !important;
    border-color: var(--line) !important;
    color: var(--ink-soft) !important;
    border-radius: var(--radius-sm) !important;
}
label, .form-label { font-weight: 500; color: var(--ink); margin-bottom: .35rem; font-size: 13px; }
.form-text { color: var(--ink-soft); font-size: 12px; }
.form-control.is-valid { border-color: var(--ok) !important; background-image: none !important; }
.form-control.is-invalid { border-color: var(--danger) !important; background-image: none !important; }

/* Select2 (if used) */
.select2-container--default .select2-selection--single {
    height: 38px !important;
    border: 1px solid var(--line) !important;
    border-radius: var(--radius-sm) !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 36px !important; padding-left: .75rem; color: var(--ink); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px !important; }
.select2-container--default.select2-container--focus .select2-selection--single { border-color: var(--brand) !important; box-shadow: 0 0 0 3px rgba(2,159,141,.15) !important; }

/* ============== TABLES ============== */
.table {
    color: var(--ink);
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
}
.table thead th {
    background: #f3f7f9 !important;
    color: var(--ink-soft) !important;
    border-bottom: 1px solid var(--line) !important;
    border-top: 0 !important;
    font-weight: 600;
    text-transform: none;
    letter-spacing: .01em;
    font-size: 12.5px;
    padding: .7rem .75rem;
}
.table tbody td { padding: .65rem .75rem; vertical-align: middle; border-top: 1px solid var(--line-2) !important; }
.table-hover tbody tr:hover { background: var(--brand-soft-2) !important; }
.table-sm thead th, .table-sm tbody td { padding: .45rem .6rem; font-size: 13px; }
.table-bordered, .table-bordered td, .table-bordered th { border-color: var(--line-2) !important; }
.table-responsive { border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }

/* ============== BADGES ============== */
.badge {
    font-weight: 500;
    padding: .35em .65em;
    border-radius: 999px;
    font-size: 11.5px;
    letter-spacing: .01em;
}
.badge-primary { background: var(--brand-soft) !important; color: #00625a !important; }
.badge-secondary { background: #e2e8f0 !important; color: #475569 !important; }
.badge-success { background: #dcfce7 !important; color: #166534 !important; }
.badge-info { background: #e0f2fe !important; color: #075985 !important; }
.badge-warning { background: #fef3c7 !important; color: #92400e !important; }
.badge-danger { background: #ffe4e6 !important; color: #9f1239 !important; }
.badge-light { background: #f1f5f9 !important; color: #475569 !important; }
.badge-dark { background: #334155 !important; color: #fff !important; }

/* ============== ALERTS ============== */
.alert {
    border-radius: var(--radius);
    border: 1px solid transparent;
    padding: .85rem 1rem;
}
.alert-primary { background: var(--brand-soft); color: #00625a; border-color: #b6e3dc; }
.alert-success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.alert-info    { background: #eff6ff; color: #1e3a8a; border-color: #bfdbfe; }
.alert-warning { background: #fffbeb; color: #854d0e; border-color: #fde68a; }
.alert-danger  { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* ============== MODALS ============== */
.modal-content {
    border: 0 !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-lg) !important;
    overflow: hidden;
}
.modal-header { background: linear-gradient(180deg,#fafcfd,#f3f7f9) !important; border-bottom: 1px solid var(--line) !important; }
.modal-header .modal-title { font-weight: 600; color: var(--ink); }
.modal-footer { background: #fafcfd; border-top: 1px solid var(--line); }

/* ============== PAGINATION ============== */
.pagination { gap: 4px; }
.page-link {
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    color: var(--ink-soft) !important;
    margin: 0 !important;
    min-width: 36px;
    text-align: center;
}
.page-link:hover { background: var(--brand-soft) !important; color: var(--brand) !important; border-color: #b6e3dc !important; }
.page-item.active .page-link { background: var(--brand) !important; border-color: var(--brand) !important; color: #fff !important; }
.page-item.disabled .page-link { color: #cbd5e1 !important; background: #fff !important; }

/* ============== NAV TABS ============== */
.nav-tabs { border-bottom: 1px solid var(--line); }
.nav-tabs .nav-link {
    border: 0 !important;
    border-bottom: 2px solid transparent !important;
    color: var(--ink-soft) !important;
    padding: .65rem 1rem;
    font-weight: 500;
}
.nav-tabs .nav-link:hover { color: var(--brand) !important; border-bottom-color: var(--brand-soft) !important; }
.nav-tabs .nav-link.active { color: var(--brand) !important; background: transparent !important; border-bottom-color: var(--brand) !important; }

/* ============== DROPDOWNS ============== */
.dropdown-menu {
    border: 1px solid var(--line) !important;
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-md) !important;
    padding: .35rem;
}
.dropdown-item { border-radius: 6px; padding: .45rem .7rem; font-size: 13.5px; }
.dropdown-item:hover, .dropdown-item:focus { background: var(--brand-soft) !important; color: var(--brand) !important; }
.dropdown-divider { border-color: var(--line-2); }

/* ============== HEADERS / TITLES ============== */
h1.h1, h2.h2, .h2 {
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    color: var(--ink) !important;
    letter-spacing: -0.01em;
}
h2.h2 { padding-bottom: .5rem; }

/* ============== UTILITY OVERRIDES ============== */
.bg-light { background: #f8fafc !important; }
.bg-white { background: #fff !important; }
.bg-primary { background: var(--brand) !important; }
.bg-success { background: var(--ok) !important; }
.bg-warning { background: #f59e0b !important; }
.bg-danger  { background: var(--danger) !important; }

.text-primary { color: var(--brand) !important; }
.text-success { color: var(--ok) !important; }
.text-warning { color: #d97706 !important; }
.text-danger  { color: var(--danger) !important; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: #006d61; text-decoration: underline; }

hr { border-color: var(--line-2); }

/* ============== SWEETALERT 2 ============== */
.swal2-popup { border-radius: var(--radius-lg) !important; }
.swal2-styled.swal2-confirm { background: var(--brand) !important; border-radius: var(--radius-sm) !important; }
.swal2-styled.swal2-confirm:focus { box-shadow: 0 0 0 3px rgba(2,159,141,.3) !important; }
.swal2-styled.swal2-cancel { background: #64748b !important; border-radius: var(--radius-sm) !important; }
.swal2-icon.swal2-success { border-color: var(--ok) !important; color: var(--ok) !important; }

/* ============== OFFER PAGE specific (keeps prior tweaks) ============== */
.offer-pricing-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .5rem; align-items: end; }
.offer-pricing-fields .form-group { margin-bottom: 0; }
.offer-subcategory-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 1rem; }
@media (max-width: 991px) { .offer-subcategory-grid { grid-template-columns: 1fr; } }

@keyframes warningBlink { 0%, 100% { border-color: var(--warn); box-shadow: 0 0 0 3px rgba(217,119,6,.18); } 50% { border-color: #fbbf24; box-shadow: 0 0 0 3px rgba(251,191,36,.25); } }
.warn-blink { animation: warningBlink 1s ease-in-out infinite; }

/* Hide native AdminLTE remnants if any view ever loads them by accident */
.main-header, .main-sidebar, .main-footer, .content-header { display: none !important; }
.content-wrapper { padding: 0 !important; min-height: auto !important; background: transparent !important; margin: 0 !important; }
.wrapper { display: contents !important; }

/* x-cloak for Alpine */
[x-cloak] { display: none !important; }

/* Section title */
.section-title { font-size: 1.1rem; font-weight: 600; color: var(--ink); margin: 1.25rem 0 .75rem; padding-bottom: .35rem; border-bottom: 1px solid var(--line-2); }

/* Inputs in tables */
.table .form-control, .table .form-control-sm { font-size: 12.5px; padding: .3rem .5rem; }

/* File inputs */
.custom-file-label { border-radius: var(--radius-sm) !important; border-color: var(--line) !important; }
.custom-file-label::after { background: var(--brand-soft) !important; color: var(--brand) !important; border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; }

/* ==========================================================================
   APP SHELL — sidebar + topbar (no Tailwind dependency)
   ========================================================================== */
:root {
    --sidebar-w: 260px;
    --topbar-h: 64px;
}
*, *::before, *::after { box-sizing: border-box; }
.app-body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
.app-shell { min-height: 100vh; }

/* ===== Sidebar ===== */
.app-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-w);
    z-index: 1040;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #008777 0%, #029f8d 55%, #00b89e 100%);
    color: #fff;
    box-shadow: 4px 0 20px -10px rgba(0,0,0,.25);
    transform: translateX(0);
    transition: transform .2s ease-in-out;
}
.app-sidebar__brand {
    height: var(--topbar-h);
    padding: 0 18px;
    display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,.15);
    flex-shrink: 0;
}
.app-sidebar__logo {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 16px;
    overflow: hidden;
    flex-shrink: 0;
    padding: 4px;
}
.app-sidebar__logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}
.app-sidebar__title { font-weight: 600; font-size: 15px; color: #fff; line-height: 1.1; }
.app-sidebar__subtitle { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.75); margin-top: 2px; }
.app-sidebar__nav { flex: 1; overflow-y: auto; padding: 16px 12px; }
.app-nav-section {
    padding: 12px 12px 6px;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: rgba(255,255,255,.65);
    font-weight: 600;
}
.app-nav-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.app-nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #fff !important;
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none !important;
    transition: background .15s ease, transform .15s ease;
}
.app-nav-link i { width: 18px; text-align: center; font-size: 14px; opacity: .95; }
.app-nav-link:hover { background: rgba(255,255,255,.14); color: #fff !important; }
.app-nav-link.is-active { background: rgba(255,255,255,.22); color: #fff !important; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.app-sidebar__footer {
    padding: 12px 18px;
    border-top: 1px solid rgba(255,255,255,.15);
    font-size: 11px;
    color: rgba(255,255,255,.65);
    flex-shrink: 0;
}
.app-sidebar-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1030;
    display: none;
}

/* ===== Main column ===== */
.app-main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Topbar ===== */
.app-topbar {
    position: sticky; top: 0;
    z-index: 1020;
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.app-topbar__inner {
    height: var(--topbar-h);
    padding: 0 24px;
    display: flex; align-items: center; gap: 16px;
}
.app-topbar__burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent; border: 0;
    width: 38px; height: 38px;
    border-radius: 8px;
    color: #475569;
    cursor: pointer;
    flex-shrink: 0;
}
.app-topbar__burger:hover { background: #f1f5f9; }
.app-topbar__title { flex: 1; min-width: 0; }
.app-topbar__eyebrow { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: #94a3b8; font-weight: 600; }
.app-topbar__lead { font-size: 14px; color: var(--ink); font-weight: 500; margin-top: 1px; }
.app-topbar__sub {
    padding: 12px 24px;
    border-top: 1px solid var(--line-2);
    background: #fff;
}
.app-topbar__sub > .row:last-child,
.app-topbar__sub > div:last-child { margin-bottom: 0; }

/* ===== User menu ===== */
.app-user { position: relative; }
.app-user__btn {
    display: flex; align-items: center; gap: 10px;
    padding: 5px 12px 5px 5px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    transition: all .15s ease;
}
.app-user__btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.app-user__avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff; font-weight: 600; font-size: 13px;
    display: flex; align-items: center; justify-content: center;
}
.app-user__meta { text-align: left; line-height: 1.15; }
.app-user__name { font-size: 13px; font-weight: 600; color: var(--ink); }
.app-user__email { font-size: 11px; color: #94a3b8; }
.app-user__caret { font-size: 11px; color: #94a3b8; }
.app-user__menu {
    position: absolute; right: 0; top: calc(100% + 6px);
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    z-index: 1100;
}
.app-user__item {
    width: 100%;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    background: transparent; border: 0;
    color: #334155;
    font-size: 13px; text-align: left;
    cursor: pointer;
    text-decoration: none !important;
}
.app-user__item i { width: 16px; color: #94a3b8; }
.app-user__item:hover { background: #f8fafc; color: var(--brand); }
.app-user__item:hover i { color: var(--brand); }
.app-user__item--danger { color: #e11d48; border-top: 1px solid var(--line-2); }
.app-user__item--danger i { color: #e11d48; }
.app-user__item--danger:hover { background: #fff1f2; color: #be123c; }

/* ===== Content ===== */
.app-content { flex: 1; padding: 20px; min-width: 0; }
.app-content__inner { width: 100%; margin: 0; min-width: 0; }
.app-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    padding: 20px;
    min-width: 0;
}
.app-footer {
    padding: 18px 24px;
    text-align: center;
    font-size: 11.5px;
    color: #94a3b8;
}

/* Sidebar collapsed (desktop) */
.app-shell.sidebar-collapsed .app-sidebar { width: 0; overflow: hidden; box-shadow: none; }
.app-shell.sidebar-collapsed .app-main { margin-left: 0; }

/* ===== Mobile ===== */
@media (max-width: 991px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.is-open { transform: translateX(0); }
    .app-sidebar-overlay.is-open { display: block; }
    .app-main { margin-left: 0; }
    .app-shell.sidebar-collapsed .app-main { margin-left: 0; }
    .app-content { padding: 16px; }
    .app-card { padding: 16px; border-radius: 12px; }
    .app-user__meta { display: none; }
}

/* ===== Adjust card padding when content_header used ===== */
.app-card .container-fluid > .row:first-child > .col-md-12:first-child > h2.h2 { margin-top: 0 !important; }

