/* =========================================================================
   M A ALUMINUM & GLASS WORKS — ADMIN DASHBOARD DESIGN SYSTEM
   Bootstrap 5 based. All brand colors are expressed as CSS variables so
   every component pulls from a single source of truth.
   ========================================================================= */

/* Poppins is defined locally in the Blade layout via asset() helpers so the
   app remains fully local without relying on external font CDNs. */

:root {
    /* Brand */
    --brand-primary: #0c5cae;
    --brand-logo-blue: #0e57a5;
    --brand-dark-gray: #37404f;

    /* Extended palette */
    --brand-blue: #1e81b0;
    --brand-navy: #063970;
    --brand-steel: #154c79;
    --brand-light-blue: #76b5c5;
    --brand-pale-blue: #abdbe3;
    --brand-cream: #eeeee4;
    --brand-orange: #e28743;
    --brand-orange-light: #eab676;
    --brand-brown: #873e23;
    --brand-dark-text: #21130d;

    /* Semantic */
    --body-bg: #f8f9fa;
    --surface: #ffffff;
    --border-color: #e9ecef;
    --text-heading: #21130d;
    --text-body: #4b5563;
    --text-muted: #8891a0;

    --link: var(--brand-primary);
    --link-hover: var(--brand-navy);

    --sidebar-bg: var(--brand-dark-gray);
    --sidebar-active: var(--brand-primary);
    --sidebar-hover: var(--brand-steel);
    --sidebar-width: 280px;
    --sidebar-width-collapsed: 84px;
    --topbar-height: 72px;

    --radius-lg: 12px;
    --radius-md: 10px;
    --radius-sm: 8px;

    --shadow-soft: 0 2px 10px rgba(33, 19, 13, 0.05), 0 1px 2px rgba(33, 19, 13, 0.04);
    --shadow-medium: 0 8px 24px rgba(6, 57, 112, 0.08);
    --shadow-hover: 0 12px 28px rgba(6, 57, 112, 0.14);

    --transition-fast: 150ms ease;
    --transition-base: 220ms cubic-bezier(.4,0,.2,1);
}

/* =========================================================================
   BASE
   ========================================================================= */
* { box-sizing: border-box; }

html, body {
    height: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
    background-color: var(--body-bg);
    color: var(--text-body);
    -webkit-font-smoothing: antialiased;
    font-size: 0.9375rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    color: var(--text-heading);
    letter-spacing: -0.01em;
}

a { color: var(--link); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--link-hover); }

::selection { background: var(--brand-pale-blue); color: var(--brand-navy); }

/* Focus visibility (accessibility) */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .form-control:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* Signature texture — a faint brushed-aluminum / glass-pane linear weave
   used sparingly on auth screens and sidebar header only. */
.brushed-texture {
    background-image:
        repeating-linear-gradient(115deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 1px, transparent 1px, transparent 6px),
        linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-steel) 45%, var(--brand-primary) 100%);
}

.glass-pane-corner {
    position: relative;
    overflow: hidden;
}
.glass-pane-corner::before {
    content: "";
    position: absolute;
    top: -22px; right: -22px;
    width: 64px; height: 64px;
    background: linear-gradient(135deg, var(--brand-pale-blue) 0%, var(--brand-light-blue) 100%);
    transform: rotate(45deg);
    opacity: .35;
}

/* =========================================================================
   LAYOUT SHELL
   ========================================================================= */
.app-shell { display: flex; min-height: 100vh; }

.main-content {
    flex: 1 1 auto;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left var(--transition-base);
}
body.sidebar-collapsed .main-content { margin-left: var(--sidebar-width-collapsed); }

.content-area {
    flex: 1 1 auto;
    padding: 1.75rem;
    max-width: 100%;
}

@media (max-width: 991.98px) {
    .main-content { margin-left: 0 !important; }
}

/* =========================================================================
   SIDEBAR
   ========================================================================= */
.sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #cfd4dc;
    z-index: 1030;
    display: flex;
    flex-direction: column;
    transition: width var(--transition-base), transform var(--transition-base);
}
body.sidebar-collapsed .sidebar { width: var(--sidebar-width-collapsed); }

.sidebar-brand {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 1.5rem;
    flex-shrink: 0;
}
.sidebar-brand .brand-mark {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-navy));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 1.05rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(6,57,112,.35);
}
.sidebar-brand .brand-text { line-height: 1.15; overflow: hidden; white-space: nowrap; }
.sidebar-brand .brand-text strong { display: block; color: #fff; font-size: .95rem; font-weight: 700; letter-spacing: .2px; }
.sidebar-brand .brand-text span { display: block; color: var(--brand-pale-blue); font-size: .7rem; font-weight: 500; letter-spacing: .5px; text-transform: uppercase; }
body.sidebar-collapsed .brand-text { display: none; }

.sidebar-nav { flex: 1 1 auto; overflow-y: auto; padding: .75rem .9rem; }
.sidebar-nav::-webkit-scrollbar { width: 5px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 10px; }

.sidebar-section-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #8b93a3;
    font-weight: 600;
    padding: 1rem .75rem .4rem;
}
body.sidebar-collapsed .sidebar-section-label { text-align: center; padding: 1rem 0 .4rem; }

.nav-item-custom { margin-bottom: .2rem; }
.nav-link-custom {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .68rem .85rem;
    border-radius: var(--radius-sm);
    color: #cfd4dc;
    font-size: .875rem;
    font-weight: 500;
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
    position: relative;
    white-space: nowrap;
}
.nav-link-custom i { font-size: 1.05rem; width: 22px; text-align: center; flex-shrink: 0; }
.nav-link-custom:hover { background: var(--sidebar-hover); color: #fff; transform: translateX(2px); }
.nav-link-custom.active {
    background: var(--sidebar-active);
    color: #fff;
    box-shadow: 0 4px 12px rgba(12,92,174,.35);
}
.nav-link-custom .badge-count { margin-left: auto; }
body.sidebar-collapsed .nav-link-custom span.link-text { display: none; }
body.sidebar-collapsed .nav-link-custom { justify-content: center; }
body.sidebar-collapsed .nav-link-custom .badge-count { display: none; }

.sidebar-footer {
    padding: 1rem 1.1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}
.sidebar-user { display: flex; align-items: center; gap: .65rem; }
.sidebar-user .avatar-sm {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--brand-steel); color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: .85rem; flex-shrink: 0;
}
.sidebar-user .user-meta { overflow: hidden; }
.sidebar-user .user-meta strong { display: block; color: #fff; font-size: .82rem; }
.sidebar-user .user-meta span { display: block; color: #8b93a3; font-size: .72rem; }
body.sidebar-collapsed .sidebar-user .user-meta { display: none; }

/* Mobile sidebar behavior */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-width); }
    body.sidebar-mobile-open .sidebar { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.35); }
    .sidebar-backdrop {
        display: none;
        position: fixed; inset: 0; background: rgba(15,20,28,.5);
        z-index: 1025;
    }
    body.sidebar-mobile-open .sidebar-backdrop { display: block; }
}

/* =========================================================================
   TOP NAVBAR
   ========================================================================= */
.topbar {
    position: sticky; top: 0; z-index: 1020;
    height: var(--topbar-height);
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
}
.topbar .sidebar-toggle-btn {
    border: none; background: var(--body-bg); color: var(--brand-dark-gray);
    width: 40px; height: 40px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition-fast);
}
.topbar .sidebar-toggle-btn:hover { background: var(--brand-pale-blue); color: var(--brand-navy); }

