@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #f5f7fa; color: #111827; line-height: 1.5; min-height: 100vh; }

.header { background: #111827; padding: 0 24px; height: 56px; display: flex; align-items: center; position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: 1100px; width: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.header .brand { color: #fff; font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.header nav { display: flex; gap: 4px; }
.header nav a { color: #9ca3af; text-decoration: none; font-size: 0.875rem; font-weight: 500; padding: 6px 12px; border-radius: 6px; }
.header nav a:hover { color: #fff; background: #1f2937; }

.admin-nav { display: flex; justify-content: center; gap: 8px; padding: 12px 16px; background: #fff; border-bottom: 1px solid #e5e7eb; }
.admin-nav a { color: #6b7280; text-decoration: none; font-size: 0.875rem; font-weight: 600; padding: 6px 14px; border-radius: 6px; }
.admin-nav a:hover { color: #111827; background: #f3f4f6; }

.page { padding: 32px 16px; max-width: 620px; margin: 0 auto; }
.page.wide { max-width: 1000px; }
.page-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 24px; }

.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 24px; margin-bottom: 20px; }
.card-head { margin-bottom: 20px; }
.card-head h2 { font-size: 1.1rem; font-weight: 700; color: #111827; margin: 0; }
.card-head p { font-size: 0.85rem; color: #6b7280; margin-top: 2px; }

.menu-box { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px 20px; margin-bottom: 16px; }
.menu-box .label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7280; margin-bottom: 10px; }
.menu-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 0.95rem; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; font-weight: 600; color: #fff; }
.badge-first { background: #6366f1; }
.badge-second { background: #f59e0b; }
.no-menu { color: #9ca3af; font-size: 0.9rem; padding: 8px 0; }

.tabs { display: flex; background: #f3f4f6; border-radius: 10px; padding: 3px; margin-bottom: 20px; }
.tab { flex: 1; padding: 10px 8px; text-align: center; font-size: 0.875rem; font-weight: 600; border: none; border-radius: 8px; background: transparent; color: #6b7280; cursor: pointer; font-family: inherit; }
.tab:hover { color: #374151; background: #e5e7eb; }
.tab.active { background: #fff; color: #111827; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.tab:disabled { opacity: 0.35; cursor: not-allowed; }
.tab:disabled:hover { background: transparent; color: #6b7280; }
.panel { display: none; }
.panel.active { display: block; }

.form-stack { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 4px; text-align: left; }
.field label { font-size: 0.85rem; font-weight: 600; color: #374151; }
.field input[type="text"], .field input[type="date"], .field textarea, .field select { width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 0.95rem; font-family: inherit; background: #fff; color: #111827; }
.field input[type="text"]:focus, .field input[type="date"]:focus, .field textarea:focus, .field select:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99,102,241,0.12); }
.field textarea { min-height: 80px; resize: vertical; }

.choices { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.choice { flex: 1; min-width: 130px; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border: 2px solid #e5e7eb; border-radius: 10px; cursor: pointer; background: #fff; }
.choice:hover { border-color: #a5b4fc; background: #eef2ff; }
.choice input[type="checkbox"], .choice input[type="radio"] { width: 18px; height: 18px; accent-color: #6366f1; cursor: pointer; }
.choice .choice-label { font-size: 0.9rem; color: #374151; cursor: pointer; }
.choices.teal .choice:hover { border-color: #5eead4; background: #f0fdfa; }
.choices.teal .choice input[type="checkbox"] { accent-color: #14b8a6; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 10px 20px; font-size: 0.9rem; font-weight: 600; font-family: inherit; border: none; border-radius: 8px; cursor: pointer; text-decoration: none; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: #6366f1; color: #fff; }
.btn-primary:hover { background: #4f46e5; }
.btn-dark { background: #111827; color: #fff; }
.btn-dark:hover { background: #1f2937; }
.btn-green { background: #059669; color: #fff; }
.btn-green:hover { background: #047857; }
.btn-amber { background: #d97706; color: #fff; }
.btn-amber:hover { background: #b45309; }
.btn-red { background: #dc2626; color: #fff; }
.btn-red:hover { background: #b91c1c; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; }

.info-box { padding: 12px 16px; border-radius: 8px; font-size: 0.875rem; line-height: 1.5; margin-bottom: 12px; }
.info-box.blue { background: #eff6ff; color: #1e40af; border-left: 3px solid #3b82f6; }
.info-box.amber { background: #fffbeb; color: #92400e; border-left: 3px solid #f59e0b; }
.info-box.red { background: #fef2f2; color: #991b1b; border-left: 3px solid #ef4444; }
.info-box.green { background: #f0fdf4; color: #166534; border-left: 3px solid #22c55e; }

.msg { margin-top: 16px; padding: 12px 16px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; display: none; }
.msg.ok { display: block; background: #f0fdf4; color: #166534; border-left: 3px solid #22c55e; }
.msg.err { display: block; background: #fef2f2; color: #991b1b; border-left: 3px solid #ef4444; }

.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
table th { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: #6b7280; padding: 10px 12px; border-bottom: 2px solid #e5e7eb; background: #f9fafb; text-align: left; }
table td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; font-size: 0.9rem; text-align: left; }
table tbody tr:hover { background: #f9fafb; }
table input[type="text"] { border: 1px solid #e5e7eb; border-radius: 6px; padding: 6px 8px; font-size: 0.875rem; font-family: inherit; width: 100%; }
table input[type="text"]:focus { outline: none; border-color: #6366f1; }
table select { border: 1px solid #e5e7eb; border-radius: 6px; padding: 6px 8px; font-size: 0.875rem; font-family: inherit; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: #111827; }
.login-box { background: #fff; border-radius: 16px; padding: 40px 32px; max-width: 380px; width: 100%; text-align: center; }
.login-box h1 { font-size: 1.4rem; margin-bottom: 4px; }
.login-box .sub { color: #6b7280; font-size: 0.9rem; margin-bottom: 24px; }
.login-box form { text-align: left; }
.error-msg { margin-top: 16px; padding: 10px 12px; background: #fef2f2; color: #991b1b; border-radius: 8px; font-size: 0.85rem; font-weight: 500; text-align: center; }

.overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 200; display: none; align-items: center; justify-content: center; padding: 16px; }
.overlay.open { display: flex; }
.modal { background: #fff; border-radius: 14px; padding: 28px; max-width: 460px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.2); }
.modal h2 { font-size: 1.1rem; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); padding: 12px 20px; border-radius: 8px; font-weight: 600; font-size: 0.9rem; z-index: 9999; box-shadow: 0 4px 20px rgba(0,0,0,0.15); display: none; max-width: 90%; }
.toast.ok { background: #f0fdf4; color: #166534; border-left: 3px solid #22c55e; }
.toast.err { background: #fef2f2; color: #991b1b; border-left: 3px solid #ef4444; }

.row-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.row-form .field { flex: 1; min-width: 160px; }

@media (max-width: 640px) {
    .header { padding: 0 16px; height: auto; }
    .header-inner { flex-direction: column; gap: 6px; padding: 12px 0; }
    .header nav { gap: 2px; }
    .header nav a { font-size: 0.8rem; padding: 4px 8px; }
    .page { padding: 20px 12px; }
    .card { padding: 20px; }
    .page-title { font-size: 1.25rem; }
    .tabs { flex-direction: column; }
    .choices { flex-direction: column; }
    .choice { min-width: auto; }
    .row-form { flex-direction: column; }
    .row-form .field { min-width: auto; }
    .btn-full-m { width: 100%; }
    table { font-size: 0.8rem; }
    table th, table td { padding: 6px 8px; }
    .login-box { padding: 28px 20px; }
}
@media (max-width: 400px) { .btn-full { width: 100%; } }
