/* ------------------------------------------------------
   Auto Transport Manager - Global Styles
   Clean, Modern, Professional Layout
------------------------------------------------------ */

/* -------------------------
   CSS Reset
------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-family: "Inter", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f6f8;
    color: #333;
}

body {
    line-height: 1.5;
    font-size: 16px;
}

/* -------------------------
   Layout Helpers
------------------------- */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 20px;
}

/* -------------------------
   Top Navigation Bar
------------------------- */
.topbar {
    width: 100%;
    background: #0b5ed7;
    color: white;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.logo-text {
    font-size: 20px;
    font-weight: 600;
}

.user-info {
    margin-right: 15px;
    font-size: 14px;
    opacity: 0.9;
}

.topbar .btn-sm {
    background: #fff;
    color: #0b5ed7;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
}

.topbar .btn-sm:hover {
    background: #e7e7e7;
}

/* Hide desktop nav entirely (mobile will use dropdown panel) */
.navbar { display:none !important; }

/* Mobile Menu Panel */
.mobile-nav-panel {
    display: none;
    flex-direction: column;
    background: #0b5ed7;
    padding: 12px 0;
}

.mobile-nav-panel.open {
    display: flex;
}

.mobile-nav-link {
    padding: 12px 20px;
    color: white;
    font-size: 16px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

.mobile-nav-link:hover {
    background: rgba(255,255,255,0.15);
}

.mobile-nav-link.active {
    background: rgba(255,255,255,0.25);
    font-weight: 600;
}

/* Hide toggle button on large screens */
@media (min-width: 781px) {
    .menu-toggle { display:none; }
    .mobile-nav-panel { display:none !important; }
}

/* -------------------------
   Buttons
------------------------- */
button,
.btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: 0.2s ease;
}

.btn-primary {
    background: #0b5ed7;
    color: white;
}

.btn-primary:hover {
    background: #0849a8;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 12px;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* -------------------------
   Cards & Panels
------------------------- */
.card,
.panel {
    background: white;
    border-radius: 10px;
    padding: 18px;
    margin-bottom: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.card h2,
.panel-header h3 {
    margin-bottom: 10px;
}

.big-number {
    font-size: 32px;
    font-weight: 700;
    color: #0b5ed7;
}

/* -------------------------
   Dashboard Grid
------------------------- */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

/* -------------------------
   Tables
------------------------- */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table thead {
    background: #eef2f7;
}

.table th {
    text-align: left;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #444;
}

.table td {
    padding: 10px;
    border-top: 1px solid #e6e6e6;
    font-size: 14px;
}

.table tr:hover td {
    background: #f3f7fc;
}

/* -------------------------
   Forms
------------------------- */
form label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
}

form input,
form select,
form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccd3dd;
    border-radius: 6px;
    font-size: 15px;
    background: #fff;
    transition: 0.15s ease;
}

form input:focus,
form select:focus,
form textarea:focus {
    border-color: #0b5ed7;
    outline: none;
    box-shadow: 0 0 0 2px rgba(11, 94, 215, 0.15);
}

textarea {
    min-height: 90px;
    resize: vertical;
}

/* -------------------------
   Alerts (Flash Messages)
------------------------- */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 600;
}

.alert-success {
    background: #d1e7dd;
    color: #0f5132;
}

.alert-error {
    background: #f8d7da;
    color: #842029;
}

/* -------------------------
   Footer
------------------------- */
.footer {
    text-align: center;
    padding: 20px;
    font-size: 14px;
    opacity: 0.6;
}

/* -------------------------
   Login Page
------------------------- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: #eef2f7;
}

.login-container {
    width: 100%;
    max-width: 380px;
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 20px;
}

/* -------------------------
   Utility Classes
------------------------- */
.text-center {
    text-align: center;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* ==========================================================
   Global Table Improvements (Leads / Quotes / Orders)
   ========================================================== */

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    margin-top: 20px;
}

.data-table thead th {
    text-align: left;
    padding: 14px 18px;
    background: #f3f4f6;
    border-bottom: 2px solid #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
}

.data-table tbody tr {
    background: white;
    border-radius: 8px;
    box-shadow: 0px 2px 4px rgba(0,0,0,0.08);
}

.data-table tbody td {
    padding: 16px 18px;
    font-size: 14px;
    color: #1f2937;
    vertical-align: middle;
}

/* Right-align numeric or date columns */
.data-table td.numeric,
.data-table td.right {
    text-align: right;
}

/* First column slightly bolder */
.data-table tbody td:first-child {
    font-weight: 600;
}

/* Action buttons inside table */
.data-table .btn-small {
    padding: 5px 10px;
    font-size: 13px;
    border-radius: 5px;
}

/* Add hover effect */
.data-table tbody tr:hover {
    transform: scale(1.01);
    transition: 0.12s ease-in-out;
    box-shadow: 0px 3px 6px rgba(0,0,0,0.12);
}

