/* ==========================================================================
   Cappaventures Tour Operation - interface styles
   Made by Ata İBRAHİMOĞLU
   ========================================================================== */

:root {
  --cv-navy: #10233c;
  --cv-navy-soft: #16304f;
  --cv-accent: #e8622c;
  --cv-accent-dark: #c74f1f;
  --cv-sidebar-w: 248px;
  --cv-good: #198754;
  --cv-info: #0d6efd;
  --cv-warn: #fd7e14;
  --cv-bad: #dc3545;
}

body {
  background: #f1f4f8;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
}

/* ------------------------------------------------------------------ topbar */
.topbar {
  background: var(--cv-navy);
  color: #fff;
  box-shadow: 0 2px 10px rgba(16, 35, 60, .18);
  padding: .4rem .25rem;
  z-index: 1040;
}
.topbar .navbar-brand { color: #fff; }
.topbar .brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--cv-accent); color: #fff; font-weight: 700; letter-spacing: .5px;
}
.topbar .brand-text { line-height: 1.1; }
.topbar .brand-text strong { display: block; font-size: .95rem; }
.topbar .brand-text small { font-size: .68rem; opacity: .7; }

.global-search { max-width: 420px; flex: 1 1 220px; }
.global-search .form-control { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.2); color:#fff; }
.global-search .form-control::placeholder { color: rgba(255,255,255,.6); }
.global-search .form-control:focus { background:#fff; color:#1b1b1b; }
.quick-results {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 1050;
  background: #fff; border: 1px solid #dde3ec; border-radius: 10px; margin-top: 4px;
  box-shadow: 0 10px 28px rgba(16,35,60,.18); max-height: 420px; overflow: auto;
}
.quick-results a {
  display: block; padding: .5rem .75rem; border-bottom: 1px solid #f0f3f8;
  color: #1b2a3d; text-decoration: none; font-size: .85rem;
}
.quick-results a:last-child { border-bottom: 0; }
.quick-results a:hover { background: #f5f8fc; }
.quick-results .qr-type { font-size: .68rem; text-transform: uppercase; color: #8894a6; }
.quick-results .qr-meta { font-size: .75rem; color: #6c7a8c; }

/* ----------------------------------------------------------------- layout */
.layout { display: flex; align-items: stretch; min-height: calc(100vh - 54px); }
.sidebar {
  width: var(--cv-sidebar-w); flex: 0 0 var(--cv-sidebar-w);
  background: #fff; border-right: 1px solid #e2e8f0;
  display: flex; flex-direction: column; justify-content: space-between;
  position: sticky; top: 54px; height: calc(100vh - 54px); overflow-y: auto;
}
.sidebar .nav-link {
  display: flex; align-items: center; gap: .6rem;
  color: #3d4b5c; border-radius: 0; padding: .55rem 1rem; font-size: .875rem;
  border-left: 3px solid transparent;
}
.sidebar .nav-link i { width: 18px; text-align: center; color: #8894a6; }
.sidebar .nav-link:hover { background: #f3f7fc; color: var(--cv-navy); }
.sidebar .nav-link.active {
  background: #eef4fd; color: var(--cv-navy); font-weight: 600;
  border-left-color: var(--cv-accent);
}
.sidebar .nav-link.active i { color: var(--cv-accent); }
.sidebar-footer { padding: .75rem 1rem; border-top: 1px solid #eef1f6; color: #7c8a9c; }

.content { flex: 1 1 auto; padding: 1.1rem 1.25rem 0; min-width: 0; }
.app-footer {
  margin: 2rem -1.25rem 0; padding: .9rem 1.25rem;
  border-top: 1px solid #e2e8f0; color: #7c8a9c; font-size: .78rem; background: #fff;
}

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed; left: 0; top: 54px; z-index: 1035;
    transform: translateX(-100%); transition: transform .2s ease;
    box-shadow: 0 10px 30px rgba(16,35,60,.2);
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding: .9rem .75rem 0; }
  .app-footer { margin: 1.5rem -.75rem 0; padding: .8rem .75rem; }
}

/* ------------------------------------------------------------- page header */
.page-head {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  justify-content: space-between; margin-bottom: 1rem;
}
.page-head h1 { font-size: 1.3rem; margin: 0; font-weight: 600; color: var(--cv-navy); }
.page-head .subtitle { font-size: .8rem; color: #6c7a8c; }

/* -------------------------------------------------------------- stat cards */
.stat-grid {
  display: grid; gap: .75rem;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  margin-bottom: 1rem;
}
.stat-card {
  background: #fff; border: 1px solid #e4eaf2; border-radius: 12px;
  padding: .85rem .9rem; position: relative; overflow: hidden;
}
.stat-card .stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: #8894a6; }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 650; color: var(--cv-navy); line-height: 1.2; }
.stat-card .stat-hint { font-size: .74rem; color: #6c7a8c; }
.stat-card .stat-icon { position: absolute; right: .6rem; top: .6rem; font-size: 1.3rem; opacity: .14; }
.stat-card.accent { border-left: 3px solid var(--cv-accent); }
.stat-card.good { border-left: 3px solid #198754; }
.stat-card.warn { border-left: 3px solid #fd7e14; }
.stat-card.bad { border-left: 3px solid #dc3545; }
.stat-card.info { border-left: 3px solid #0d6efd; }

/* ------------------------------------------------------------------ cards */
.card { border: 1px solid #e4eaf2; border-radius: 12px; }
.card-header {
  background: #fff; border-bottom: 1px solid #eef1f6;
  font-weight: 600; color: var(--cv-navy); font-size: .92rem;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  border-radius: 12px 12px 0 0 !important;
}

/* ----------------------------------------------------------------- tables */
.table { font-size: .85rem; }
.table > :not(caption) > * > * { padding: .45rem .55rem; }
.table thead th {
  background: #f7f9fc; color: #55667c; font-weight: 600;
  font-size: .74rem; text-transform: uppercase; letter-spacing: .3px;
  white-space: nowrap; border-bottom: 1px solid #e2e8f0;
}
.table-sticky thead th { position: sticky; top: 0; z-index: 2; }
.table tfoot td { font-weight: 600; background: #f7f9fc; }
.table-hover tbody tr:hover { background: #f3f8ff; }
.amount-pos { color: #146c43; font-weight: 600; }
.amount-neg { color: #b02a37; font-weight: 600; }
.amount-zero { color: #8894a6; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }

/* ----------------------------------------------------------------- filters */
.filter-bar {
  background: #fff; border: 1px solid #e4eaf2; border-radius: 12px;
  padding: .75rem; margin-bottom: 1rem;
}
.filter-bar label { font-size: .72rem; text-transform: uppercase; color: #8894a6; margin-bottom: .15rem; }

/* ------------------------------------------------------------ vehicle load */
.load-bar {
  position: relative; height: 26px; background: #e9eef5; border-radius: 13px;
  overflow: hidden; border: 1px solid #dde3ec;
}
.load-fill { height: 100%; transition: width .3s ease; }
.load-fill.ok { background: linear-gradient(90deg, #198754, #20c997); }
.load-fill.busy { background: linear-gradient(90deg, #fd7e14, #ffc107); }
.load-fill.full { background: linear-gradient(90deg, #b02a37, #dc3545); }
.load-text {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 600; color: #10233c;
}

.waiting-item {
  border: 1px solid #e4eaf2; border-radius: 9px; padding: .5rem .6rem; margin-bottom: .5rem;
  background: #fff; font-size: .82rem;
}
.waiting-item:hover { border-color: var(--cv-accent); background: #fff9f6; }

/* ------------------------------------------------------- cash panel (kasa) */
.kasa-grid {
  display: grid; gap: .75rem; margin-bottom: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}
.kasa-card {
  background: #fff; border: 1px solid #e4eaf2; border-radius: 14px;
  padding: .9rem 1rem; border-top: 4px solid #cbd5e1; position: relative;
}
.kasa-card .kasa-label {
  font-size: .74rem; text-transform: uppercase; letter-spacing: .4px; color: #8894a6;
  margin-bottom: .15rem;
}
.kasa-card .kasa-value { font-size: 1.65rem; font-weight: 680; line-height: 1.15; color: var(--cv-navy); }
.kasa-card .kasa-foot {
  font-size: .76rem; color: #6c7a8c; margin-top: .3rem;
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
}
.kasa-card.income  { border-top-color: #198754; }
.kasa-card.expense { border-top-color: #dc3545; }
.kasa-card.profit  { border-top-color: var(--cv-accent); }
.kasa-card.cash    { border-top-color: #0d6efd; }
.kasa-card.collect { border-top-color: #20c997; }
.kasa-card.topay   { border-top-color: #fd7e14; }

.trend { font-weight: 600; font-size: .76rem; white-space: nowrap; }
.trend.up { color: #146c43; }
.trend.down { color: #b02a37; }
.trend.flat { color: #8894a6; }

.mini-label { font-size: .72rem; text-transform: uppercase; color: #8894a6; letter-spacing: .3px; }
.mini-value { font-size: 1.1rem; font-weight: 650; color: var(--cv-navy); }

.month-bars { display: flex; gap: .6rem; align-items: flex-end; min-height: 170px; }
.month-col { flex: 1 1 0; text-align: center; }
.month-col .bars {
  display: flex; gap: 3px; align-items: flex-end; justify-content: center;
  height: 120px; padding: 0 2px;
}
.month-col .bar { width: 40%; border-radius: 4px 4px 0 0; min-height: 2px; }
.month-col .bar.rev { background: #198754; }
.month-col .bar.exp { background: #dc3545; }
.month-col.current { background: #f3f8ff; border-radius: 10px; }
.month-label { font-size: .76rem; margin-top: .3rem; }
.month-label a { text-decoration: none; }
.month-net { font-size: .82rem; font-weight: 650; }
.month-pax { font-size: .7rem; color: #8894a6; }
.month-bars + div .key,
.seat-legend span.key {
  display: inline-block; width: 14px; height: 14px; border-radius: 4px; margin-right: .3rem;
  vertical-align: -2px;
}

/* ---------------------------------------------------------------- utility */
.badge-soft { background: #eef4fd; color: #28527a; font-weight: 600; }
.chip {
  display: inline-block; padding: .1rem .45rem; border-radius: 20px;
  font-size: .7rem; font-weight: 600; background: #eef1f6; color: #55667c;
}
.tour-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .35rem; }
.issue-list li { font-size: .82rem; }
.flash-stack .alert { font-size: .87rem; }
.help-text { font-size: .75rem; color: #7c8a9c; }
.required::after { content: " *"; color: #dc3545; }
.money-box {
  background: #f7f9fc; border: 1px solid #e4eaf2; border-radius: 10px; padding: .6rem .7rem;
}
.money-box .row-line { display: flex; justify-content: space-between; font-size: .82rem; padding: .12rem 0; }
.money-box .row-line.total { border-top: 1px solid #dde3ec; margin-top: .3rem; padding-top: .35rem; font-weight: 700; }
.ledger-receivable { border-left: 3px solid #0d6efd; }
.ledger-payable { border-left: 3px solid #dc3545; }
.voided { opacity: .55; text-decoration: line-through; }
.sticky-actions {
  position: sticky; bottom: 0; background: #fff; border-top: 1px solid #e4eaf2;
  padding: .7rem 0; margin-top: 1rem; z-index: 5;
}

/* ------------------------------------------------------------------ print */
.print-page { font-family: "DejaVu Sans", Arial, sans-serif; color: #111; padding: 18px; }
.print-page h1 { font-size: 17px; margin: 0 0 2px; }
.print-page h2 { font-size: 14px; margin: 14px 0 6px; }
.print-page table { width: 100%; border-collapse: collapse; font-size: 11px; }
.print-page th, .print-page td { border: 1px solid #999; padding: 3px 5px; text-align: left; }
.print-page th { background: #eee; }
.print-page .doc-head { display: flex; justify-content: space-between; border-bottom: 2px solid #333; padding-bottom: 8px; }
.print-page .doc-foot { margin-top: 18px; font-size: 10px; color: #555; border-top: 1px solid #bbb; padding-top: 6px; }
.print-page .num { text-align: right; }
.print-toolbar { margin-bottom: 12px; }

@media print {
  .print-toolbar, .no-print { display: none !important; }
  .print-page { padding: 0; }
  @page { margin: 12mm; }
}
