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

nav { background: #1a1a2e; color: #fff; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; }
.nav-brand { font-weight: 700; font-size: 16px; }
.nav-links a { color: #aaa; text-decoration: none; margin-left: 20px; font-size: 14px; }
.nav-links a:hover { color: #fff; }

main { max-width: 1100px; margin: 24px auto; padding: 0 16px; }

h1 { font-size: 22px; margin-bottom: 16px; }
.header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }

.card { background: #fff; border-radius: 8px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
th { background: #f8f9fa; text-align: left; padding: 10px 14px; font-size: 13px; color: #666; border-bottom: 1px solid #eee; }
td { padding: 10px 14px; font-size: 14px; border-bottom: 1px solid #f0f0f0; }
tr:hover { background: #fafbfc; }
.row-denied { background: #fff5f5; }

code { background: #f0f0f0; padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.key-preview { font-size: 12px; color: #888; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 12px; background: #e8e8e8; margin: 1px 2px; }
.badge-master { background: #d4edda; color: #155724; }
.badge-client { background: #d1ecf1; color: #0c5460; }
.badge-buyer { background: #fff3cd; color: #856404; }

.status-active { color: #28a745; font-weight: 600; font-size: 13px; }
.status-inactive { color: #dc3545; font-weight: 600; font-size: 13px; }
.text-muted { color: #999; }

button, .btn-primary, .btn-secondary, .btn-small, .btn-danger {
    cursor: pointer; border: none; border-radius: 6px; padding: 8px 16px; font-size: 14px;
}
.btn-primary { background: #007bff; color: #fff; }
.btn-primary:hover { background: #0056b3; }
.btn-secondary { background: #e8e8e8; color: #333; margin-left: 8px; }
.btn-small { padding: 4px 10px; font-size: 12px; background: #e8e8e8; margin-left: 4px; }
.btn-danger { background: #f8d7da; color: #721c24; }
.btn-danger:hover { background: #f5c6cb; }

.form-row { margin-bottom: 10px; display: flex; gap: 8px; }
.form-row input, .form-row select { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; flex: 1; }

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert.success { background: #d4edda; color: #155724; }
.alert.error { background: #f8d7da; color: #721c24; }

.accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; max-height: 320px; overflow-y: auto; padding: 4px; }
.account-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid #e0e0e0; border-radius: 6px; cursor: pointer; font-size: 13px; transition: all 0.15s; }
.account-item:hover { border-color: #007bff; background: #f0f7ff; }
.account-item.selected { border-color: #007bff; background: #e7f1ff; }
.account-item input[type="checkbox"] { margin: 0; }
.account-name { font-weight: 500; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-id { font-size: 11px; color: #999; }

.modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-content { width: 90%; max-width: 700px; max-height: 80vh; overflow-y: auto; }

.login-container { max-width: 360px; margin: 80px auto; text-align: center; }
.login-container h1 { margin-bottom: 20px; }
.login-container input { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 16px; margin-bottom: 12px; }
.login-container button { width: 100%; padding: 12px; }
