/* ===== Additions for the Laravel Blade version (base styles are in app.css) ===== */
.page-title { font-size: 1.6rem; font-weight: 700; color: #1e293b; }
.page-subtitle { font-size: 0.85rem; color: var(--text-muted); }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.icon-btn { padding: 6px; border-radius: 4px; }
.round-btn { padding: 8px; border-radius: 50%; display: inline-flex; align-items: center; }
.text-uppercase { text-transform: uppercase; }
.muted { color: var(--text-muted); }
.small { font-size: 0.75rem; }
.hidden { display: none !important; }
code.plate { background-color: #f1f5f9; padding: 2px 6px; border-radius: 4px; }
.btn svg, .nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.icon-btn svg { width: 14px; height: 14px; }
.badge-paid { background-color: var(--success-light); color: var(--success); }
.badge-partial { background-color: var(--warning-light); color: var(--warning); }
.badge-unpaid { background-color: var(--error-light); color: var(--error); }
.inline-form { display: inline; }

/* Login */
.login-wrap { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 24px; background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%); }
.login-card { max-width: 420px; width: 100%; padding: 40px 32px; border-radius: 16px; box-shadow: 0 10px 25px rgba(25,118,210,0.15); }
.login-logo { width: 64px; height: 64px; border-radius: 16px; background-color: var(--primary); display: flex; align-items: center; justify-content: center; margin: 0 auto; box-shadow: 0 4px 12px rgba(25,118,210,0.3); color: #fff; }
.login-logo svg { width: 36px; height: 36px; }
.input-icon-wrap { position: relative; }
.input-icon-wrap > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 16px; height: 16px; }
.input-icon-wrap .form-control { padding-left: 38px; width: 100%; }
.eye-btn { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); display: flex; }
.eye-btn svg { width: 16px; height: 16px; }
.link-btn { background: none; border: none; font-size: 0.8rem; color: var(--primary); cursor: pointer; font-weight: 500; }

