﻿/* =========================================================
   Consignment Loading - Global Styles
   Palette: White + Blue (Corporate Navy with bright accent)
   ========================================================= */
:root {
    --white: #ffffff;
    --bg: #f4f7fb;
    --surface: #ffffff;
    --navy: #0b2545;
    --navy-700: #13315c;
    --blue: #1d6fe0;
    --blue-600: #1761c4;
    --blue-50: #e8f1fc;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e2e8f0;
    --danger: #dc2626;
    --success: #16a34a;
    --shadow: 0 2px 6px rgba(11, 37, 69, 0.06);
    --shadow-md: 0 6px 20px rgba(11, 37, 69, 0.08);
    --radius: 8px;
    --header-h: 64px;
    --footer-h: 56px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Roboto, -apple-system, BlinkMacSystemFont, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    min-height: 100vh;
    padding-top: var(--header-h);
    padding-bottom: var(--footer-h);
}

a {
    color: var(--blue);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
    }

/* ---------- Fixed Header ---------- */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: var(--navy);
    color: var(--white);
    display: flex;
    align-items: center;
    padding: 0 24px;
    box-shadow: var(--shadow-md);
    z-index: 9999;
}
.swal2-container {
    z-index: 10000 !important;
}
    .app-header .brand {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 18px;
        font-weight: 600;
        letter-spacing: 0.3px;
        margin-right: 36px;
    }

        .app-header .brand .logo {
            width: 32px;
            height: 32px;
            background: var(--blue);
            border-radius: 6px;
            display: grid;
            place-items: center;
            font-weight: 700;
            color: var(--white);
        }

    .app-header nav {
        display: flex;
        gap: 4px;
        flex: 1;
    }

        .app-header nav a {
            color: rgba(255,255,255,0.78);
            padding: 8px 14px;
            border-radius: 6px;
            font-weight: 500;
            font-size: 14px;
            transition: background 0.15s, color 0.15s;
        }

            .app-header nav a:hover {
                background: rgba(255,255,255,0.08);
                color: var(--white);
                text-decoration: none;
            }

            .app-header nav a.active {
                background: var(--blue);
                color: var(--white);
            }

    .app-header .user {
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 13px;
        color: rgba(255,255,255,0.85);
    }

        .app-header .user .avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--blue);
            display: grid;
            place-items: center;
            font-weight: 600;
        }

/* ---------- Fixed Footer ---------- */
.app-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-h);
    background: var(--white);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 24px;
    font-size: 12px;
    color: var(--muted);
    z-index: 9999;
}

/* ---------- Main Content & Cards ---------- */
main {
    max-width: 100%;
    padding: 16px 20px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

    .page-header h1 {
        margin: 0;
        font-size: 20px;
        font-weight: 600;
        color: var(--navy);
    }

    .page-header .subtitle {
        color: var(--muted);
        font-size: 12px;
        margin-top: 4px;
    }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--navy);
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* Pagination specific styling */
.pagination-card {
    padding: 12px 20px;
}

.page-link {
    color: var(--navy);
    border-color: var(--border);
    font-size: 13px;
    padding: 6px 12px;
}

    .page-link:hover {
        background-color: var(--blue-50);
        color: var(--blue);
        border-color: var(--border);
    }

.page-item.active .page-link {
    background-color: var(--blue);
    border-color: var(--blue);
    color: var(--white);
}

