/* ============================================================
   YavuzBank – Global Styles
   ============================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg:          #0f1117;
    --bg-card:     #1a1d27;
    --bg-card-2:   #20243a;
    --border:      #2a2d3e;
    --text:        #e2e8f0;
    --text-muted:  #8892a4;
    --primary:     #6366f1;
    --primary-h:   #4f52d6;
    --success:     #22c55e;
    --warning:     #f59e0b;
    --danger:      #ef4444;
    --paid-color:  #22c55e;
    --unpaid-color:#334155;
    --radius:      10px;
    --shadow:      0 4px 24px rgba(0,0,0,.45);
}

html { font-size: 16px; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ---- Links ---- */
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.2rem;
    border: none;
    border-radius: var(--radius);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .1s, opacity .15s;
    white-space: nowrap;
    text-decoration: none;
}
.btn:active { transform: scale(.97); }

.btn-primary  { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); text-decoration: none; }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-card-2); color: var(--text); text-decoration: none; }

.btn-approve {
    background: var(--success);
    color: #fff;
    width: 100%;
    justify-content: center;
    margin-top: .75rem;
}
.btn-approve:hover { background: #16a34a; }

.btn-sm { padding: .35rem .85rem; font-size: .8rem; }
.btn-full { width: 100%; justify-content: center; }

/* ============================================================
   Navbar
   ============================================================ */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 2rem;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(8px);
}

.navbar-brand {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -.5px;
    color: var(--text);
}

.neon-slogan {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: .05em;
    margin: 1.5rem 0 2rem;
    animation: neon-rgb 3s linear infinite;
}

