/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Base ───────────────────────────────────────────────────── */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: none; border-top: 1px solid #e5e7eb; margin: 28px 0; }
code { background: #f3f4f6; padding: 2px 7px; border-radius: 4px; font-size: 0.88rem; }

/* ── Layout ─────────────────────────────────────────────────── */
.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.main { flex: 1; padding: 32px 20px; }

/* ── Header ─────────────────────────────────────────────────── */
.header {
    background: #1a1a2e;
    color: #fff;
    padding: 14px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.header-inner { display: flex; justify-content: space-between; align-items: center; }
.logo { color: #fff; text-decoration: none; font-size: 1.25rem; font-weight: 700; }
.logo span { color: #60a5fa; }
.nav a { color: #a5b4fc; text-decoration: none; margin-left: 22px; font-size: .93rem; transition: color .2s; }
.nav a:hover { color: #fff; }

/* ── Footer ─────────────────────────────────────────────────── */
.footer { text-align: center; padding: 18px; color: #9ca3af; font-size: .84rem; border-top: 1px solid #e5e7eb; margin-top: 40px; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    margin-bottom: 24px;
}
.card-narrow { max-width: 440px; margin-left: auto; margin-right: auto; }
.card h1 { font-size: 1.5rem; margin-bottom: 6px; color: #1a1a2e; }
.subtitle { color: #6b7280; margin-bottom: 24px; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 20px; font-size: .93rem; line-height: 1.5; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 5px; font-size: .9rem; color: #374151; }
.req { color: #dc2626; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: .95rem;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
    color: #1a1a2e;
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
input[type="file"] {
    padding: 12px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    width: 100%;
}
input[type="file"]:hover { border-color: #2563eb; }
textarea { resize: vertical; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-size: .93rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, transform .1s;
    text-align: center;
    font-family: inherit;
    line-height: 1.4;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn-primary   { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #e5e7eb; color: #374151; }
.btn-secondary:hover { background: #d1d5db; }
.btn-success   { background: #059669; color: #fff; }
.btn-success:hover { background: #047857; }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning   { background: #d97706; color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 14px; font-size: .84rem; }

/* ── Badges ─────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge-success { background: #ecfdf5; color: #065f46; }
.badge-warning { background: #fffbeb; color: #92400e; }
.badge-danger  { background: #fef2f2; color: #991b1b; }
.badge-info    { background: #eff6ff; color: #1e40af; }

/* ── Data table ─────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th {
    text-align: left; padding: 12px 10px; border-bottom: 2px solid #e5e7eb;
    color: #6b7280; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px;
}
.data-table td { padding: 12px 10px; border-bottom: 1px solid #f3f4f6; }
.data-table tr:hover { background: #f9fafb; }
.nowrap { white-space: nowrap; }

/* ── Detail table (key-value) ───────────────────────────────── */
.detail-table { width: 100%; }
.detail-table th {
    text-align: left; padding: 10px 16px 10px 0; color: #6b7280;
    font-weight: 600; width: 170px; vertical-align: top; border-bottom: 1px solid #f3f4f6;
}
.detail-table td { padding: 10px 0; border-bottom: 1px solid #f3f4f6; }

/* ── Stats grid ─────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
    background: #fff; border-radius: 12px; padding: 20px; text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,.07); border-top: 4px solid #e5e7eb;
}
.stat-pending    { border-top-color: #d97706; }
.stat-approved   { border-top-color: #059669; }
.stat-rejected   { border-top-color: #dc2626; }
.stat-needs-info { border-top-color: #2563eb; }
.stat-number { font-size: 2rem; font-weight: 700; color: #1a1a2e; }
.stat-label  { color: #6b7280; font-size: .84rem; margin-top: 2px; }

/* ── Success / tracking ─────────────────────────────────────── */
.text-center { text-align: center; }
.success-icon {
    font-size: 2.8rem; color: #059669; background: #ecfdf5;
    width: 80px; height: 80px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
}
.tracking-box { background: #f0f2f5; border-radius: 12px; padding: 24px; margin: 24px 0; }
.tracking-label { color: #6b7280; font-size: .88rem; margin-bottom: 6px; }
.tracking-code  { font-size: 2rem; font-weight: 700; color: #1a1a2e; letter-spacing: 3px; font-family: 'Courier New', monospace; }
.tracking-hint  { color: #9ca3af; font-size: .82rem; margin-top: 8px; }
.actions { margin-top: 24px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Status form ────────────────────────────────────────────── */
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; }
.status-result { margin-top: 24px; }
.status-result h2 { font-size: 1.15rem; margin-bottom: 12px; }

/* ── Filter form ────────────────────────────────────────────── */
.filter-form { margin-bottom: 20px; }
.filter-row { align-items: flex-end; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.total-count { text-align: center; color: #9ca3af; font-size: .84rem; margin-top: 14px; }
.empty-state { text-align: center; color: #9ca3af; padding: 40px 0; font-size: .95rem; }

/* ── Admin view page ────────────────────────────────────────── */
.view-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.view-header h1 { margin-bottom: 0; }
.proof-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.proof-grid h2 { font-size: 1.1rem; color: #374151; margin-bottom: 14px; }
.proof-image { max-width: 100%; border-radius: 8px; border: 1px solid #e5e7eb; }

/* ── Admin actions ──────────────────────────────────────────── */
.admin-actions { margin-top: 24px; }
.admin-actions h2 { font-size: 1.1rem; margin-bottom: 16px; }
.action-form { background: #f9fafb; padding: 20px; border-radius: 8px; margin-bottom: 16px; }
.approve-form { border-left: 4px solid #059669; }
.reject-form  { border-left: 4px solid #dc2626; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .form-row { flex-direction: column; gap: 0; }
    .proof-grid { grid-template-columns: 1fr; }
    .header-inner { flex-direction: column; gap: 10px; }
    .nav a { margin-left: 14px; }
    .nav a:first-child { margin-left: 0; }
    .card { padding: 20px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
