:root {
    --blue: #0b88d9;
    --blue-dark: #083a68;
    --yellow: #f4c71f;
    --black: #111827;
    --white: #ffffff;
    --muted: #6b7280;
    --border: #e5e7eb;
    --bg: #f4f7fb;
    --red: #ef4444;
    --green: #16a34a;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: var(--black); background: var(--bg); }
a { color: inherit; text-decoration: none; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar { width: 275px; background: linear-gradient(180deg, #071323, #0a3154); color: #fff; padding: 24px 18px; position: fixed; top: 0; bottom: 0; left: 0; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.brand img { width: 62px; height: 62px; object-fit: contain; background: #fff; border-radius: 18px; padding: 8px; }
.brand strong { display: block; font-size: 16px; line-height: 1.2; }
.brand span { display: block; font-size: 12px; opacity: .75; margin-top: 4px; }
.menu { display: grid; gap: 8px; }
.menu a { padding: 13px 14px; border-radius: 14px; color: rgba(255,255,255,.82); font-weight: 700; font-size: 14px; }
.menu a:hover, .menu a.active { background: rgba(255,255,255,.12); color: #fff; }
.menu a.active { border-left: 4px solid var(--yellow); }
.menu a.logout { margin-top: 18px; color: #ffd2d2; }
.main-content { flex: 1; margin-left: 275px; padding: 28px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.topbar h1 { margin: 0; font-size: 30px; color: var(--black); }
.topbar p { margin: 6px 0 0; color: var(--muted); }
.user-card { background: #fff; border: 1px solid var(--border); padding: 12px 16px; border-radius: 16px; min-width: 150px; box-shadow: 0 10px 30px rgba(15,23,42,.06); }
.user-card span, .user-card small { display: block; }
.user-card span { font-weight: 800; }
.user-card small { color: var(--muted); margin-top: 2px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 18px 50px rgba(15,23,42,.07); padding: 22px; margin-bottom: 20px; }
.card-title { margin: 0 0 14px; font-size: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 22px; padding: 20px; box-shadow: 0 18px 50px rgba(15,23,42,.07); position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; width: 120px; height: 120px; border-radius: 50%; background: rgba(11,136,217,.09); right: -40px; bottom: -50px; }
.stat-card.yellow::after { background: rgba(244,199,31,.22); }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; }
.stat-value { display: block; margin-top: 12px; font-size: 28px; font-weight: 900; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; border-radius: 12px; border: 1px solid transparent; cursor: pointer; font-weight: 800; font-size: 14px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-dark { background: var(--black); color: #fff; }
.btn-warning { background: var(--yellow); color: #111; }
.btn-danger { background: var(--red); color: #fff; }
.btn-light { background: #fff; border-color: var(--border); color: var(--black); }
.btn-success { background: var(--green); color: #fff; }
.btn-sm { padding: 7px 10px; font-size: 12px; border-radius: 10px; }
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: #4b5563; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: #f9fafb; }
td { font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-group { display: grid; gap: 7px; }
.form-group.full { grid-column: 1 / -1; }
label { font-weight: 800; font-size: 13px; color: #374151; }
input, select, textarea { width: 100%; padding: 12px 13px; border: 1px solid #d1d5db; border-radius: 12px; outline: none; background: #fff; font-size: 14px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(11,136,217,.12); }
.form-actions { margin-top: 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.filter-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: end; }
.badge { display: inline-block; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.badge-blue { background: #e0f2fe; color: #075985; }
.alert { border-radius: 14px; padding: 13px 16px; margin-bottom: 18px; font-weight: 700; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at top left, rgba(244,199,31,.35), transparent 35%), linear-gradient(135deg, #061322, #082f53 55%, #111827); padding: 24px; }
.login-card { width: min(440px, 100%); background: rgba(255,255,255,.96); border-radius: 28px; padding: 34px; box-shadow: 0 30px 90px rgba(0,0,0,.28); }
.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.login-logo img { width: 74px; height: 74px; object-fit: contain; }
.login-logo h1 { margin: 0; font-size: 22px; }
.login-logo p { margin: 4px 0 0; color: var(--muted); }
.login-help { margin-top: 18px; padding: 12px; border-radius: 14px; background: #f3f4f6; color: #4b5563; font-size: 13px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.receipt-body { background: #fff; }
.receipt-toolbar { max-width: 1100px; margin: 24px auto 12px; display: flex; justify-content: space-between; gap: 8px; }
.receipt-paper { width: 1050px; min-height: 620px; margin: 0 auto 40px; padding: 24px; background: #fff; color: #1f2937; }
.receipt-box { border: 3px solid #27364b; position: relative; min-height: 640px; }
.receipt-box.revised { min-height: 650px; }
.receipt-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px 10px; border-bottom: 3px solid #27364b; }
.receipt-logo { width: 260px; height: 80px; object-fit: contain; object-position: left center; }
.receipt-logo.large { width: 340px; height: 92px; }
.receipt-title { border: 3px solid #27364b; padding: 10px 30px; font-size: 18px; font-weight: 900; letter-spacing: .03em; }
.receipt-content { padding: 30px 18px 28px; }
.row-line { display: grid; grid-template-columns: 230px 16px 1fr; align-items: end; min-height: 38px; font-size: 16px; }
.row-line b { font-weight: 900; }
.row-line .line { border-bottom: 2px solid #27364b; min-height: 24px; padding-left: 8px; }
.row-line.multi { align-items: start; }
.payment-row { margin-top: 2px; }
.payment-wrap { min-height: 112px; padding-left: 8px; display: flex; flex-direction: column; gap: 8px; }
.payment-value { min-height: 22px; line-height: 1.25; display: flex; align-items: flex-end; }
.payment-underline { border-bottom: 2px solid #27364b; height: 16px; }
.amount-date { display: grid; grid-template-columns: 1fr 330px; gap: 20px; margin-top: 42px; align-items: start; }
.amount-line { display: grid; grid-template-columns: 230px 16px 270px; align-items: end; min-height: 42px; font-size: 16px; }
.amount-line b { font-weight: 900; font-size: 16px; line-height: 1.25; }
.amount-line .line { border-bottom: 2px solid #27364b; padding: 4px 8px; font-weight: 900; font-size: 16px; line-height: 1.25; }
.sign-box { text-align: center; font-size: 16px; position: relative; min-height: 220px; padding-top: 6px; }
.sign-box .pic-label { margin-top: 16px; font-weight: 800; }
.sign-box .stamp-wrap { position: absolute; left: 50%; top: 102px; transform: translateX(-50%); width: 150px; height: 95px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.sign-box .pic-name { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); border-bottom: 2px dotted #27364b; display: inline-block; min-width: 230px; padding-bottom: 4px; font-weight: 800; z-index: 2; background: transparent; }
.receipt-stamp.centered { width: 125px; height: 125px; opacity: .12; object-fit: contain; }
.no-print { display: block; }
@media (max-width: 980px) {
    .sidebar { position: static; width: 100%; }
    .app-shell { display: block; }
    .main-content { margin-left: 0; padding: 18px; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid, .filter-row { grid-template-columns: 1fr; }
}
@media print {
    body { background: #fff; }
    .no-print, .receipt-toolbar { display: none !important; }
    .receipt-paper { margin: 0; padding: 0; width: 100%; }
    .receipt-box { min-height: 540px; }
    @page { size: A4 landscape; margin: 12mm; }
}
