/* ==========================================================================
   assets/css/app.css — admin UI (not the print layout)
   ========================================================================== */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, Segoe UI, Arial, Helvetica, sans-serif;
    background: #f4f5f7;
    color: #1f2430;
}

.app-shell { display: flex; min-height: 100vh; }

/* ---- Nav ---- */
.app-nav {
    width: 200px;
    flex-shrink: 0;
    background: #1f2937;
    color: #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 18px 0;
}
.app-nav .brand { font-weight: bold; font-size: 15px; padding: 0 18px 18px 18px; border-bottom: 1px solid #374151; }
.app-nav ul { list-style: none; margin: 0; padding: 0; flex: 1; }
.app-nav ul li a {
    display: block; padding: 10px 18px; color: #d1d5db; text-decoration: none; font-size: 14px;
}
.app-nav ul li a:hover { background: #374151; color: #fff; }
.nav-user { padding: 14px 18px; border-top: 1px solid #374151; font-size: 12px; }
.nav-user span { display: block; margin-bottom: 6px; color: #9ca3af; }
.nav-user em { font-style: normal; color: #60a5fa; }
.nav-user a { color: #f87171; text-decoration: none; font-size: 12px; }

/* ---- Main ---- */
.app-main { flex: 1; padding: 24px 32px; max-width: 1100px; }
.page-title { font-size: 20px; margin: 0 0 18px 0; }

/* ---- Cards / stat tiles ---- */
.stat-grid { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.stat-card {
    background: #fff; border-radius: 8px; padding: 16px 20px; flex: 1; min-width: 160px;
    box-shadow: 0 1px 2px rgba(0,0,0,.06); border: 1px solid #e5e7eb;
}
.stat-card .stat-label { font-size: 12px; color: #6b7280; text-transform: uppercase; letter-spacing: .04em; }
.stat-card .stat-value { font-size: 24px; font-weight: bold; margin-top: 4px; }
.stat-card.warn .stat-value { color: #b45309; }
.stat-card.ok .stat-value { color: #15803d; }

/* ---- Tables ---- */
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.data-table th, .data-table td { padding: 9px 12px; border-bottom: 1px solid #eef0f2; font-size: 13px; text-align: left; }
.data-table th { background: #f9fafb; font-weight: 600; color: #374151; }
.data-table tbody tr:hover { background: #f9fafb; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.badge.paid { background: #dcfce7; color: #15803d; }
.badge.unpaid { background: #fee2e2; color: #b91c1c; }
.row-actions a { margin-right: 10px; font-size: 12px; text-decoration: none; color: #2563eb; }
.row-actions a.danger { color: #dc2626; }

/* ---- Forms ---- */
.card { background: #fff; border-radius: 8px; padding: 18px 22px; box-shadow: 0 1px 2px rgba(0,0,0,.06); border: 1px solid #e5e7eb; margin-bottom: 18px; }
fieldset { border: 1px solid #e5e7eb; border-radius: 6px; margin-bottom: 14px; padding: 10px 14px; }
legend { font-weight: 600; padding: 0 6px; font-size: 13px; color: #374151; }
.row { display: flex; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.field { flex: 1; min-width: 160px; }
label { display: block; font-size: 11px; font-weight: 600; margin-bottom: 3px; color: #4b5563; }
input, select { width: 100%; padding: 7px 9px; box-sizing: border-box; font-size: 13px; border: 1px solid #d1d5db; border-radius: 5px; }
input:focus, select:focus { outline: none; border-color: #2563eb; }

.btn {
    display: inline-block; padding: 8px 18px; font-size: 13px; font-weight: 600;
    border-radius: 6px; border: 1px solid transparent; cursor: pointer; text-decoration: none;
}
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #fff; color: #374151; border-color: #d1d5db; }
.btn-danger { background: #dc2626; color: #fff; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.filter-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.filter-form .field { min-width: 140px; }

.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.alert-error { background: #fdecea; border: 1px solid #f5c2c0; color: #7a1f1a; }
.alert-success { background: #dcfce7; border: 1px solid #bbf7d0; color: #14532d; }

.login-shell { max-width: 340px; margin: 90px auto; }
.login-shell .card { padding: 26px 28px; }
.login-shell h1 { font-size: 18px; text-align: center; margin-bottom: 18px; }
