:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --bg: #f4f6fb;
    --card-bg: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --danger: #dc2626;
    --success: #16a34a;
}
* { box-sizing: border-box; }
body {
    font-family: 'Segoe UI', 'Noto Sans Bengali', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
}
.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.topbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky; top: 0; z-index: 50;
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 20px; font-weight: 700; color: var(--primary); text-decoration: none; }
.topbar-actions a {
    color: var(--text); text-decoration: none; margin-left: 16px; font-size: 14px;
}
.topbar-actions .btn { margin-left: 16px; }
.btn {
    display: inline-block; padding: 9px 18px; border-radius: 8px; border: none;
    background: var(--primary); color: #fff; font-size: 14px; font-weight: 600;
    cursor: pointer; text-decoration: none; transition: background .15s;
}
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn-outline {
    background: transparent; color: var(--primary); border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #b91c1c; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-disabled {
    background: #cbd5e1 !important; color: #64748b !important; cursor: not-allowed;
    pointer-events: none;
}
.page-header { margin: 24px 0; }
.page-header h1 { font-size: 24px; margin: 0 0 4px 0; }
.page-header p { color: var(--muted); margin: 0; }
.grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px; margin-top: 20px;
}
.card {
    background: var(--card-bg); border-radius: 14px; overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.08); border: 1px solid var(--border);
    display: flex; flex-direction: column;
}
.card-thumb {
    width: 100%; aspect-ratio: 1.586 / 1; background: #eef1f6;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.card-thumb img { width: 100%; height: 100%; object-fit: contain; }
.card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { font-size: 16px; margin: 0; }
.card-body .meta { font-size: 12px; color: var(--muted); }
.card-body .actions { margin-top: auto; display: flex; gap: 8px; }
.empty-state {
    text-align: center; padding: 60px 20px; color: var(--muted);
}
/* Modal */
.modal-overlay {
    display: none; position: fixed; inset: 0; background: rgba(15,23,42,.75);
    z-index: 200; align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: #fff; border-radius: 14px; max-width: 900px; width: 100%;
    max-height: 92vh; overflow-y: auto; padding: 20px;
    position: relative;
}
.modal-close {
    position: absolute; top: 12px; right: 16px; background: none; border: none;
    font-size: 24px; cursor: pointer; color: var(--muted);
}
.modal-box h2 { margin: 0 0 16px 0; font-size: 18px; }
.card-faces { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .card-faces { grid-template-columns: 1fr; } }
.face-block { text-align: center; }
.face-block .face-label {
    font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px;
}
.face-block img {
    width: 100%; border-radius: 8px; border: 1px solid var(--border);
    background: #eef1f6;
}
.face-block .face-actions { margin-top: 10px; }
.note-box {
    margin-top: 14px; font-size: 12px; color: var(--muted); background: #f1f5f9;
    padding: 10px 12px; border-radius: 8px;
}
/* Admin */
.admin-body { background: #f1f5f9; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 230px; background: #111827; color: #e5e7eb; flex-shrink: 0;
    padding: 20px 0;
}
.admin-sidebar .brand { color: #fff; padding: 0 20px 20px; display: block; font-size: 18px; }
.admin-sidebar a {
    display: block; padding: 11px 20px; color: #cbd5e1; text-decoration: none; font-size: 14px;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: #1f2937; color: #fff; }
.admin-main { flex: 1; padding: 26px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.form-box {
    background: #fff; border-radius: 12px; padding: 24px; max-width: 560px;
    border: 1px solid var(--border);
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-group input[type=text], .form-group input[type=password], .form-group input[type=file] {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
.alert {
    padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px;
}
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }
.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg);
}
.login-box {
    background: #fff; padding: 32px; border-radius: 14px; width: 100%; max-width: 380px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
}
.login-box h1 { font-size: 20px; text-align: center; margin: 0 0 20px 0; }
table.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
table.admin-table th, table.admin-table td {
    padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px;
}
table.admin-table th { background: #f8fafc; font-weight: 600; }
table.admin-table img.thumb-sm { width: 60px; height: 40px; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); }
