* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: #f6f1e8; color: #1d2935; }
a { color: inherit; text-decoration: none; }
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 270px; background: #10212f; color: #fff; padding: 28px 22px; display: flex; flex-direction: column; justify-content: space-between; }
.eyebrow { text-transform: uppercase; letter-spacing: .28em; color: #f0d28a; font-size: 12px; }
.sidebar h1 { margin: 12px 0 10px; font-size: 34px; }
.muted { color: #c3d0d8; line-height: 1.5; }
.nav { display: grid; gap: 10px; margin: 28px 0; }
.nav a { padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.05); }
.nav a:hover { background: rgba(255,255,255,.12); }
.user-box { background: rgba(255,255,255,.08); border-radius: 16px; padding: 16px; color: #d6e0e6; line-height: 1.8; }
.content { flex: 1; padding: 28px; overflow-x: auto; }
.content-full { max-width: 1100px; margin: 0 auto; }
.card { background: #fff; border-radius: 24px; padding: 24px; box-shadow: 0 8px 24px rgba(0,0,0,.06); margin-bottom: 22px; }
.hero { background: linear-gradient(135deg, #10212f, #194055 58%, #e8c58f); color: #fff; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { background: #fff; border-radius: 22px; padding: 20px; box-shadow: 0 8px 24px rgba(0,0,0,.05); }
.stat-label { color: #6e7780; font-size: 14px; }
.stat-value { margin-top: 10px; font-size: 28px; font-weight: bold; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.toolbar > div:last-child, .action-group { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-block; background: #10212f; color: #fff; padding: 12px 16px; border: 0; border-radius: 14px; cursor: pointer; min-height: 46px; font-weight: 600; text-align: center; }
.btn.secondary { background: #f0c667; color: #222; }
.btn.light { background: #ece7dd; color: #243240; }
.btn.danger { background: #a93333; }
form.inline { display: inline; }
input, select, textarea { width: 100%; padding: 12px 14px; border: 1px solid #d8d1c5; border-radius: 14px; background: #fcfbf7; font-size: 16px; }
label { display: block; margin-bottom: 8px; font-weight: bold; font-size: 14px; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.mb { margin-bottom: 18px; }
.alert { padding: 14px 16px; border-radius: 14px; margin-bottom: 18px; }
.success { background: #eaf7ed; color: #1f6b34; }
.error { background: #fdecec; color: #8d2121; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 10px; text-align: left; border-bottom: 1px solid #eee7db; vertical-align: top; }
th { color: #66717d; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
.badge { display: inline-block; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: bold; }
.badge.green { background: #eaf7ed; color: #1f6b34; }
.badge.gray { background: #eceff1; color: #51606b; }
.receipt-sheet { display: grid; grid-template-columns: 1fr; gap: 18px; }
.receipt-copy { border: 2px solid #1f2b38; border-radius: 18px; padding: 18px; background: #fffef8; }
.receipt-copy h3 { margin: 8px 0; font-size: 24px; }
.receipt-box { display: inline-flex; border: 2px solid #1f2b38; margin-top: 16px; }
.receipt-box span { padding: 10px 14px; font-weight: bold; }
.receipt-box span + span { border-left: 2px solid #1f2b38; }
.signature-line { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; margin-top: 34px; text-align: center; }
.signature-line div { border-top: 2px solid #1f2b38; padding-top: 10px; min-height: 88px; display: flex; flex-direction: column; justify-content: flex-end; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 26px; }
.auth-card { max-width: 460px; width: 100%; }
.small { font-size: 13px; color: #66717d; }
.search-form { display: flex; gap: 10px; flex-wrap: wrap; }
.search-form input { flex: 1; min-width: 230px; }
.mobile-card-table { width: 100%; }
.pagination { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }
.page-link, .page-dots { min-width: 42px; padding: 10px 12px; border-radius: 12px; text-align: center; background: #f3ede3; color: #243240; font-weight: 600; }
.page-link.active { background: #10212f; color: #fff; }
.page-link.disabled { pointer-events: none; opacity: .45; }
.page-dots { background: transparent; min-width: auto; padding-left: 4px; padding-right: 4px; }
img.signature { max-height: 58px; max-width: 145px; object-fit: contain; display: block; margin: 0 auto 8px; mix-blend-mode: multiply; opacity: .95; filter: contrast(1.3) saturate(1.08); background: transparent; }
.receipt-paper { max-width: 820px; margin: 0 auto; background: #fffdf7; border: 2px solid #243240; border-radius: 18px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.08); page-break-inside: avoid; }
.receipt-top { display: grid; grid-template-columns: 150px 1fr 145px; gap: 14px; align-items: start; padding: 16px 18px 12px; background: linear-gradient(180deg, rgba(240,198,103,.18), rgba(255,253,247,.35)); border-bottom: 2px solid #243240; }
.receipt-number-box { border: 2px solid #243240; border-radius: 12px; padding: 10px 12px; background: #fff; }
.receipt-number-box .label { font-size: 12px; text-transform: uppercase; letter-spacing: .2em; color: #6e7780; }
.receipt-number-box .value { font-size: 24px; font-weight: bold; margin-top: 4px; }
.receipt-brand { text-align: center; }
.receipt-brand h2 { margin: 0; font-size: 24px; line-height: 1.1; color: #132636; }
.receipt-brand p { margin: 4px 0 0; color: #5e6974; font-size: 12px; }
.receipt-date-box { text-align: right; }
.receipt-date-box .label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: #6e7780; }
.receipt-date-box .date { font-size: 14px; font-weight: bold; color: #132636; margin-top: 4px; }
.receipt-body { padding: 10px 18px 16px; }
.receipt-line { display: grid; grid-template-columns: 190px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px dashed #cfc6b8; align-items: start; }
.receipt-line .term { font-weight: bold; color: #132636; }
.receipt-line .value { color: #243240; min-height: 20px; border-bottom: 1px dotted #9aa5af; padding-bottom: 3px; }
.receipt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; margin-top: 12px; }
.receipt-grid-item { padding: 8px 10px; background: #fff; border: 1px solid #e7decd; border-radius: 10px; }
.receipt-grid-item .term { display: block; font-size: 10px; text-transform: uppercase; color: #7a8490; letter-spacing: .08em; }
.receipt-grid-item .value { display: block; margin-top: 5px; font-weight: bold; color: #1a2b39; font-size: 13px; }
.receipt-total-row { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; gap: 12px; flex-wrap: wrap; }
.receipt-note { margin-top: 12px; padding: 10px 12px; background: #fff; border: 1px solid #e7decd; border-radius: 10px; color: #53606d; font-size: 13px; }
.print-shell { background: #eef1f5; min-height: 100vh; padding: 24px; }
.print-toolbar { max-width: 900px; margin: 0 auto 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.receipt-browser { max-width: 860px; min-width: 860px; margin: 0 auto; border: 1px solid #cfd5db; background: #fff; border-radius: 16px; overflow: hidden; }
.receipt-browser-header { display: grid; grid-template-columns: 150px 1fr 140px; border-bottom: 1px solid #cfd5db; }
.receipt-browser-cell { padding: 14px 16px; border-right: 1px solid #cfd5db; }
.receipt-browser-cell:last-child { border-right: 0; }
.receipt-browser-title { font-size: 11px; color: #6e7780; text-transform: uppercase; letter-spacing: .08em; }
.receipt-browser-no { font-size: 30px; font-weight: 700; margin-top: 6px; }
.receipt-browser-name { font-size: 19px; font-weight: 700; line-height: 1.2; }
.receipt-browser-sub { font-size: 12px; color: #5a6673; margin-top: 5px; line-height: 1.5; }
.receipt-browser-date { font-size: 14px; font-weight: 700; margin-top: 24px; text-align: right; }
.receipt-browser-body { display: grid; grid-template-columns: 1.65fr .85fr; }
.receipt-browser-main { padding: 0; border-right: 1px solid #cfd5db; }
.receipt-browser-side { padding: 0; }
.receipt-browser-row { display: grid; grid-template-columns: 180px 1fr; border-bottom: 1px solid #dde3e8; }
.receipt-browser-label, .receipt-browser-value { padding: 12px 14px; font-size: 14px; }
.receipt-browser-label { font-weight: 700; background: #fbfcfd; }
.receipt-browser-value { color: #243240; }
.receipt-browser-side h3 { margin: 0; padding: 12px 14px; font-size: 16px; border-bottom: 1px solid #cfd5db; }
.receipt-browser-summary { display: grid; grid-template-columns: 1fr auto; border-bottom: 1px solid #dde3e8; }
.receipt-browser-summary span { padding: 11px 14px; font-size: 14px; }
.receipt-browser-summary strong { padding: 11px 14px; font-size: 14px; }
.receipt-browser-footer { padding: 14px 16px 18px; border-top: 1px solid #cfd5db; }
.receipt-browser-amount { display: inline-flex; border: 2px solid #243240; margin: 8px 0 16px; }
.receipt-browser-amount span { padding: 10px 16px; font-weight: 700; }
.receipt-browser-amount span + span { border-left: 2px solid #243240; }
.receipt-browser-signatures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 18px; }
.receipt-browser-signature { border-top: 1px solid #243240; padding-top: 10px; text-align: center; min-height: 92px; }
.receipt-browser-signature img { width: auto; max-width: 104px; max-height: 50px; display: block; margin: 0 auto 8px; object-fit: contain; mix-blend-mode: multiply; opacity: .92; filter: contrast(1.22) saturate(1.06); background: transparent; }
@media print {
  @page { size: A4 portrait; margin: 8mm; }
  body { background: #fff; }
  .print-shell { background: #fff; padding: 0; }
  .print-toolbar { display: none; }
  .receipt-paper { box-shadow: none; border-radius: 0; max-width: none; border: 1px solid #111; }
  .small { font-size: 11px; }
}
@media (max-width: 920px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; padding: 18px 16px; gap: 16px; }
  .sidebar h1 { font-size: 26px; margin: 8px 0 6px; }
  .muted { font-size: 13px; }
  .nav { display: flex; gap: 10px; margin: 12px 0 0; overflow-x: auto; padding-bottom: 4px; }
  .nav a { white-space: nowrap; padding: 10px 14px; border-radius: 999px; }
  .user-box { display: none; }
  .content { padding: 16px; }
  .card { padding: 18px; border-radius: 18px; margin-bottom: 16px; }
  .hero h2 { font-size: 24px; line-height: 1.2; margin: 8px 0 0; }
  .toolbar { align-items: stretch; }
  .toolbar > a, .toolbar > div:last-child, .action-group { width: 100%; }
  .toolbar > a, .toolbar .btn, .action-group .btn, .search-form .btn { width: 100%; }
  .search-form { flex-direction: column; }
  .search-form input { min-width: 0; }
  table.mobile-card-table thead { display: none; }
  table.mobile-card-table, table.mobile-card-table tbody, table.mobile-card-table tr, table.mobile-card-table td { display: block; width: 100%; }
  table.mobile-card-table tr { background: #fffdf9; border: 1px solid #e7decd; border-radius: 18px; padding: 12px 14px; margin-bottom: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.04); }
  table.mobile-card-table td { border-bottom: 0; padding: 8px 0; }
  table.mobile-card-table td::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #7b8591; margin-bottom: 4px; font-weight: 700; }
  table.mobile-card-table td:last-child { padding-top: 12px; }
  .receipt-browser { min-width: 0; border-radius: 14px; }
  .receipt-browser-cell, .receipt-browser-label, .receipt-browser-value, .receipt-browser-summary span, .receipt-browser-summary strong, .receipt-browser-side h3 { padding-left: 12px; padding-right: 12px; }
  .receipt-browser-no { font-size: 24px; }
  .receipt-browser-name { font-size: 17px; }
  .receipt-browser-footer { padding: 12px; }
  .receipt-browser-amount { display: flex; width: 100%; justify-content: center; }
  .receipt-browser-amount span { flex: 1; text-align: center; }
  .grid-2, .grid-3, .row, .row-3, .receipt-sheet, .signature-line, .receipt-grid, .receipt-top, .receipt-line, .receipt-browser-header, .receipt-browser-body, .receipt-browser-signatures { grid-template-columns: 1fr; }
  .receipt-date-box, .receipt-brand { text-align: left; }
  .receipt-browser-main { border-right: 0; }
}