/* Dashboard */
.metric-card { display: flex; align-items: center; gap: 20px; padding: 24px; margin-bottom: 0; }
.metric-icon { width: 56px; height: 56px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.metric-icon svg { width: 24px; height: 24px; }
.metric-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.metric-value { font-size: 1.75rem; font-weight: 700; color: #1e293b; line-height: 1; }
.empty-state svg { width: 48px; height: 48px; }

/* Lists / tables */
.filter-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; display: block; }
.table th a.sort-link { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.table th a.sort-link svg { width: 12px; height: 12px; }
.pagination-footer { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; border-top: 1px solid var(--border); background-color: #f8fafc; flex-wrap: wrap; gap: 12px; }
.btn.disabled { opacity: 0.6; pointer-events: none; }

/* Modal */
.modal-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.modal-close { background: none; border: none; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }

/* Wizard form */
.section-title { font-size: 1.15rem; font-weight: 700; color: #1e293b; margin-bottom: 24px; border-bottom: 2px solid var(--primary-light); padding-bottom: 8px; }
.inner-section-header { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 700; color: var(--primary); text-transform: uppercase; margin-bottom: 16px; border-bottom: 1px dashed var(--border); padding-bottom: 6px; }
.inner-section-header svg { width: 16px; height: 16px; }
.section-subtitle { font-size: 0.95rem; font-weight: 600; color: #1e293b; margin-bottom: 16px; text-transform: uppercase; }
.auto-badge { font-size: 0.65rem; background-color: var(--info-light); color: var(--info); padding: 2px 6px; border-radius: 4px; margin-left: 6px; }
.form-footer { display: flex; align-items: center; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); }
.form-control[readonly] { background-color: #f8fafc; font-weight: bold; }
.step-node svg { width: 14px; height: 14px; }
.docs-box { background-color: #f8fafc; padding: 24px; border-radius: 8px; border: 1px solid var(--border); }
.upload-slot { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background-color: #ffffff; border: 1px solid var(--border); border-radius: 6px; gap: 12px; }
.upload-slot.empty { background-color: #f8fafc; }
.slot-title { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; }
.slot-placeholder { font-size: 0.75rem; color: var(--text-muted); display: block; margin-top: 2px; font-style: italic; }
.slot-file { display: flex; align-items: center; gap: 6px; margin-top: 4px; min-width: 0; }
.slot-file span { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.slot-file svg { width: 14px; height: 14px; color: var(--primary); flex-shrink: 0; }
.slot-file .remove-file { background: none; border: none; cursor: pointer; color: var(--error); display: flex; padding: 2px; }
.slot-actions { display: flex; gap: 6px; }
.choose-btn { padding: 6px 12px; font-size: 0.8rem; font-weight: 600; }
.choose-btn svg { width: 14px; height: 14px; }
/* Document slots (create + edit) */
.docs-box-title { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.docs-box-title svg { width: 16px; height: 16px; }
.slot-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.slot-current { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.slot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; font-size: 0.75rem; }
.slot-links a { color: var(--primary); font-weight: 600; text-decoration: none; }
.slot-links a:hover { text-decoration: underline; }
.slot-remove { display: inline-flex; align-items: center; gap: 4px; color: var(--error); font-weight: 600; cursor: pointer; }
.upload-slot.slot-removing .slot-file span { text-decoration: line-through; color: var(--text-muted); }
.upload-slot .slot-file span { max-width: 100%; }
.upload-slot .choose-btn { flex-shrink: 0; align-self: center; }

.req { color: var(--error); }

/* Part-payments (form + detail page) */
.pay-rows-title { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-main); margin: 8px 0 10px; }
.pay-rows { display: flex; flex-direction: column; gap: 8px; }
.pay-row { display: grid; grid-template-columns: 150px 150px 1fr 1fr 34px; gap: 8px; align-items: center; }
.pay-row .form-control { width: 100%; min-width: 0; }
.pay-head span { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.pay-remove svg { color: var(--error); }
.pay-summary { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-top: 16px; padding: 14px 16px; background-color: #f8fafc; border: 1px solid var(--border); border-radius: 8px; }
.pay-summary > div { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; }
.pay-summary b { font-size: 1.05rem; color: var(--text-main); }
.pay-summary .badge { align-self: flex-start; }
.pay-history-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin: 18px 0 8px; }
.pay-table { font-size: 0.8rem; }
.pay-table th, .pay-table td { padding: 8px 10px; vertical-align: top; }
.pay-table th { white-space: nowrap; }
.add-payment { margin-top: 18px; padding: 14px; border: 1px dashed var(--border); border-radius: 8px; background-color: #f8fafc; }
.add-payment .form-group { margin-bottom: 0; }
.add-payment label { font-size: 0.75rem; }
/* Transfers / Hold Released blocks in the form */
.pay-block { margin-top: 18px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; }
.pay-block-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.pay-left { font-size: 0.8rem; font-weight: 600; color: var(--primary); white-space: nowrap; }

/* Payments page */
.pay-stats { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.pay-stat { flex: 1 1 200px; padding: 16px 20px; margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; }
.pay-stat b { font-size: 1.4rem; color: var(--text-main); }

/* Saved bank accounts (Net Banking) */
.pay-bank { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; margin-bottom: 4px; background-color: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pay-bank.hidden { display: none; }
.pay-bank-label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.bank-pick { display: flex; flex-direction: column; gap: 6px; width: 100%; min-width: 0; }
.bank-pick select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.bank-pick-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.bank-pick-detail { min-width: 0; flex: 1; }
.bank-pick-actions { display: flex; gap: 14px; flex-shrink: 0; }
.link-btn.link-danger { color: var(--error); }
.bank-pick .link-btn { display: inline-flex; align-items: center; gap: 4px; padding: 2px 0; white-space: nowrap; flex-shrink: 0; }
.bank-pick .link-btn svg { width: 14px; height: 14px; }
.bank-info { min-width: 0; line-height: 1.35; }
.bank-info-main { font-size: 0.78rem; font-weight: 600; color: var(--text-main); overflow-wrap: anywhere; }
.bank-info-sub { font-size: 0.72rem; color: var(--text-muted); overflow-wrap: anywhere; }
.data-item .bank-info { text-align: right; }
.pay-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.pay-entry { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; }
.pay-entry + .pay-entry { border-top: 1px solid var(--border); }
.pay-entry-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pay-entry-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 0.8rem; min-width: 0; }
.pay-entry-amount { font-size: 0.95rem; font-weight: 700; color: var(--text-main); }
.pay-entry .bank-info { padding: 6px 10px; background-color: #f8fafc; border-radius: 6px; }
.hold-done { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 12px 14px; border-radius: 8px; background-color: #edf7ed; color: var(--success); font-size: 0.85rem; font-weight: 600; }
.hold-done svg { width: 16px; height: 16px; }
.span-2 { grid-column: 1 / -1; }
.bank-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; margin-top: 10px; cursor: pointer; }

/* Fuel Type: tick boxes that look like buttons; more than one can be ticked (Petrol + CNG + Electric). */
.fuel-options { display: flex; flex-wrap: wrap; gap: 6px; }
.form-group .fuel-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 9px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background-color: #ffffff; color: var(--text-main); font-size: 0.9rem; font-weight: 500; cursor: pointer; user-select: none; transition: var(--transition); }
.form-group .fuel-chip:hover { border-color: var(--primary); }
.form-group .fuel-chip:has(input:checked) { border-color: var(--primary); background-color: var(--primary-light); color: var(--primary); }
.form-group .fuel-chip:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--primary-light); }
.fuel-chip input { width: 16px; height: 16px; margin: 0; cursor: pointer; accent-color: var(--primary); }

/* A field with a problem (markInvalid in app.js): red until something is typed in it, with the message under it. */
.form-control.is-invalid, .form-control.is-invalid:focus { border-color: var(--error); background-color: #fff5f5; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px var(--error-light); }
.field-error { color: var(--error); font-size: 0.8rem; font-weight: 500; margin-top: 5px; }

/* Users page */
.badge-inactive { background-color: var(--error-light); color: var(--error); }
.btn.btn-sm { padding: 6px 10px; font-size: 0.8rem; gap: 6px; }
.btn.btn-sm svg { width: 14px; height: 14px; }
.inline-form + .btn-sm, .btn-sm + .inline-form { margin-left: 6px; }
@media (max-width: 700px) {
  .pay-row { grid-template-columns: 1fr 1fr; }
  .pay-head { display: none; }
  .pay-remove { justify-self: end; }
}

/* Detail page */
.card-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 10px; }
.card-header svg { width: 18px; height: 18px; color: var(--primary); }
.card-header h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.data-list { display: flex; flex-direction: column; }
.data-item { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f1f5f9; align-items: center; font-size: 0.85rem; gap: 12px; }
.data-item:last-child { border-bottom: none; }
.data-item .label { color: var(--text-muted); font-weight: 500; }
.data-item .val { font-weight: 600; color: var(--text-main); text-align: right; max-width: 65%; }
.data-item.highlight { background-color: #f1f5f9; padding: 10px; }
.data-item.payout { background-color: var(--success-light); padding: 12px 10px; border-radius: 4px; }
.data-item.payout .label, .data-item.payout .val { color: var(--success); font-weight: 800; }
.notes-title { font-size: 0.9rem; font-weight: 700; color: #1e293b; text-transform: uppercase; margin-bottom: 12px; border-bottom: 1px dashed var(--border); padding-bottom: 6px; }
.notes-block { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; white-space: pre-line; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack > .card { margin: 0; }
.preview-modal { max-width: 85%; width: 900px; height: 80%; }
.preview-body { overflow: hidden; padding: 16px 0; height: calc(100% - 50px); }
.preview-body iframe { width: 100%; height: 100%; border: none; }
.preview-body .img-wrap { display: flex; justify-content: center; align-items: center; height: 100%; background-color: #f1f5f9; border-radius: 8px; overflow: auto; }
.preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; }

.print-only { display: none; }
@media print {
  .app-sidebar, .top-header, .no-print, .toast-container, .sidebar-overlay { display: none !important; }
  .print-only { display: block; text-align: center; margin-bottom: 24px; }
  .layout-container, .main-panel, .content-outlet { height: auto; overflow: visible; display: block; width: auto; padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; break-inside: avoid; }
}

/* Plan banner (payment due / expired): no close button, stays until the plan is renewed. */
.plan-banner { position: sticky; top: 0; z-index: 30; flex-shrink: 0; display: flex; align-items: center; gap: 10px; padding: 12px 24px; font-weight: 600; font-size: 0.92rem; border-bottom: 1px solid transparent; }
.plan-banner svg { width: 20px; height: 20px; flex-shrink: 0; }
.plan-banner-due { background: var(--warning-light); color: #8a3c00; border-color: var(--warning); }
.plan-banner-expired { background: var(--error); color: #fff; border-color: var(--error); }
.plan-form .btn-sm { margin-left: 6px; vertical-align: middle; }
