/* ProShopDoctor - Main Stylesheet */

:root {
    --psd-primary: #2563eb;
    --psd-primary-dark: #1d4ed8;
    --psd-secondary: #475569;
    --psd-success: #16a34a;
    --psd-danger: #dc2626;
    --psd-warning: #d97706;
    --psd-dark: #1e293b;
    --psd-light: #f8fafc;
    --psd-border: #e2e8f0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--psd-light);
    color: #334155;
}

/* Navbar */
.navbar-dark.bg-dark {
    background-color: var(--psd-dark) !important;
}
.navbar-brand i {
    color: var(--psd-primary);
}

/* Cards */
.card {
    border: 1px solid var(--psd-border);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.card-header {
    background-color: #fff;
    border-bottom: 1px solid var(--psd-border);
    font-weight: 600;
}

/* Stat Cards */
.stat-card {
    border-left: 4px solid var(--psd-primary);
    transition: transform 0.15s;
}
.stat-card:hover {
    transform: translateY(-2px);
}
.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--psd-dark);
}
.stat-card .stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--psd-secondary);
}
.stat-card.success { border-left-color: var(--psd-success); }
.stat-card.danger { border-left-color: var(--psd-danger); }
.stat-card.warning { border-left-color: var(--psd-warning); }

/* Tables */
.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--psd-secondary);
    border-bottom-width: 2px;
}
.table-hover tbody tr:hover {
    background-color: #f1f5f9;
    cursor: pointer;
}

/* Action Buttons */
.btn-group-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}
.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--psd-dark);
    margin: 0;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
}

/* Badges */
.badge-status {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    font-weight: 500;
}

/* Search box */
.search-box {
    position: relative;
}
.search-box .bi-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}
.search-box input {
    padding-left: 2.2rem;
}

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--psd-dark) 0%, #334155 100%);
}
.login-card {
    background: #fff;
    border-radius: 1rem;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-card .brand {
    text-align: center;
    margin-bottom: 2rem;
}
.login-card .brand i {
    font-size: 2.5rem;
    color: var(--psd-primary);
}
.login-card .brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--psd-dark);
    margin-top: 0.5rem;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}
.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}
.empty-state h5 {
    color: var(--psd-secondary);
}

/* Quick tiles for POS items */
.quick-tile {
    width: 120px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--psd-border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s;
    background: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    padding: 0.5rem;
}
.quick-tile:hover {
    border-color: var(--psd-primary);
    background: #eff6ff;
    transform: translateY(-2px);
}
.quick-tile i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    color: var(--psd-primary);
}

/* Spec sheet fields */
.spec-group {
    background: #f8fafc;
    border: 1px solid var(--psd-border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}
.spec-group h6 {
    color: var(--psd-primary);
    font-weight: 600;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--psd-primary);
}

/* Ball catalog comparison */
.compare-table td, .compare-table th {
    vertical-align: middle;
}
.compare-table .ball-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
}

/* Customer tags */
.customer-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2em 0.6em;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
    margin: 0.1rem;
}

/* =============================================================================
   Modal polish — shared styling so every Bootstrap modal feels professional and
   consistent. Individual modals can still override with inline styles or their
   own scoped rules; these are just the defaults.
   ============================================================================= */
.modal-content {
    border: 0;
    border-radius: 0.75rem;
    box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.25), 0 8px 16px -6px rgba(15, 23, 42, 0.1);
    overflow: hidden;
}
.modal-header {
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
}
.modal-title {
    font-weight: 700;
    color: #0f172a;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}
.modal-title .bi {
    color: #2563eb;
}
.modal-header .btn-close {
    opacity: 0.6;
    transition: opacity 0.12s;
}
.modal-header .btn-close:hover { opacity: 1; }
.modal-body {
    padding: 1.25rem;
    color: #1e293b;
}
.modal-body .form-label {
    font-weight: 600;
    color: #475569;
    font-size: 0.825rem;
    margin-bottom: 0.3rem;
}
.modal-body .form-label.small {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}
.modal-body .form-control,
.modal-body .form-select {
    border-color: #e2e8f0;
    transition: border-color 0.12s, box-shadow 0.12s;
}
.modal-body .form-control:focus,
.modal-body .form-select:focus {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.modal-body .input-group-text {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
    font-weight: 600;
}
.modal-body hr {
    border-color: #e2e8f0;
    opacity: 1;
    margin: 1rem 0;
}
.modal-body .form-check-label {
    color: #1e293b;
}
.modal-body .alert {
    border: 0;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
}
.modal-body .alert-info {
    background: #eff6ff;
    color: #1e40af;
}
.modal-body .alert-warning {
    background: #fffbeb;
    color: #92400e;
}
.modal-body .alert-danger {
    background: #fef2f2;
    color: #991b1b;
}
.modal-body .alert-success {
    background: #f0fdf4;
    color: #166534;
}
.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 0.85rem 1.25rem;
    background: #f8fafc;
}
.modal-footer .btn {
    font-weight: 600;
    padding: 0.45rem 1.1rem;
    border-radius: 0.4rem;
}
/* Danger action differentiation */
.modal-footer .btn-danger {
    background: #dc2626;
    border-color: #dc2626;
}
.modal-footer .btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}
/* List-group inside a modal (pickers, etc.) */
.modal .list-group-item {
    border-color: #e2e8f0;
    padding: 0.65rem 0.9rem;
}
.modal .list-group-item + .list-group-item { border-top-width: 1px; }
.modal .list-group-item-action:hover { background: #f8fafc; }
/* Subtle scrollbar inside scrollable modal bodies */
.modal-body::-webkit-scrollbar,
.modal .list-group::-webkit-scrollbar { width: 8px; }
.modal-body::-webkit-scrollbar-thumb,
.modal .list-group::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.modal-body::-webkit-scrollbar-thumb:hover,
.modal .list-group::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
/* Tables inside modals (e.g. bundle editor) */
.modal .table {
    font-size: 0.875rem;
}
.modal .table thead th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #e2e8f0;
}
/* Section headings within a modal body */
.modal-body h6 {
    color: #0f172a;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    margin-top: 0.25rem;
    margin-bottom: 0.6rem;
}