.loading-container {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* ---------- Grid Layouts ---------- */
/* TWO COLUMN LAYOUT */
.two-column-layout {
    display: grid;
    grid-template-columns: 1.1fr 1.4fr;
    gap: 20px;
    align-items: start;
}

/* LEFT SIDE */
.left-column {
    display: flex;
    flex-direction: column;
}

/* RIGHT SIDE */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* STACK FORM */
.form-vertical {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.left-column,
.right-column {
    background: var(--surface);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* ITEMS & VEHICLES CARDS */
.items-section,
.vehicles-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
}

    .vehicles-section .table-wrapper {
        max-height: 260px;
        overflow-y: auto;
    }

    .items-section .table-wrapper {
        max-height: 150px;
        overflow-y: auto;
    }
.vehicle-total-section {
    margin-top: 10px;
    padding: 10px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 6px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
}
/* HEADINGS */
.section-heading {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 8px;
}

/* ---------- Form ---------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    align-items: start;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

    .form-group.full {
        grid-column: 1 / -1;
    }

    .form-group label {
        font-size: 12px;
        font-weight: 600;
        margin-bottom: 2px;
        color: var(--navy-700);
    }

        .form-group label .req {
            color: var(--danger);
        }

.form-control {
    padding: 6px 8px;
    font-size: 13px;
    border-radius: 6px;
}

    .form-control:focus {
        outline: none;
        border-color: var(--blue);
        box-shadow: 0 0 0 3px rgba(29, 111, 224, 0.15);
    }

textarea.form-control {
    resize: vertical;
    min-height: 52px;
}

select.form-control {
    cursor: pointer;
}

.input-with-btn {
    display: flex;
    align-items: stretch;
}

    .input-with-btn .form-control,
    .input-with-btn .select2-container--default .select2-selection--single {
        height: 38px !important;
        border-radius: 6px 0 0 6px !important;
    }

    .input-with-btn .select2-container {
        flex: 1;
    }

    .input-with-btn .btn {
        height: 38px;
        border-radius: 0 6px 6px 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

/* Items repeater */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 260px;
    overflow-y: auto;
}

.item-row {
    display: grid;
    grid-template-columns: 2fr 100px auto;
    gap: 10px;
    align-items: center;
}

/*.select2-container {
    z-index: 90 !important;
}*/

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.btn-primary {
    background: var(--blue);
    color: var(--white);
}

    .btn-primary:hover {
        background: var(--blue-600);
    }

.btn-secondary {
    background: var(--white);
    color: var(--navy);
    border-color: var(--border);
}

    .btn-secondary:hover {
        background: var(--blue-50);
        border-color: var(--blue);
        color: var(--blue);
    }

.btn-danger {
    background: var(--white);
    color: var(--danger);
    border-color: var(--border);
}

    .btn-danger:hover {
        background: var(--danger);
        color: var(--white);
        border-color: var(--danger);
    }

.btn-icon {
    padding: 6px 12px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 0 6px 6px 0;
    min-width: 40px;
    justify-content: center;
}

/* RIGHT SIDE ACTIONS */
.right-actions {
    position: sticky;
    bottom: 0;
    background: var(--bg);
    padding: 10px 0;
    z-index: 5;
    box-shadow: 0 -2px 6px rgba(0,0,0,0.04);
}

    .right-actions .btn-primary {
        min-width: 140px;
    }

/* ---------- Tables ---------- */
.table-wrapper {
    overflow-x: auto;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table thead th {
    text-align: left;
    padding: 8px 10px;
    font-size: 11px;
    background: var(--blue-50);
    color: var(--navy);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.data-table tbody td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.data-table .actions {
    display: flex;
    gap: 6px;
}

/* Ensure the actions column has width */
.data-table th:last-child, .data-table td:last-child {
    width: 120px;
    text-align: center;
}

/* Remove arrow from the three-dot button */
.dropdown-toggle::after {
    display: none;
}

.empty-row td {
    text-align: center;
    color: var(--muted);
    padding: 24px;
    font-style: italic;
}

/* ---------- Tabs (Settings) ---------- */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
}

.tab {
    padding: 10px 18px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    font-family: inherit;
}

    .tab:hover {
        color: var(--navy);
    }

    .tab.active {
        color: var(--blue);
        border-bottom-color: var(--blue);
    }

.tab-panel {
    display: none;
}

    .tab-panel.active {
        display: block;
    }

/* ---------- Toast ---------- */
.toast {
    position: fixed;
    bottom: calc(var(--footer-h) + 16px);
    right: 24px;
    background: var(--navy);
    color: var(--white);
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    z-index: 200;
}

    .toast.show {
        opacity: 1;
        transform: translateY(0);
    }

    .toast.success {
        background: var(--success);
    }

/* =========================================================
   Loading Page - Section Differentiation & Visual Hierarchy
   Makes form clearer for all users including elderly
   ========================================================= */

/* Section color accents */
.loading-page .left-column.loading-card {
  border-left: 4px solid var(--blue, #1d6fe0);
  border-radius: 12px;
  padding: 16px;
}
.loading-page .items-section.loading-card {
  border-left: 4px solid var(--success, #16a34a);
  border-radius: 12px;
}
.loading-page .vehicles-section.loading-card {
  border-left: 4px solid #e9730c;
  border-radius: 12px;
}

/* Section headings with icon-like markers */
.loading-page .section-heading {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy, #0b2545);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border, #e2e8f0);
}

/* Form controls - larger for accessibility */
.loading-page .form-group {
  gap: 6px;
  margin-bottom: 14px;
}
.loading-page .form-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy-700, #13315c);
  margin-bottom: 4px;
}
.loading-page .form-control,
.loading-page .typeahead-input {
  min-height: 42px;
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border, #e2e8f0);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.loading-page .form-control:focus,
.loading-page .typeahead-input:focus {
  border-color: var(--blue, #1d6fe0);
  box-shadow: 0 0 0 3px rgba(29, 111, 224, 0.12);
  outline: none;
}
.loading-page textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

/* Input-with-btn: consistent height for add buttons */
.loading-page .input-with-btn .form-control,
.loading-page .input-with-btn .select2-container--default .select2-selection--single {
  height: 42px !important;
  border-radius: 8px 0 0 8px !important;
  border: 1.5px solid var(--border, #e2e8f0);
}
.loading-page .input-with-btn .btn-icon {
  height: 42px;
  min-width: 42px;
  border-radius: 0 8px 8px 0;
  font-size: 16px;
  font-weight: 700;
}

/* Add/Remove row buttons */
.loading-page .remove-row {
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
}
#addItemBtn,
#addVehicleBtn {
  min-height: 42px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  border: 2px dashed var(--border, #e2e8f0);
  background: var(--bg, #f8fafc);
  color: var(--navy-700, #13315c);
  width: 100%;
  justify-content: center;
  transition: all 0.2s;
}
#addItemBtn:hover,
#addVehicleBtn:hover {
  background: var(--blue-50, #e8f1fc);
  border-color: var(--blue, #1d6fe0);
  color: var(--blue, #1d6fe0);
}

/* Vehicle/Item tables inside loading form */
.loading-page .vehicles-section .data-table td:first-child {
  min-width: 200px;
}
.loading-page .data-table thead th {
  background: #f1f5f9;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 10px 10px;
  color: var(--navy-700, #13315c);
}

/* Action buttons at bottom */
.loading-page .loading-actions {
  display: flex;
  gap: 12px;
  padding: 16px 0 0;
  border-top: 1px solid var(--border, #e2e8f0);
  margin-top: 8px;
}
.loading-page .loading-actions .btn {
  flex: 1;
  min-height: 46px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  letter-spacing: 0.3px;
}
.loading-page .loading-actions .btn-primary {
  background: var(--blue, #1d6fe0);
  box-shadow: 0 4px 12px rgba(29, 111, 224, 0.25);
}
.loading-page .loading-actions .btn-secondary {
  background: var(--white, #fff);
  border: 1.5px solid var(--border, #e2e8f0);
  color: var(--muted, #64748b);
}

/* Select2 inside loading page */
.loading-page .select2-container--default .select2-selection--single {
  height: 42px;
  border-radius: 8px;
  border: 1.5px solid var(--border, #e2e8f0);
}
.loading-page .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 40px;
  font-size: 14px;
  padding-left: 12px;
  color: var(--text, #0f172a);
}
.loading-page .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 40px;
}

/* Total quantity box */
.loading-page .vehicle-total-section {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 12px;
}
.loading-page .total-row {
  font-size: 15px;
  font-weight: 700;
  color: #166534;
}
.loading-page .total-row strong {
  font-size: 17px;
}

/* Date field row */
.loading-page .date-inline {
  display: flex;
  gap: 10px;
  width: 100%;
}
.loading-page .date-inline input {
  flex: 1;
  min-height: 42px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .two-column-layout {
        grid-template-columns: 1fr;
    }

    .right-actions {
        position: static;
        box-shadow: none;
        border-top: 1px solid var(--border);
        margin-top: 20px;
        padding-top: 20px;
    }
}
.settings-container {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
}

.settings-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

.settings-link {
    display: block;
    padding: 10px;
    border-radius: 6px;
    color: var(--navy);
    cursor: pointer;
}

    .settings-link.active {
        background: var(--blue);
        color: white;
    }

.settings-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}
@media (max-width: 768px) {
    .app-header {
        padding: 0 14px;
    }

        .app-header .brand {
            margin-right: 14px;
            font-size: 15px;
        }

        .app-header nav a {
            padding: 6px 10px;
            font-size: 13px;
        }

        .app-header .user span {
            display: none;
        }

    main {
        padding: 18px 14px;
    }

    .card {
        padding: 18px 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-group.horizontal {
        flex-direction: column;
        align-items: stretch;
    }

        .form-group.horizontal label {
            width: 100%;
        }

    .date-inline {
        flex-direction: column;
    }
    .item-row {
        grid-template-columns: 1fr 1fr;
    }

        .item-row .btn {
            grid-column: 1 / -1;
            justify-self: end;
        }
    /* ── Page header ── */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

        .page-header .btn-primary {
            width: 100%;
            justify-content: center;
        }

    /* ── Card ── */
    .card {
        padding: 12px;
    }

    /* ── Make table scroll horizontally instead of breaking layout ── */
    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -12px;
        padding: 0 12px 60px;
        width: calc(100% + 24px);
    }

    /* ── Minimum widths so columns don't crush ── */
    .data-table {
        min-width: 680px;
    }

        .data-table th,
        .data-table td {
            font-size: 11px;
            padding: 6px 7px;
            white-space: nowrap;
        }

            /* Allow From→To and vehicle cells to wrap since they have line breaks */
            .data-table td:nth-child(5),
            .data-table td:nth-child(6),
            .data-table td:nth-child(7) {
                white-space: normal;
                min-width: 120px;
            }

        /* ── Action buttons tighter ── */
        .data-table .btn-sm {
            padding: 3px 6px;
            font-size: 11px;
        }

    /* ── Dashboard heading ── */
    .page-header h1 {
        font-size: 17px;
    }

    /* ── Search bar full width ── */
    .searchbar-wrap .searchbar-group {
        max-width: 100%;
    }

    .searchbar-wrap .form-control {
        font-size: 13px;
    }

    /* ── Pagination compact ── */
    .page-link {
        padding: 5px 9px;
        font-size: 12px;
    }

    /* ── Loading form: collapse two-column to single ── */
    .two-column-layout {
        grid-template-columns: 1fr;
    }

    /* ── Horizontal form groups: stack label above input ── */
    .form-group.horizontal {
        flex-direction: column;
        align-items: stretch;
    }

        .form-group.horizontal label {
            width: 100%;
        }

    /* ── Date row side by side stays but shrinks ── */
    .date-inline {
        gap: 6px;
    }

    /* ── Action buttons at bottom full width ── */
    .loading-actions {
        flex-direction: row;
        justify-content: stretch;
    }

        .loading-actions .btn {
            flex: 1;
        }

    /* ── Right actions un-sticky on mobile ── */
    .right-actions {
        position: static;
        box-shadow: none;
        border-top: 1px solid var(--border);
        margin-top: 12px;
        padding-top: 12px;
    }

    /* ── Vehicles table min-width so it scrolls rather than wraps ── */
    .vehicles-section .table-wrapper,
    .items-section .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .vehicles-section .data-table {
        min-width: 380px;
    }

    .items-section .data-table {
        min-width: 260px;
    }

    /* ── Select2 dropdowns full width ── */
    .select2-container {
        width: 100% !important;
    }
    .app-footer {
        font-size: 11px;
        padding: 0 14px;
    }

        .app-footer .left {
            display: none;
        }
}

@media (max-width: 576px) {
    .settings-container {
        grid-template-columns: 1fr;
    }
    .settings-sidebar {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: 8px;
    }
    .settings-sidebar .settings-link {
        padding: 6px 12px;
        font-size: 12px;
    }
    .input-with-btn {
        flex-wrap: nowrap;
    }
    .input-with-btn .btn-icon {
        flex-shrink: 0;
    }
    .input-with-btn .select2-container {
        min-width: 0;
    }
    .dropdown-menu {
        min-width: 100px;
        font-size: 12px;
    }
    .dropdown-item {
        padding: 5px 10px;
        font-size: 12px;
    }
    .app-header .user {
        display: none;
    }
    .card-title {
        font-size: 14px;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }
    .page-header .subtitle {
        font-size: 11px;
    }
    .data-table .actions {
        gap: 4px;
    }
    .data-table .btn-sm {
        padding: 2px 5px;
        font-size: 10px;
    }
    .section-heading {
        font-size: 13px;
    }
    .vehicles-section .table-wrapper {
        max-height: none;
    }
    .items-section .table-wrapper {
        max-height: none;
    }
    #vehiclesBody .input-with-btn {
        flex-wrap: nowrap;
    }
    #vehiclesBody .input-with-btn .select2-container {
        min-width: 0;
    }

    /* Select2 selected text: show more content */
    .select2-selection--single .select2-selection__rendered {
        padding-right: 16px !important;
        padding-left: 6px !important;
        font-size: 12px;
    }
    .select2-container--default .select2-selection--single {
        min-height: 34px;
    }
    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 32px;
    }

    /* Dashboard table: more readable mobile table */
    .data-table th:last-child,
    .data-table td:last-child {
        width: 80px;
    }
    .data-table td:nth-child(1) { min-width: 75px; }
    .data-table td:nth-child(2) { min-width: 80px; }
    .data-table td:nth-child(3) { min-width: 80px; }

    /* Settings table: action columns */
    .data-table th:first-child:nth-last-child(3),
    .data-table td:first-child:nth-last-child(3) ~ td:last-child {
        width: 80px;
    }

    /* Fix typeahead wrapper inside form-group.horizontal stacking */
    .form-group.horizontal .typeahead-wrapper {
        z-index: auto;
        position: relative;
    }
}

@media print {
    .vehicle-total-section {
        display: block !important;
    }
    .dropdown-menu {
        display: none !important;
    }
}
/* ---------- Small UX Enhancements ---------- */
.searchbar-wrap .searchbar-group {
    max-width: 460px;
}

.searchbar-wrap .form-control {
    border-right: 0;
}

.searchbar-wrap .btn {
    min-width: 88px;
}

.table-wrapper {
    border-radius: 8px;
}

.data-table tbody tr td {
    vertical-align: middle;
}

.page-header .btn-primary {
    min-height: 36px;
    font-weight: 600;
}
/* ================================
   HORIZONTAL FORM (LABEL + INPUT)
   ================================ */

.form-group.horizontal {
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

    .form-group.horizontal label {
        width: 180px;
        margin: 0;
        flex-shrink: 0;
    }

    .form-group.horizontal .form-control,
    .form-group.horizontal .input-with-btn,
    .form-group.horizontal textarea,
    .form-group.horizontal .typeahead-wrapper {
        flex: 1;
    }

    /* Fix textarea alignment */
    .form-group.horizontal textarea {
        min-height: 38px;
    }

/* Date dual input row */
.date-inline {
    display: flex;
    gap: 10px;
    width: 100%;
}

    .date-inline input {
        flex: 1;
    }

/* =========================================================
   Typeahead (Google-style autocomplete for project/address)
   ========================================================= */
.typeahead-wrapper {
    position: relative;
    width: 100%;
}

.typeahead-input {
    width: 100%;
}

.typeahead-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(11, 37, 69, 0.10);
    z-index: 1060;
    max-height: 220px;
    overflow-y: auto;
    font-size: 13px;
    margin-top: 2px;
    display: none;
}

.th-option {
    padding: 8px 12px;
    cursor: pointer;
    color: #334155;
}

.th-option:hover,
.th-option.active {
    background: #eff6ff;
    color: #1d4ed8;
}

.th-highlight {
    background: none;
    color: #1d6fe0;
    font-weight: 700;
    padding: 0;
}

.th-option-new {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    border-top: 1px solid #e2e8f0;
    background: #fafafa;
    margin-top: 2px;
}

.th-new-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #1d6fe0;
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    line-height: 1;
}

.th-option-new:hover,
.th-option-new.active {
    background: #eff6ff;
    color: #1d4ed8;
}

.th-option-new strong {
    color: #0f172a;
    font-weight: 600;
}