/* Badge styling */
.badge {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.badge-blue     { background-color: #3b82f6; }
.badge-purple   { background-color: #8b5cf6; }
.badge-orange   { background-color: #f97316; }
.badge-green    { background-color: #16a34a; }
.badge-red      { background-color: #dc2626; }
.badge-gray     { background-color: #6b7280; }

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}

.pagination {
    display: flex;
    gap: 6px;
    margin-top: 20px;
    justify-content: center;
}

.page-btn {
    padding: 6px 12px;
    background: #eee;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    border: 1px solid #ccc;
}

.page-btn:hover {
    background: #ddd;
}

.page-btn.active {
    background: #007bff;
    color: #fff;
    border-color: #0056b3;
}

.needs-attention-warning {
    border-left: 5px solid #dc2626 !important;
}

.badge-red {
    background-color: #dc2626 !important;
}

.badge-yellow {
    background-color: #f59e0b !important;
}
.tab-count {
    display: inline-block;
    background: #007BFF;      /* Blue */
    color: #fff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 6px;
    font-weight: 700;
}

/* Row Highlight Animation for Updated Leads */
.highlight-row {
    animation: rowFlash 2s ease-out;
}

@keyframes rowFlash {
    0%   { background-color: #fff3cd; }       /* light yellow */
    50%  { background-color: #ffe69c; }
    100% { background-color: transparent; }
}

/* ============================
   LEADS VIEW PAGE GRID LAYOUT
   ============================ */

/* 3 equal-width cards in a row */
.lead-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* 2 equal-width cards in a row */
.lead-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* Mobile responsiveness */
@media (max-width: 900px) {
    .lead-grid-3,
    .lead-grid-2 {
        grid-template-columns: 1fr;
    }
}
.vehicle-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}
.vehicle-card.stacked {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.vehicle-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vehicle-card .field-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vehicle-card .field-row span {
    width: 110px;
    font-weight: 600;
}

.vehicle-card .field-row input,
.vehicle-card .field-row select {
    flex: 1;
}

/* ------------------------------------------------------
   Global Dropdown Buttons
------------------------------------------------------ */

.btn-group {
    position: relative;
    display: inline-block;
}

.btn-group > button {
    cursor: pointer;
}

/* Hidden by default */
.btn-group .btn-dropdown {
    display: none;
    position: absolute;
    background: #fff;
    min-width: 180px;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 6px 0;
    z-index: 3000;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
}

/* Dropdown links */
.btn-group .btn-dropdown a {
    display: block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.btn-group .btn-dropdown a:hover {
    background: #f0f0f0;
}

/* Shown when active */
.btn-group.active .btn-dropdown {
    display: block;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    color:white;
}
.status-new        { background:#007bff; }
.status-dispatched { background:#6f42c1; }
.status-in_transit { background:#17a2b8; }
.status-delivered  { background:#28a745; }
.status-cancelled  { background:#dc3545; }
.status-hold       { background:#f1c40f; color:#000; }
.status-archived   { background:#343a40; }
.status-issue      { background:#e67e22; }

.card h3 {
    margin-top:0;
    font-size:21px;
    font-weight:600;
}

/* ==== DROPDOWN BUTTONS (local override) ==== */
.btn-group {
    position: relative;
    display: inline-block;
}

.btn-group > button {
    cursor: pointer;
}

/* Hidden by default */
.btn-group .btn-dropdown {
    display: none !important;
    position: absolute;
    background: #fff;
    min-width: 180px;
    border: 1px solid #ccc;
    border-radius: 6px;
    padding: 6px 0;
    z-index: 3000;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
}

/* Dropdown links */
.btn-group .btn-dropdown a {
    display: block;
    padding: 8px 12px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}

.btn-group .btn-dropdown a:hover {
    background: #f0f0f0;
}

/* Shown when active */
.btn-group.active .btn-dropdown {
    display: block !important;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.admin-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: 0.2s ease;
    border: 1px solid #e6e6e6;
}

.admin-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.admin-card.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.admin-card-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
}

.admin-card-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

.order-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 900px) {
    .order-grid-2 {
        grid-template-columns: 1fr;
    }
}

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.vehicle-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    background: #fafafa;
}
.relo-results-box {
    border:1px solid #ccc;
    border-radius:6px;
    background:white;
    max-height:180px;
    overflow-y:auto;
    padding:5px;
    display:block;
}

.relo-result {
    padding:6px 8px;
    cursor:pointer;
    border-bottom:1px solid #eee;
}

.relo-result:hover {
    background:#f5f5f5;
}
/* ============================
   QUOTES/EDIT PAGE GRID LAYOUT
   ============================ */

/* Row 1: 2 columns (Customer Info left, Relo Company right) */
.detail-grid-2col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Row 2: 3 columns (Vehicles, Dates, Payments/Status) */
.detail-grid-3col {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Stack cards on mobile */
@media (max-width: 900px) {
    .detail-grid-2col,
    .detail-grid-3col {
        grid-template-columns: 1fr !important;
    }
}
/* ============================
   QUOTES/EDIT PAGE GRID — TOP ROW
   3 columns: Customer (2fr), Relo (1fr), Pay/Status (1fr)
   ============================ */

.detail-grid-3col-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .detail-grid-3col-top {
        grid-template-columns: 1fr;
    }
}
.relo-results-box {
    background:#fff;
    border:1px solid #ccc;
    border-radius:6px;
    max-height:200px;
    overflow-y:auto;
    margin-top:4px;
    display:none;
    position:absolute;
    z-index:9999;
    width:100%;
}

.relo-result-item {
    padding:6px 10px;
    cursor:pointer;
}

.relo-result-item:hover {
    background:#f0f0f0;
}
.debug-box {
    background:#111;
    color:#0f0;
    border:1px solid #333;
    padding:12px;
    margin:10px 0;
    border-radius:6px;
    white-space:pre-wrap;
    font-size:13px;
}
details summary {
    cursor:pointer;
    font-weight:bold;
    margin-top:12px;
}