/* Print styles */
@media print {
    .navbar, .btn, .pagination, .no-print { display: none !important; }
    .card { border: none !important; box-shadow: none !important; }
    body { background: #fff; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .page-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
    .stat-card .stat-value { font-size: 1.25rem; }
    .quick-tile { width: 100px; height: 85px; }
}

/* Navbar responsive compacting
   - <1200px: Bootstrap collapses the navbar into the hamburger menu (navbar-expand-xl).
   - 1200-1399px: show icon-only nav to prevent cramping on typical laptops.
   - >=1400px: full-size labels.
   When collapsed (hamburger open), always show full labels regardless of width. */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .navbar.navbar-expand-xl .navbar-nav .nav-link {
        padding-left: 0.6rem;
        padding-right: 0.6rem;
    }
    .navbar.navbar-expand-xl .navbar-nav .nav-link .nav-label {
        display: none;
    }
    .navbar.navbar-expand-xl .navbar-nav .nav-link i {
        font-size: 1.15rem;
        margin-right: 0 !important;
    }
    /* Keep the dropdown caret but pull it tight to the icon */
    .navbar.navbar-expand-xl .navbar-nav .nav-link.dropdown-toggle::after {
        margin-left: 0.15rem;
    }
    .navbar.navbar-expand-xl .navbar-brand-text {
        display: none;
    }
}

/* ----------------------------------------------------------------------
   Report stat strip
   ----------------------------------------------------------------------
   Replaces the hero "stat tiles" layout (8x col cards with fs-2 numbers)
   with a single horizontal ribbon of compact label/value pairs. Used on
   every page under /reports/ — pattern is:

     <div class="report-stat-bar">
       <div class="report-stat">
         <div class="report-stat-label">Total Sales</div>
         <div class="report-stat-value text-success">$12,345.67</div>
         <div class="report-stat-delta text-success">↑ 12.3%</div> <!-- optional -->
       </div>
       ... more stats ...
     </div>

   On mobile it wraps; on desktop it spreads evenly. No card chrome.
   ---------------------------------------------------------------------- */
.report-stat-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    padding: .25rem 0;
    margin-bottom: 1rem;
    overflow: hidden;
}
.report-stat {
    flex: 1 1 auto;
    min-width: 110px;
    padding: .5rem .9rem;
    border-right: 1px solid #f1f1f4;
    line-height: 1.2;
}
.report-stat:last-child { border-right: none; }
.report-stat-label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: .1rem;
}
.report-stat-value {
    font-size: 1.05rem;
    font-weight: 600;
    color: #111827;
}
.report-stat-delta {
    font-size: .7rem;
    margin-top: .05rem;
    line-height: 1;
}
.report-stat-delta i { font-size: .75rem; }

@media (max-width: 575px) {
    .report-stat { min-width: 50%; border-bottom: 1px solid #f1f1f4; }
    .report-stat:nth-last-child(-n+2) { border-bottom: none; }
}

/* Reports tend to need denser tables/cards — apply on the page <main> via
   adding "report-compact" class. Currently tables already use table-sm; this
   block reduces card header/body padding so sections sit closer together. */
.report-compact .card { margin-bottom: .75rem; }
.report-compact .card-header { padding: .5rem .85rem; font-size: .9rem; }
.report-compact .card-body { padding: .85rem; }
.report-compact .card-body.p-0 { padding: 0 !important; }
.report-compact .table-sm > :not(caption) > * > * { padding: .35rem .5rem; }
.report-compact h1 { font-size: 1.5rem; }
.report-compact .page-header { margin-bottom: 1rem; }