@keyframes neon-rgb {
    0%   { color: #ff3cac; text-shadow: 0 0 8px #ff3cac, 0 0 20px #ff3cac, 0 0 40px #ff3cac; }
    17%  { color: #ff6a00; text-shadow: 0 0 8px #ff6a00, 0 0 20px #ff6a00, 0 0 40px #ff6a00; }
    33%  { color: #ffe600; text-shadow: 0 0 8px #ffe600, 0 0 20px #ffe600, 0 0 40px #ffe600; }
    50%  { color: #00ff87; text-shadow: 0 0 8px #00ff87, 0 0 20px #00ff87, 0 0 40px #00ff87; }
    67%  { color: #00cfff; text-shadow: 0 0 8px #00cfff, 0 0 20px #00cfff, 0 0 40px #00cfff; }
    83%  { color: #a855f7; text-shadow: 0 0 8px #a855f7, 0 0 20px #a855f7, 0 0 40px #a855f7; }
    100% { color: #ff3cac; text-shadow: 0 0 8px #ff3cac, 0 0 20px #ff3cac, 0 0 40px #ff3cac; }
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .9rem;
    color: var(--text-muted);
}

.navbar-user strong { color: var(--text); }

/* ============================================================
   Container
   ============================================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.container-narrow {
    max-width: 640px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.page-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.7rem;
    margin-bottom: .3rem;
}

.page-header p {
    color: var(--text-muted);
    font-size: .9rem;
}

/* ============================================================
   Dashboard Grid
   ============================================================ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.float-nav {
    display: none;
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    gap: .5rem;
    z-index: 200;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .35rem .5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,.4);
}

.float-nav-btn {
    display: inline-block;
    padding: .45rem .9rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.float-nav-btn:hover,
.float-nav-btn.active {
    background: var(--primary);
    color: #fff;
}

@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .navbar { padding: .75rem 1rem; }
    .navbar-user span { display: none; }
    .float-nav { display: flex; }
}

/* ============================================================
   Column
   ============================================================ */
.column-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.column-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.column-subtitle {
    font-size: .8rem;
    color: var(--text-muted);
}

.column-totals {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    text-align: right;
    flex-shrink: 0;
}

.column-total-row {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    justify-content: flex-end;
}

.column-total-row span {
    color: var(--text-muted);
}

.column-total-row strong {
    color: var(--text);
    font-variant-numeric: tabular-nums;
    min-width: 90px;
    text-align: right;
}

.column-total-row.remaining strong {
    color: var(--warning);
}

.empty-state {
    color: var(--text-muted);
    font-size: .9rem;
    padding: 1.5rem;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

/* ============================================================
   Debt Card
   ============================================================ */
.debt-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    margin-bottom: 1rem;
    transition: box-shadow .2s;
}

.debt-card:hover {
    box-shadow: var(--shadow);
}

.debt-card.debt-completed {
    opacity: .6;
    border-color: var(--success);
}

.debt-card.debt-pending {
    opacity: .85;
    border-color: var(--warning);
    border-style: dashed;
}

.debt-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .85rem;
}

.debt-card-header > .badge {
    flex-shrink: 0;
    align-self: flex-start;
}

.debt-name-wrap {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.debt-name {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
}

/* ============================================================
   Badges
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .6rem;
    border-radius: 20px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .4px;
    white-space: nowrap;
    flex-shrink: 0;
    width: fit-content;
    align-self: flex-start;
}

.badge-pending {
    background: rgba(245,158,11,.15);
    color: var(--warning);
    border: 1px solid rgba(245,158,11,.3);
}

.badge-progress {
    background: rgba(99,102,241,.15);
    color: var(--primary);
    border: 1px solid rgba(99,102,241,.3);
}

.badge-completed {
    background: rgba(34,197,94,.15);
    color: var(--success);
    border: 1px solid rgba(34,197,94,.3);
    font-weight: 600;
}

.badge-type-pesin {
    background: rgba(6,182,212,.12);
    color: #22d3ee;
    border: 1px solid rgba(6,182,212,.3);
}

.badge-type-taksit {
    background: rgba(168,85,247,.12);
    color: #c084fc;
    border: 1px solid rgba(168,85,247,.3);
}

.badge-type-tekrarli {
    background: rgba(251,146,60,.12);
    color: #fb923c;
    border: 1px solid rgba(251,146,60,.3);
}

/* ============================================================
   Debt Amounts
   ============================================================ */
.debt-amounts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .3rem .75rem;
    margin-bottom: .9rem;
    font-size: .82rem;
}

.amount-row-full {
    grid-column: 1 / -1;
}

.amount-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .25rem .5rem;
    background: var(--bg-card-2);
    border-radius: 6px;
}

.amount-row span {
    color: var(--text-muted);
}

.amount-row strong {
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   Installment Boxes
   ============================================================ */
.installments {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .25rem;
}

.installment-box {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s, background .15s;
    user-select: none;
    position: relative;
}

.installment-box:hover {
    transform: scale(1.12);
    box-shadow: 0 2px 12px rgba(0,0,0,.4);
}

.installment-box.paid {
    background: var(--paid-color);
    color: #fff;
    box-shadow: 0 0 8px rgba(34,197,94,.35);
    cursor: not-allowed;
}

.installment-box.unpaid {
    background: var(--unpaid-color);
    color: var(--text-muted);
    border: 1px solid #475569;
}

.installment-box.loading {
    opacity: .5;
    pointer-events: none;
}

.pesin-pay-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border-radius: 8px;
    padding: .6rem 1rem;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: .5rem;
    background: var(--unpaid-color);
    color: var(--text-muted);
    border: 1px solid #475569;
    transition: background .15s, color .15s, transform .1s;
    box-sizing: border-box;
}

.pesin-pay-btn:hover {
    background: var(--bg-card-2);
    color: var(--text);
    transform: scale(1.01);
}

.pesin-pay-btn span { pointer-events: none; }

.pesin-paid-banner,
.pesin-pending-banner {
    margin-top: .5rem;
    padding: .55rem 1rem;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    text-align: center;
}

.pesin-paid-banner {
    background: rgba(34,197,94,.15);
    color: var(--success);
    border: 1px solid rgba(34,197,94,.3);
}

.pesin-pending-banner {
    background: var(--unpaid-color);
    color: var(--text-muted);
    border: 1px solid #475569;
}

/* ============================================================
   Pending Section
   ============================================================ */
.pending-section {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.pending-title {
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--text-muted);
    margin-bottom: .75rem;
}

/* ============================================================
   Forms
   ============================================================ */
.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: .4rem;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: .65rem .85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: .95rem;
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}

.form-group input::placeholder {
    color: #475569;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}

.form-group select option {
    background: var(--bg-card);
    color: var(--text);
}

.form-group small {
    display: block;
    margin-top: .35rem;
    font-size: .8rem;
    color: var(--text-muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 480px) {
    .form-row { grid-template-columns: 1fr; }
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: .75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
}

.debt-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
}

/* ============================================================
   Alerts / Flash Messages
   ============================================================ */
.alert {
    padding: .9rem 1.1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: .9rem;
    font-weight: 500;
    transition: opacity .6s ease, margin .6s ease, padding .6s ease, max-height .6s ease;
    max-height: 200px;
    overflow: hidden;
}
.alert.fade-out {
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.alert-success {
    background: rgba(34,197,94,.12);
    border: 1px solid rgba(34,197,94,.3);
    color: #4ade80;
}

.alert-error {
    background: rgba(239,68,68,.12);
    border: 1px solid rgba(239,68,68,.3);
    color: #f87171;
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    padding: .85rem 1.25rem;
    border-radius: var(--radius);
    font-size: .88rem;
    font-weight: 600;
    box-shadow: var(--shadow);
    animation: slideIn .2s ease;
}

.toast-success {
    background: var(--success);
    color: #fff;
}

.toast-error {
    background: var(--danger);
    color: #fff;
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ============================================================
   Login Page
   ============================================================ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: calc(var(--radius) * 1.5);
    padding: 2.5rem 2rem;
    box-shadow: var(--shadow);
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: .4rem;
}

.login-logo h1 {
    font-size: 1.6rem;
    letter-spacing: -1px;
    margin-bottom: .2rem;
}

.login-logo p {
    color: var(--text-muted);
    font-size: .85rem;
}

.approve-form {
    margin-top: .25rem;
}

.btn-detail {
    display: block;
    width: 100%;
    margin-top: .5rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-size: .8rem;
    padding: .35rem .85rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.btn-detail:hover {
    background: var(--bg-card-2);
    color: var(--text);
}

.debt-detail {
    margin-top: .5rem;
    border-top: 1px solid var(--border);
    padding-top: .5rem;
}
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .4rem 0;
    border-bottom: 1px solid var(--border);
    font-size: .82rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); }
.detail-paid   { color: var(--success); font-weight: 600; }
.detail-unpaid { color: var(--text-muted); font-style: italic; }

.btn-edit {
    display: inline-flex;
    justify-content: center;
    margin-top: .5rem;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-size: .8rem;
    padding: .35rem .85rem;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.btn-edit:hover {
    background: var(--bg-card-2);
    color: var(--text);
    text-decoration: none;
}

/* ============================================================
   Toggle Group (Peşin/Taksit, Yarı yarıya/Manuel)
   ============================================================ */
.toggle-group {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.toggle-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle-option input[type="radio"] {
    display: none;
}

.toggle-option span {
    display: inline-block;
    padding: .45rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .85rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-card);
    transition: background .15s, color .15s, border-color .15s;
    user-select: none;
}

.toggle-option input[type="radio"]:checked + span {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.toggle-option:hover span {
    border-color: var(--primary);
    color: var(--text);
}

input[readonly] {
    opacity: .6;
    cursor: not-allowed;
}

/* ============================================================
   Reports / Dashboard
   ============================================================ */
.report-toolbar {
    display: flex;
    gap: .5rem;
    margin-bottom: 1.5rem;
}

.report-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    overflow: hidden;
}

.report-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .85rem 1.1rem;
    background: var(--bg-card-2);
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    flex-wrap: wrap;
}

.report-period {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.report-net {
    font-size: .82rem;
    font-weight: 600;
    padding: .25rem .7rem;
    border-radius: 999px;
}
.net-d2u  { background: rgba(239,68,68,.12);  color: #f87171; border: 1px solid rgba(239,68,68,.25); }
.net-u2d  { background: rgba(99,102,241,.12); color: var(--primary); border: 1px solid rgba(99,102,241,.25); }
.net-zero { background: rgba(34,197,94,.12);  color: var(--success); border: 1px solid rgba(34,197,94,.25); }

.report-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.report-col {
    padding: .85rem 1.1rem;
}
.report-col:first-child {
    border-right: 1px solid var(--border);
}

.report-col-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .82rem;
    color: var(--text-muted);
    margin-bottom: .6rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}
.report-col-header strong { color: var(--text); font-size: .9rem; }

.report-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .3rem 0;
    font-size: .8rem;
    border-bottom: 1px solid rgba(255,255,255,.04);
}
.report-item:last-child { border-bottom: none; }
.report-item-name { flex: 1; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.report-item-meta { color: var(--text-muted); white-space: nowrap; }
.report-item-amt  { color: var(--text); font-weight: 600; white-space: nowrap; }

@media (max-width: 768px) {
    .report-columns { grid-template-columns: 1fr; }
    .report-col:first-child { border-right: none; border-bottom: 1px solid var(--border); }
}

/* Stat cards */
.stat-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: .3rem;
}
.stat-label { font-size: .78rem; color: var(--text-muted); }
.stat-value { font-size: 1.8rem; font-weight: 700; color: var(--text); }

/* Report sections */
.report-section { margin-bottom: 2rem; }
.report-section-title {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-muted);
    margin-bottom: .75rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid var(--border);
}
.report-empty {
    color: var(--text-muted);
    font-size: .88rem;
    font-style: italic;
}
.report-pay-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem;
}
.report-pay-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
}
.report-pay-card.report-pay-net {
    border-color: var(--primary);
    background: rgba(99,102,241,.07);
}
.report-pay-who {
    font-size: .78rem;
    color: var(--text-muted);
    margin-bottom: .35rem;
}
.report-pay-amt {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}

/* ============================================================
   Travels – Trip Grid & Cards
   ============================================================ */
.trip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.trip-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-decoration: none;
    color: var(--text);
    transition: border-color .15s, transform .1s, box-shadow .15s;
    box-shadow: var(--shadow);
}
.trip-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(99,102,241,.2);
    text-decoration: none;
    color: var(--text);
}

