:root{
  --bg:#f5f7fb;
  --card:#fff;
  --text:#1f2937;
  --muted:#6b7280;
  --line:#dbe3ee;
  --primary:#2f6f6d;
  --primary-soft:#e7f3f2;
  --ok:#166534;
}
*{box-sizing:border-box}
body{
  margin:0;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}
.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  background:rgba(255,255,255,.94);
  border-bottom:1px solid var(--line);
  position:sticky;
  top:0;
  z-index:20;
  backdrop-filter:blur(10px);
}
.brand{
  display:flex;
  align-items:center;
  text-decoration:none;
}
.brand-logo{
  height:20px;
  width:auto;
  display:block;
}
.topnav{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.topbar a{
  margin-left:0;
  text-decoration:none;
  font-weight:700;
}
.nav-link{
  color:#2f6f6d;
  font-size:14px;
  line-height:1;
  padding:9px 11px;
  border-radius:10px;
  background:#eef7f6;
  border:1px solid #cfe6e4;
}
.nav-link-logout{
  color:#6a4f3b;
  background:#f5efe8;
  border-color:#e8ddd2;
}
.container{max-width:980px;margin:0 auto;padding:10px}
.card{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:14px;margin-bottom:12px;box-shadow:0 1px 2px rgba(0,0,0,.03)}
.grid{display:grid;gap:12px}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
label{display:block;font-size:13px;font-weight:700;margin-bottom:6px;color:#334155}
input,select,button,textarea{font:inherit}
input,select,textarea{width:100%;padding:12px;border:1px solid #c7d2e2;border-radius:12px;background:#fff}
.static-box{padding:12px;border-radius:12px;background:var(--primary-soft);border:1px solid #d7dfe7;color:#334155;font-weight:700}
.row-actions{display:flex;gap:10px;flex-wrap:wrap}
.btn{border:0;border-radius:12px;padding:12px 16px;font-weight:700;cursor:pointer;text-decoration:none;display:inline-block}
.btn-primary{background:var(--primary);color:#fff}
.btn-secondary{background:#e5e7eb;color:#111827}
.success{background:var(--ok);color:#fff;padding:10px 12px;border-radius:10px}
.trip-card{border:1px solid var(--line);border-radius:14px;overflow:hidden}
.trip-head{padding:14px;background:#f8fbff;font-weight:800;display:flex;justify-content:space-between;align-items:center}
.trip-body{padding:12px}
.price-bar{display:flex;justify-content:space-between;background:#eef1f4;color:#1f2937;padding:10px 12px;border-radius:12px;font-weight:800;margin-top:10px}
.table{width:100%;border-collapse:collapse}
.table th,.table td{padding:10px;border-bottom:1px solid var(--line);text-align:left}
.table th:last-child,.table td:last-child{text-align:right}
.invoice-preview{background:white;padding:28px;border:1px solid var(--line);border-radius:16px}
.invoice-header{display:flex;justify-content:space-between;gap:20px;margin-bottom:20px}
.invoice-title{font-size:28px;font-weight:800;margin:18px 0 6px}
.sum-box{margin-left:auto;max-width:340px;border:1px solid var(--line);border-radius:14px;padding:14px;background:#fff}
.sum-line{display:flex;justify-content:space-between;padding:6px 0}
.sum-total{display:flex;justify-content:space-between;padding:10px 0 0;font-size:20px;font-weight:800;border-top:2px solid var(--line);margin-top:8px}
.muted{color:var(--muted)}
.danger{color:#b91c1c}
.success-text{color:#166534}
.kpi{padding:14px;border-radius:14px;background:white;border:1px solid var(--line)}
.kpi .v{font-size:24px;font-weight:800;margin-top:6px}

@media (max-width: 720px){
  .grid-2,.grid-3{grid-template-columns:1fr}
  .container{padding:10px}
  .invoice-header{flex-direction:column}
  .sum-box{max-width:none}
  .card{padding:12px}
  .topbar{padding:10px 10px}
  .brand-logo{height:20px}
  .topnav{gap:6px}
  .nav-link{padding:8px 10px;font-size:13px}
}

@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }

  header,
  nav,
  .row-actions,
  .btn,
  .btn-primary,
  .btn-secondary,
  a[href^="javascript:"],
  .topbar,
  .navbar {
    display: none !important;
  }

  .card,
  .invoice-preview {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    border-radius: 0 !important;
    background: #fff !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .invoice-preview {
    margin: 0 !important;
    padding: 0 !important;
  }

  h1, h2, h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  table {
    width: 100% !important;
    border-collapse: collapse !important;
  }

  tr, td, th {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  a {
    color: #000 !important;
    text-decoration: none !important;
  }

  @page {
    size: A4;
    margin: 12mm;
  }
}
