* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Segoe UI', sans-serif; background: #f0f2f5; color: #333; }

/* Login */
.login-wrap { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.login-box { background: #fff; padding: 40px; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.1); width: 380px; text-align: center; }
.login-box h1 { font-size: 22px; color: #1e3a5f; margin-bottom: 8px; }
.login-box p { color: #888; font-size: 14px; margin-bottom: 24px; }
.login-box input { width: 100%; padding: 12px 16px; border: 1px solid #ddd; border-radius: 8px; font-size: 15px; margin-bottom: 12px; outline: none; transition: border 0.2s; }
.login-box input:focus { border-color: #2563eb; }
.login-box button { width: 100%; padding: 12px; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { background: #93c5fd; cursor: not-allowed; }
.msg { margin-top: 12px; padding: 10px; border-radius: 6px; font-size: 13px; display: none; }
.msg.ok { display: block; background: #dcfce7; color: #166534; }
.msg.err { display: block; background: #fef2f2; color: #991b1b; }
.otp-input { font-size: 24px !important; letter-spacing: 8px; text-align: center; font-weight: bold; }

/* Panel */
.panel { display: none; }
.panel.active { display: block; }
.topbar { background: #1e3a5f; color: #fff; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; }
.topbar h2 { font-size: 18px; font-weight: 600; }
.topbar .user-info { display: flex; align-items: center; gap: 12px; }
.topbar .user-info span { font-size: 14px; opacity: 0.9; }
.btn-logout { background: rgba(255,255,255,0.15); border: none; color: #fff; padding: 6px 14px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.btn-logout:hover { background: rgba(255,255,255,0.25); }

.container { max-width: 1200px; margin: 20px auto; padding: 0 20px; }

/* Toolbar */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.search-box { flex: 1; min-width: 200px; padding: 10px 14px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; outline: none; }
.search-box:focus { border-color: #2563eb; }
.filter-btns { display: flex; gap: 6px; }
.filter-btns button { padding: 6px 14px; border: 1px solid #ddd; border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; }
.filter-btns button.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-add { background: #16a34a; color: #fff; border: none; padding: 10px 18px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn-add:hover { background: #15803d; }

/* Table */
.tablo-wrap { background: #fff; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { background: #f8fafc; padding: 12px 14px; text-align: left; font-size: 13px; color: #64748b; font-weight: 600; border-bottom: 2px solid #e2e8f0; white-space: nowrap; }
td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
tr:hover { background: #f8fafc; }
.badge { padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.badge-aktif { background: #dcfce7; color: #166534; }
.badge-pasif { background: #fef2f2; color: #991b1b; }

/* Action buttons */
.btn-sm { padding: 5px 10px; border: none; border-radius: 5px; font-size: 12px; cursor: pointer; font-weight: 500; }
.btn-login { background: #2563eb; color: #fff; }
.btn-login:hover { background: #1d4ed8; }
.btn-copy { background: #e2e8f0; color: #334155; }
.btn-copy:hover { background: #cbd5e1; }
.btn-edit { background: #f59e0b; color: #fff; }
.btn-edit:hover { background: #d97706; }
.actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* Modal */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 100; justify-content: center; align-items: center; }
.modal-overlay.active { display: flex; }
.modal { background: #fff; border-radius: 12px; padding: 28px; width: 440px; max-width: 95vw; }
.modal h3 { margin-bottom: 20px; color: #1e3a5f; }
.modal label { display: block; font-size: 13px; color: #64748b; margin-bottom: 4px; font-weight: 500; }
.modal input, .modal select { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; margin-bottom: 12px; outline: none; }
.modal input:focus, .modal select:focus { border-color: #2563eb; }
.modal-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.modal-btns button { padding: 10px 20px; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; font-weight: 500; }
.btn-cancel { background: #e2e8f0; color: #334155; }
.btn-save { background: #2563eb; color: #fff; }
.btn-save:hover { background: #1d4ed8; }

/* Toast */
.toast { position: fixed; bottom: 24px; right: 24px; padding: 12px 20px; border-radius: 8px; color: #fff; font-size: 14px; z-index: 200; opacity: 0; transition: opacity 0.3s; }
.toast.show { opacity: 1; }
.toast.ok { background: #16a34a; }
.toast.err { background: #dc2626; }

/* Responsive */
@media (max-width: 768px) {
  .login-box { width: 95vw; padding: 24px; }
  .container { padding: 0 10px; }
  .toolbar { flex-direction: column; }
  td, th { padding: 8px 10px; font-size: 13px; }
}