.topbar-search {
    max-width: 360px; width: 100%;
    position: relative;
}
.topbar-search input {
    background: var(--body-bg);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: .55rem 1rem .55rem 2.4rem;
    font-size: .85rem;
}
.topbar-search input:focus { background: #fff; border-color: var(--brand-primary); box-shadow: 0 0 0 3px rgba(12,92,174,.1); }
.topbar-search i { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.topbar-icon-btn {
    position: relative;
    width: 42px; height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    color: var(--brand-dark-gray);
    transition: all var(--transition-fast);
}
.topbar-icon-btn:hover { background: var(--brand-pale-blue); border-color: var(--brand-pale-blue); color: var(--brand-navy); }
.topbar-icon-btn .dot {
    position: absolute; top: 8px; right: 9px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--brand-orange); border: 2px solid #fff;
}

.profile-trigger { display: flex; align-items: center; gap: .6rem; padding: .3rem .5rem .3rem .3rem; border-radius: 30px; border: 1px solid var(--border-color); background: #fff; }
.profile-trigger:hover { background: var(--body-bg); }
.profile-trigger .avatar-sm { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: .8rem; }
.profile-trigger .meta { text-align: left; line-height: 1.1; }
.profile-trigger .meta strong { display: block; font-size: .8rem; color: var(--text-heading); }
.profile-trigger .meta span { display: block; font-size: .7rem; color: var(--text-muted); }

/* =========================================================================
   BREADCRUMB / PAGE HEADER
   ========================================================================= */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: .2rem; }
.page-header p.subtitle { color: var(--text-muted); font-size: .85rem; margin-bottom: 0; }

.breadcrumb-custom {
    display: flex; align-items: center; gap: .4rem;
    font-size: .78rem; color: var(--text-muted); margin-bottom: .5rem;
}
.breadcrumb-custom a { color: var(--text-muted); font-weight: 500; }
.breadcrumb-custom a:hover { color: var(--brand-primary); }
.breadcrumb-custom .sep { color: #c7ccd4; }
.breadcrumb-custom .current { color: var(--brand-dark-gray); font-weight: 600; }

/* =========================================================================
   CARDS
   ========================================================================= */
.card-custom {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card-custom.hoverable:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.card-custom .card-header-custom {
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    gap: .75rem;
}
.card-custom .card-header-custom h6 { margin: 0; font-weight: 600; font-size: .92rem; }
.card-custom .card-body-custom { padding: 1.35rem; }
.card-custom .card-footer-custom { padding: .9rem 1.35rem; border-top: 1px solid var(--border-color); background: #fbfbfc; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* Stat / widget cards */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 1.35rem;
    position: relative;
    overflow: hidden;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.stat-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.stat-card .stat-icon {
    width: 46px; height: 46px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    margin-bottom: .9rem;
}
.stat-card .stat-title { font-size: .8rem; color: var(--text-muted); font-weight: 500; margin-bottom: .3rem; }
.stat-card .stat-value { font-size: 1.55rem; font-weight: 700; color: var(--text-heading); line-height: 1.2; }
.stat-card .stat-trend { font-size: .76rem; font-weight: 600; display: inline-flex; align-items: center; gap: .25rem; margin-top: .55rem; }
.stat-card .stat-trend.up { color: #1a9d5e; }
.stat-card .stat-trend.down { color: #d9484f; }
.stat-card .stat-trend .trend-period { color: var(--text-muted); font-weight: 400; margin-left: .15rem; }

.icon-tint-blue   { background: rgba(12,92,174,.1);  color: var(--brand-primary); }
.icon-tint-navy   { background: rgba(6,57,112,.1);   color: var(--brand-navy); }
.icon-tint-steel  { background: rgba(21,76,121,.1);  color: var(--brand-steel); }
.icon-tint-teal   { background: rgba(118,181,197,.2); color: var(--brand-steel); }
.icon-tint-orange { background: rgba(226,135,67,.12); color: var(--brand-orange); }
.icon-tint-green  { background: rgba(25,135,84,.1);  color: #198754; }

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn { font-weight: 500; font-size: .85rem; border-radius: var(--radius-sm); padding: .55rem 1.1rem; transition: all var(--transition-fast); }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }

.btn-secondary { background: var(--brand-dark-gray); border-color: var(--brand-dark-gray); color: #fff; }
.btn-secondary:hover, .btn-secondary:focus { background: var(--brand-dark-text); border-color: var(--brand-dark-text); color: #fff; }

.btn-warning { background: var(--brand-orange); border-color: var(--brand-orange); color: #fff; }
.btn-warning:hover { background: #c96f30; border-color: #c96f30; color: #fff; }

.btn-info { background: var(--brand-light-blue); border-color: var(--brand-light-blue); color: #06304f; }
.btn-info:hover { background: #5da2b5; border-color: #5da2b5; color: #06304f; }

.btn-outline-primary { color: var(--brand-primary); border-color: var(--brand-primary); }
.btn-outline-primary:hover { background: var(--brand-primary); border-color: var(--brand-primary); }

.btn-outline-secondary { color: var(--brand-dark-gray); border-color: #c9ced6; }
.btn-outline-secondary:hover { background: var(--brand-dark-gray); border-color: var(--brand-dark-gray); }

.btn-sm { padding: .38rem .75rem; font-size: .78rem; }
.btn-lg { padding: .75rem 1.5rem; font-size: .95rem; }

.btn-icon { width: 38px; height: 38px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); }
.btn-icon.btn-sm { width: 32px; height: 32px; }

.btn-icon-action {
    width: 32px; height: 32px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color); background: #fff; color: var(--text-muted);
    transition: all var(--transition-fast); font-size: .85rem;
}
.btn-icon-action:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.btn-icon-action.action-view:hover { background: rgba(12,92,174,.1); color: var(--brand-primary); border-color: rgba(12,92,174,.2); }
.btn-icon-action.action-edit:hover { background: rgba(226,135,67,.12); color: var(--brand-orange); border-color: rgba(226,135,67,.25); }
.btn-icon-action.action-delete:hover { background: rgba(217,72,79,.1); color: #d9484f; border-color: rgba(217,72,79,.25); }
.btn-icon-action.action-print:hover { background: rgba(55,64,79,.1); color: var(--brand-dark-gray); border-color: rgba(55,64,79,.2); }

/* =========================================================================
   BADGES
   ========================================================================= */
.badge-status { font-weight: 600; font-size: .72rem; padding: .4em .7em; border-radius: 30px; letter-spacing: .01em; }
.badge-status.status-active   { background: rgba(25,135,84,.12); color: #198754; }
.badge-status.status-pending  { background: rgba(226,135,67,.15); color: var(--brand-brown); }
.badge-status.status-completed{ background: rgba(12,92,174,.12); color: var(--brand-primary); }
.badge-status.status-overdue  { background: rgba(217,72,79,.12); color: #d9484f; }
.badge-status.status-onhold   { background: rgba(139,147,163,.15); color: #5b6270; }
.badge-status.status-inactive { background: rgba(107,114,128,.15); color: #4b5563; }
.badge-status.status-paid     { background: rgba(25,135,84,.12); color: #198754; }
.badge-status.status-partial  { background: rgba(118,181,197,.2); color: var(--brand-steel); }
.badge-status.status-unpaid   { background: rgba(217,72,79,.12); color: #d9484f; }

/* =========================================================================
   TABLES
   ========================================================================= */
.table-toolbar {
    display: flex; flex-wrap: wrap; gap: .75rem;
    align-items: center; justify-content: space-between;
    padding: 1.1rem 1.35rem;
    border-bottom: 1px solid var(--border-color);
}
.table-toolbar .search-box { position: relative; min-width: 240px; flex: 1 1 260px; max-width: 340px; }
.table-toolbar .search-box input { padding-left: 2.3rem; border-radius: var(--radius-sm); font-size: .85rem; }
.table-toolbar .search-box i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.table-toolbar .toolbar-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

.table-responsive-custom { overflow-x: auto; }

.table-custom { margin-bottom: 0; font-size: .85rem; }
.table-custom thead th {
    position: sticky; top: 0; z-index: 2;
    background: #fbfbfc;
    color: var(--text-muted);
    font-weight: 600;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-bottom: 1px solid var(--border-color);
    padding: .85rem 1.1rem;
    white-space: nowrap;
}
.table-sort-btn {
    border: none;
    background: transparent;
    color: inherit;
    text-transform: inherit;
    font-size: inherit;
    letter-spacing: inherit;
    font-weight: inherit;
    padding: 0;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    transition: color var(--transition-fast);
}
.table-sort-btn .sort-indicator {
    width: 12px;
    height: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #b1b8c4;
    font-size: .68rem;
}
.table-sort-btn .sort-indicator::before { content: '\2195'; }
.table-sort-btn.is-sorted { color: var(--brand-primary); }
.table-sort-btn.is-sorted.is-asc .sort-indicator::before { content: '\2191'; }
.table-sort-btn.is-sorted.is-desc .sort-indicator::before { content: '\2193'; }
.table-sort-btn:hover { color: var(--brand-primary); }
.table-custom tbody td { padding: .85rem 1.1rem; vertical-align: middle; border-bottom: 1px solid var(--border-color); color: var(--text-body); }
.table-custom tbody tr:last-child td { border-bottom: none; }
.table-custom tbody tr:nth-child(even) { background: #fbfcfd; }
.table-custom tbody tr { transition: background var(--transition-fast); }
.table-custom tbody tr:hover { background: rgba(12,92,174,.045); }

.table-cell-primary { font-weight: 600; color: var(--text-heading); }
.table-actions { display: flex; gap: .4rem; }

.table-pagination {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem;
    padding: 1rem 1.35rem;
    border-top: 1px solid var(--border-color);
}
.table-pagination .pagination-info { font-size: .8rem; color: var(--text-muted); }
.pagination-custom { display: flex; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.pagination-custom button {
    width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border-color); background: #fff;
    font-size: .8rem; color: var(--text-body); font-weight: 500;
}
.pagination-custom button.active { background: var(--brand-primary); border-color: var(--brand-primary); color: #fff; }
.pagination-custom button:hover:not(.active) { background: var(--body-bg); }

/* Projects datatable refinement */
.projects-datatable .table-toolbar {
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    border-bottom: 1px solid #e5ebf4;
    padding-top: 1rem;
    padding-bottom: 1rem;
}
.projects-datatable .table-toolbar .form-control,
.projects-datatable .table-toolbar .form-select {
    border-color: #d9e0ea;
    background: #fff;
    min-height: 36px;
    font-size: .82rem;
}
.projects-datatable .table-toolbar .form-control:focus,
.projects-datatable .table-toolbar .form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(12,92,174,.12);
}
.projects-datatable .table-toolbar .toolbar-actions {
    align-items: center;
    row-gap: .55rem;
}
.projects-datatable .table-custom thead th {
    background: #f4f7fc;
    box-shadow: inset 0 -1px 0 var(--border-color);
    color: #6f7c8f;
}
.projects-datatable .table-custom tbody td {
    padding-top: .95rem;
    padding-bottom: .95rem;
    border-bottom-color: #edf1f7;
}
.projects-datatable .table-custom tbody tr:hover {
    background: linear-gradient(90deg, rgba(12,92,174,.06) 0%, rgba(12,92,174,.02) 100%);
}
.projects-datatable .table-actions .btn-icon-action {
    box-shadow: 0 1px 2px rgba(33, 19, 13, 0.04);
    width: 30px;
    height: 30px;
}
.projects-datatable .table-pagination {
    background: #f8fafe;
    border-top: 1px solid #e7edf6;
}
.projects-datatable .pagination-custom button {
    border-radius: 9px;
    font-weight: 600;
    width: 34px;
    height: 34px;
}
.projects-datatable .pagination-custom button.active {
    box-shadow: 0 4px 10px rgba(12,92,174,.25);
}
.projects-datatable.is-loading .table-responsive-custom {
    opacity: .72;
    transition: opacity var(--transition-fast);
}
.projects-datatable .table-sort-btn {
    color: inherit;
    font-size: .72rem;
}
.projects-datatable .table-sort-btn .sort-indicator {
    color: #a7b2c2;
}
.projects-datatable .table-sort-btn.is-sorted {
    color: var(--brand-primary);
}
.projects-datatable .table-toolbar .btn {
    min-height: 36px;
}

@media (max-width: 991.98px) {
    .projects-datatable .table-toolbar {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .projects-datatable .table-toolbar .toolbar-actions {
        width: 100%;
    }
}

.projects-vendors-section .table-toolbar {
    background: #fbfcff;
    padding-top: .95rem;
    padding-bottom: .95rem;
}
.projects-vendors-section .badge-count {
    background: rgba(12,92,174,.08) !important;
    color: var(--brand-primary) !important;
    font-weight: 600;
}

@media (max-width: 767.98px) {
    .table-custom thead { display: none; }
    .table-custom, .table-custom tbody, .table-custom tr, .table-custom td { display: block; width: 100%; }
    .table-custom tbody tr { border: 1px solid var(--border-color); border-radius: var(--radius-md); margin-bottom: .85rem; padding: .5rem .25rem; }
    .table-custom tbody td { display: flex; justify-content: space-between; gap: 1rem; text-align: right; border-bottom: 1px dashed var(--border-color); }
    .table-custom tbody td:last-child { border-bottom: none; }
    .table-custom tbody td::before { content: attr(data-label); font-weight: 600; color: var(--text-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; text-align: left; }
}

/* =========================================================================
   FORMS
   ========================================================================= */
.form-section-title {
    font-size: .95rem; font-weight: 600; color: var(--text-heading);
    display: flex; align-items: center; gap: .55rem;
    margin-bottom: 1.1rem; padding-bottom: .6rem; border-bottom: 1px solid var(--border-color);
}
.form-section-title i { color: var(--brand-primary); }

.form-floating > label { color: var(--text-muted); font-size: .85rem; }
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid #d9dde3;
    font-size: .875rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(12,92,174,.12);
}
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label { color: var(--brand-primary); }

.required-mark { color: #d9484f; margin-left: .15rem; }
.invalid-feedback { font-size: .78rem; }
.form-control.is-invalid, .form-select.is-invalid { border-color: #d9484f; }

.input-group-text-custom { background: var(--body-bg); border-color: #d9dde3; color: var(--text-muted); }

/* Dynamic section reveal */
.dynamic-section {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height var(--transition-base), opacity var(--transition-base), margin var(--transition-base);
}
.dynamic-section.show-section { max-height: 600px; opacity: 1; }

/* File upload dropzone */
.file-upload-zone {
    border: 2px dashed #cfd6e0;
    border-radius: var(--radius-md);
    background: var(--body-bg);
    padding: 2rem 1.25rem;
    text-align: center;
    transition: all var(--transition-fast);
    cursor: pointer;
}
.file-upload-zone:hover, .file-upload-zone.dragover { border-color: var(--brand-primary); background: rgba(12,92,174,.05); }
.file-upload-zone i { font-size: 2rem; color: var(--brand-primary); margin-bottom: .5rem; }
.file-upload-zone p { margin-bottom: .2rem; font-weight: 500; color: var(--text-heading); font-size: .88rem; }
.file-upload-zone small { color: var(--text-muted); }

/* Payment method selector cards */
.method-select { display: flex; flex-wrap: wrap; gap: .65rem; }
.method-option { display: none; }
.method-option-label {
    border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    padding: .6rem 1rem; font-size: .82rem; font-weight: 500; color: var(--text-body);
    display: flex; align-items: center; gap: .5rem; cursor: pointer;
    transition: all var(--transition-fast); background: #fff;
}
.method-option-label i { font-size: 1rem; }
.method-option:checked + .method-option-label {
    border-color: var(--brand-primary); background: rgba(12,92,174,.07); color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(12,92,174,.1);
}

/* =========================================================================
   TIMELINE
   ========================================================================= */
.timeline { position: relative; padding-left: 2.1rem; }
.timeline::before { content: ""; position: absolute; left: 10px; top: 6px; bottom: 6px; width: 2px; background: var(--border-color); }
.timeline-item { position: relative; padding-bottom: 1.6rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
    position: absolute; left: -2.1rem; top: 0;
    width: 22px; height: 22px; border-radius: 50%;
    background: #fff; border: 3px solid var(--brand-primary);
    display: flex; align-items: center; justify-content: center;
}
.timeline-item.done .timeline-marker { background: var(--brand-primary); }
.timeline-item.pending .timeline-marker { border-color: #c9ced6; }
.timeline-content h6 { font-size: .86rem; font-weight: 600; margin-bottom: .15rem; }
.timeline-content p { font-size: .8rem; color: var(--text-muted); margin-bottom: .15rem; }
.timeline-content .timeline-date { font-size: .72rem; color: #a8aebb; }

/* =========================================================================
   EMPTY STATES
   ========================================================================= */
.empty-state { text-align: center; padding: 3.5rem 1.5rem; }
.empty-state .empty-icon {
    width: 84px; height: 84px; border-radius: 50%;
    background: rgba(12,92,174,.08); color: var(--brand-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.1rem; margin: 0 auto 1.25rem;
}
.empty-state h6 { font-weight: 600; margin-bottom: .4rem; }
.empty-state p { color: var(--text-muted); font-size: .85rem; max-width: 320px; margin: 0 auto 1.25rem; }

/* =========================================================================
   FOOTER
   ========================================================================= */
.app-footer {
    padding: 1.1rem 1.75rem;
    border-top: 1px solid var(--border-color);
    background: #fff;
    font-size: .8rem;
    color: var(--text-muted);
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem;
}
.app-footer a { color: var(--text-muted); font-weight: 500; }
.app-footer a:hover { color: var(--brand-primary); }

/* =========================================================================
   LOGIN PAGE
   ========================================================================= */
.auth-wrapper { min-height: 100vh; display: flex; }
.auth-aside {
    flex: 1 1 46%;
    display: none;
    position: relative;
    color: #fff;
    padding: 3rem;
    flex-direction: column;
    justify-content: space-between;
}
.auth-aside .aside-content { position: relative; z-index: 2; max-width: 420px; }
.auth-aside::after {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(circle at 80% 20%, rgba(171,219,227,.18), transparent 55%);
}
@media (min-width: 992px) { .auth-aside { display: flex; } }

.auth-panel { flex: 1 1 54%; display: flex; align-items: center; justify-content: center; padding: 2rem 1.25rem; background: #fff; }
.auth-card { width: 100%; max-width: 400px; }
.auth-logo-mark {
    width: 52px; height: 52px; border-radius: 14px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-navy));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 1.3rem; margin-bottom: 1.25rem;
    box-shadow: 0 8px 20px rgba(6,57,112,.25);
}

/* =========================================================================
   MISC
   ========================================================================= */
.section-divider { height: 1px; background: var(--border-color); margin: 1.75rem 0; }
.chart-placeholder { height: 280px; display: flex; align-items: center; justify-content: center; }
.toast-custom { border-radius: var(--radius-md); border: none; box-shadow: var(--shadow-medium); }
.fade-in-up { animation: fadeInUp .4s ease both; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