.trip-card-header {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    margin-bottom: .75rem;
}

.trip-flag {
    font-size: 2.2rem;
    line-height: 1;
    flex-shrink: 0;
}

.trip-card-meta {
    flex: 1;
    min-width: 0;
}
.trip-card-location {
    font-size: .8rem;
    color: var(--text-muted);
    margin-bottom: .2rem;
}
.trip-card-name {
    font-size: 1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trip-badge {
    font-size: .72rem;
    font-weight: 700;
    padding: .2rem .55rem;
    border-radius: 20px;
    flex-shrink: 0;
    white-space: nowrap;
}
.trip-badge-now      { background: rgba(34,197,94,.15);  color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.trip-badge-upcoming { background: rgba(99,102,241,.15); color: #818cf8; border: 1px solid rgba(99,102,241,.3); }

.trip-card-dates {
    font-size: .82rem;
    color: var(--text-muted);
    margin-bottom: .85rem;
}

.trip-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: .75rem;
    border-top: 1px solid var(--border);
}
.trip-expense-count {
    font-size: .8rem;
    color: var(--text-muted);
}
.trip-totals {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.trip-total-item {
    font-size: .88rem;
    font-weight: 700;
    color: var(--primary);
}
.trip-no-expense {
    font-size: .8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Empty state box */
.empty-state-box {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state-icon {
    font-size: 3rem;
    margin-bottom: .75rem;
}

/* ============================================================
   Travel Detail Page
   ============================================================ */
.trip-detail-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.trip-detail-flag {
    font-size: 4rem;
    line-height: 1;
    flex-shrink: 0;
}
.trip-detail-info h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: .25rem;
}
.trip-detail-location {
    font-size: .9rem;
    color: var(--text-muted);
    margin-bottom: .2rem;
}
.trip-detail-dates {
    font-size: .85rem;
    color: var(--text-muted);
}

/* Summary cards row */
.trip-summary-cards {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.trip-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .85rem 1.1rem;
    min-width: 130px;
}
.trip-summary-label {
    font-size: .75rem;
    color: var(--text-muted);
    margin-bottom: .25rem;
}
.trip-summary-amount {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
}

/* Section title */
.trip-section-title {
    font-size: .9rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .75rem;
}

/* Expense list */
.trip-expense-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.trip-expense-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .6rem 0;
    border-bottom: 1px solid var(--border);
}
.trip-expense-row:last-child { border-bottom: none; }

.trip-expense-main { flex: 1; min-width: 0; }
.trip-expense-name {
    font-size: .9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.trip-expense-meta {
    display: flex;
    gap: .75rem;
    font-size: .78rem;
    color: var(--text-muted);
    margin-top: .15rem;
}
.trip-expense-payer { color: var(--primary); }

.trip-expense-right {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-shrink: 0;
}
.trip-expense-amount {
    font-size: .95rem;
    font-weight: 700;
}

/* Icon button (delete) */
.btn-icon {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: .2rem .4rem;
    cursor: pointer;
    font-size: .75rem;
    line-height: 1;
    transition: background .15s, border-color .15s, color .15s;
    color: var(--text-muted);
}
.btn-danger-icon:hover {
    background: rgba(239,68,68,.15);
    border-color: rgba(239,68,68,.4);
    color: var(--danger);
}

/* Add Expense Form box */
.add-expense-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.add-expense-form .form-actions {
    margin-top: .5rem;
}

/* Compact expense table */
.trip-expense-table {
    display: flex;
    flex-direction: column;
}
.trip-expense-thead {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: .5rem;
    padding: .3rem .5rem;
    font-size: .75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    border-bottom: 1px solid var(--border);
    margin-bottom: .25rem;
}
.trip-expense-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: .5rem;
    align-items: center;
    padding: .4rem .5rem;
    border-radius: 6px;
    font-size: .88rem;
    transition: background .1s;
}
.trip-expense-row:hover { background: var(--bg-card-2); }
.trip-expense-row .trip-expense-name   { font-weight: 500; }
.trip-expense-row .trip-expense-payer  { color: var(--primary); font-size: .82rem; }
.trip-expense-row .trip-expense-date   { color: var(--text-muted); font-size: .8rem; }
.trip-expense-row .trip-expense-amount { text-align: right; font-weight: 700; }

/* Inline expense form row */
.exp-form-row {
    display: flex;
    gap: .75rem;
    align-items: flex-end;
    flex-wrap: wrap;
}
.exp-form-row .form-group { margin-bottom: 0; }

.btn-finish {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    border: none;
    font-weight: 700;
    white-space: nowrap;
}
.btn-finish:hover { opacity: .88; text-decoration: none; color: #fff; }

.trip-badge-done {
    background: rgba(34,197,94,.15);
    color: #4ade80;
    border: 1px solid rgba(34,197,94,.3);
    font-size: .75rem;
    font-weight: 700;
    padding: .35rem .75rem;
    border-radius: 20px;
    white-space: nowrap;
    align-self: flex-start;
}

/* Paid expense state */
.trip-expense-row.exp-paid .trip-expense-name,
.trip-expense-row.exp-paid .trip-expense-amount {
    opacity: .45;
    text-decoration: line-through;
}
.trip-expense-row.exp-paid .trip-expense-payer,
.trip-expense-row.exp-paid .trip-expense-date { opacity: .4; }

.exp-paid-badge {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    background: rgba(34,197,94,.15);
    color: #4ade80;
    border: 1px solid rgba(34,197,94,.3);
    border-radius: 10px;
    padding: .05rem .45rem;
    margin-left: .4rem;
    vertical-align: middle;
    text-decoration: none !important;
}

.exp-actions { display: flex; gap: .3rem; align-items: center; }

.btn-unpaid-icon { color: var(--success); }
.btn-unpaid-icon:hover {
    background: rgba(34,197,94,.15);
    border-color: rgba(34,197,94,.4);
    color: var(--success);
}
.btn-paid-icon { color: var(--text-muted); }
.btn-paid-icon:hover {
    background: var(--bg-card-2);
    border-color: var(--border);
    color: var(--text);
}

/* ============================================================
   Loading Overlay
   ============================================================ */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,17,23,.82);
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    backdrop-filter: blur(2px);
}
#loading-overlay .loading-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid rgba(99,102,241,.25);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .75s linear infinite;
}
#loading-overlay p {
    color: var(--text-muted);
    font-size: .95rem;
    letter-spacing: .02em;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Active nav item */
.btn-nav-active {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--primary);
}
.btn-nav-active:hover { background: rgba(99,102,241,.1); text-decoration: none; color: var(--text); }
