/* ===== Base Styles ===== */
body {
    background-color: #f8f9fa;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ===== Invoice / Quote Preview Box ===== */
.invoice-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* ===== Table Wrapper (for horizontal scroll on small screens) ===== */
.table-responsive-custom {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ===== Authentication Cards (Login, Register, Forgot, Reset) ===== */
.auth-card {
    max-width: 400px;
    margin: 50px auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 10px;
}

.auth-card .card-body {
    padding: 2rem;
}

.auth-card h3 {
    font-weight: 600;
    color: #333;
}

.auth-card .form-control {
    border-radius: 8px;
    padding: 10px 15px;
}

.auth-card .btn-primary {
    border-radius: 8px;
    padding: 10px;
    font-weight: 600;
}

.auth-card a {
    text-decoration: none;
}

.auth-card a:hover {
    text-decoration: underline;
}

/* ===== Typeahead / Datalist Styling ===== */
datalist {
    max-height: 200px;
    overflow-y: auto;
}

input[list]::-webkit-calendar-picker-indicator {
    opacity: 0.6;
    cursor: pointer;
}

input[list]:hover::-webkit-calendar-picker-indicator {
    opacity: 1;
}

/* ===== Mobile Adjustments ===== */
@media (max-width: 576px) {
    .invoice-box {
        padding: 12px;
    }

    .invoice-box h5 {
        font-size: 1rem;
    }

    .invoice-box h6 {
        font-size: 0.9rem;
    }

    .invoice-box p {
        font-size: 0.85rem;
        margin-bottom: 3px;
    }

    .table th,
    .table td {
        font-size: 0.8rem;
        padding: 4px 6px;
    }

    .btn {
        font-size: 0.8rem;
        padding: 6px 10px;
    }

    .d-flex.flex-wrap {
        gap: 6px;
    }

    .text-end {
        text-align: left !important;
    }

    .row .col-6 {
        width: 100%;
        margin-bottom: 10px;
    }

    .row .col-6.text-end {
        text-align: left !important;
    }

    .navbar-brand {
        font-size: 1rem;
    }

    .auth-card {
        margin: 20px 15px;
    }

    .auth-card .card-body {
        padding: 1.5rem;
    }

    /* Mobile: Make datalist suggestions more touch-friendly */
    input[list] {
        font-size: 16px; /* Prevents iOS zoom */
    }

    /* Mobile: Button groups stack nicely */
    .btn-group {
        display: flex;
        flex-wrap: wrap;
        gap: 5px;
    }

    .btn-group .btn {
        flex: 1 1 auto;
    }
}

/* ===== Tablet Adjustments ===== */
@media (min-width: 577px) and (max-width: 768px) {
    .invoice-box {
        padding: 16px;
    }

    .table th,
    .table td {
        font-size: 0.9rem;
        padding: 6px 8px;
    }

    .auth-card {
        margin: 40px auto;
    }
}

/* ===== Desktop Adjustments (optional tweaks) ===== */
@media (min-width: 769px) {
    .invoice-box {
        padding: 25px;
    }

    .table th,
    .table td {
        padding: 8px 12px;
    }
}

/* ===== Utility Tweaks ===== */
.text-muted a {
    color: #6c757d;
}

.text-muted a:hover {
    color: #343a40;
}

.btn-group .dropdown-menu {
    min-width: 200px;
}

/* ===== Small helper for required fields ===== */
.text-danger {
    color: #dc3545 !important;
}

/* ===== Print-Friendly Styles ===== */
@media print {
    .navbar,
    .btn,
    .btn-group,
    .no-print {
        display: none !important;
    }

    .invoice-box {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    body {
        background: white !important;
    }

    .container {
        max-width: 100% !important;
        padding: 0 !important;
    }
}

/* ===== Loading / Spinner (optional for AJAX) ===== */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

/* ===== Card Hover Effects (optional) ===== */
.card-hover:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transition: box-shadow 0.3s ease-in-out;
}

/* ===== Custom Scrollbar (optional) ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}