* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f5f7fa; color: #333; }
.container { max-width: 1400px; margin: 0 auto; padding: 20px; }
.header { background: #1a56db; color: #fff; padding: 16px 24px; border-radius: 12px 12px 0 0; display: flex; align-items: center; justify-content: space-between; position: relative; }
.header h1 { font-size: 22px; font-weight: 600; }
.header-menu { display: none; position: absolute; top: 100%; left: 24px; min-width: 160px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 200; overflow: hidden; }
.header-menu.show { display: block; }
.header-menu-item { display: block; width: 100%; padding: 11px 18px; border: none; background: none; text-align: left; font-size: 14px; cursor: pointer; color: #333; transition: background .15s; }
.header-menu-item:hover { background: #f3f4f6; }
.header h1 { font-size: 22px; font-weight: 600; }
.toolbar { background: #fff; padding: 16px 24px; border-bottom: 1px solid #e5e7eb; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.toolbar input[type="text"] { flex: 1; min-width: 200px; padding: 8px 14px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; outline: none; transition: border-color .2s; }
.toolbar input[type="text"]:focus { border-color: #1a56db; box-shadow: 0 0 0 3px rgba(26,86,219,.15); }
.btn { padding: 8px 18px; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; transition: all .2s; white-space: nowrap; }
.btn-primary { background: #1a56db; color: #fff; }
.btn-primary:hover { background: #1648c0; }
.btn-success { background: #059669; color: #fff; }
.btn-success:hover { background: #047857; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-edit { background: #f59e0b; color: #fff; }
.btn-edit:hover { background: #d97706; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.card { background: #fff; border-radius: 0 0 12px 12px; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead { background: #f9fafb; position: sticky; top: 0; }
th { text-align: left; padding: 12px 16px; font-size: 13px; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid #e5e7eb; white-space: nowrap; }
td { padding: 10px 16px; font-size: 14px; border-bottom: 1px solid #f3f4f6; }
tr:hover td { background: #f9fafb; }
.actions { display: flex; gap: 6px; }
.empty { text-align: center; padding: 48px 16px; color: #9ca3af; }
.empty p { font-size: 15px; }
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); align-items: center; justify-content: center; z-index: 1000; }
.modal-overlay.active { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 520px; max-width: 94vw; max-height: 90vh; overflow-y: auto; padding: 28px; box-shadow: 0 20px 60px rgba(0,0,0,.15); }
.modal h2 { font-size: 20px; margin-bottom: 20px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; color: #374151; }
.form-group input, .form-group select { width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 14px; outline: none; transition: border-color .2s; }
.form-group input:focus, .form-group select:focus { border-color: #1a56db; box-shadow: 0 0 0 3px rgba(26,86,219,.15); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.btn-cancel { background: #e5e7eb; color: #374151; }
.btn-cancel:hover { background: #d1d5db; }
.stats { background: #fff; padding: 12px 24px; border-top: 1px solid #e5e7eb; font-size: 13px; color: #6b7280; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.gate-overlay { position: fixed; inset: 0; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); display: flex; align-items: center; justify-content: center; z-index: 9999; }
.gate-box { background: #fff; border-radius: 16px; padding: 36px 32px; width: 380px; max-width: 92vw; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.gate-box h2 { font-size: 22px; margin-bottom: 4px; text-align: center; }
.gate-hint { color: #6b7280; font-size: 14px; text-align: center; margin-bottom: 24px; }
@media (max-width: 768px) {
  .container { padding: 8px; }
  .header { flex-direction: row; gap: 4px; padding: 10px 12px; }
  .header-menu { left: 0; transform: none; }
  .header h1 { font-size: 17px; }
  .toolbar { flex-direction: column; padding: 10px 12px; }
  th, td { padding: 6px 6px; font-size: 12px; }
  table { min-width: 0; }
  .stats { flex-direction: column; text-align: center; gap: 4px; padding: 8px 12px; font-size: 12px; }
  .modal { width: 96vw; padding: 20px 14px; }
  .modal h2 { font-size: 17px; }
  .form-group label { font-size: 13px; }
}
@media (max-width: 480px) {
  th, td { padding: 5px 4px; font-size: 11px; }
  th { font-size: 10px; padding: 6px 4px; }
  .toolbar input[type="text"] { font-size: 16px; padding: 10px 10px; }
  .btn { font-size: 14px; min-height: 40px; padding: 10px 14px; }
}
