.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.925rem;
  padding: 11px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
  line-height: 1.2;
  min-height: 44px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #000;
  box-shadow: 0 4px 18px var(--accent-glow-soft);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
  box-shadow: var(--glow);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-outline:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.83rem;
  min-height: 36px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 15px 30px;
  font-size: 1.02rem;
  min-height: 52px;
}

.btn-block {
  width: 100%;
}

.btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.btn.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn.is-loading::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.25);
  border-top-color: #000;
  border-radius: 50%;
  animation: mcc-spin 0.7s linear infinite;
}

.btn.is-loading.btn-outline::after,
.btn.is-loading.btn-ghost::after {
  border-color: rgba(255, 255, 255, 0.2);
  border-top-color: var(--text);
}

.btn.is-loading.btn-danger::after {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}

@keyframes mcc-spin {
  to { transform: rotate(360deg); }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-2);
}

.field-required {
  color: var(--accent);
  margin-left: 2px;
}

.input,
.select,
.textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  min-height: 46px;
}

.textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.55;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-3);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.input.has-error,
.select.has-error,
.textarea.has-error {
  border-color: var(--danger);
}

.input.has-error:focus,
.select.has-error:focus,
.textarea.has-error:focus {
  box-shadow: 0 0 0 3px var(--danger-soft);
}

.input-wrap {
  position: relative;
}

.input-wrap .input {
  padding-right: 46px;
}

.input-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  transition: color var(--transition);
}

.input-toggle:hover {
  color: var(--accent);
}

.input-toggle svg {
  width: 19px;
  height: 19px;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.5;
}

.checkbox input {
  appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 2px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: all var(--transition);
  display: inline-grid;
  place-content: center;
}

.checkbox input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox input:checked::after {
  content: "";
  width: 10px;
  height: 10px;
  background: #000;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.checkbox input:focus-visible {
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}

.card-hover:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card-pad {
  padding: 22px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge-accent {
  background: var(--accent);
  color: #000;
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-2);
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-info {
  background: var(--info-soft);
  color: var(--info);
}

.badge-muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-3);
}

.badge-purple {
  background: rgba(167, 139, 250, 0.12);
  color: var(--purple);
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.alert {
  display: flex;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius);
  font-size: 0.89rem;
  border: 1px solid;
  align-items: flex-start;
  animation: mcc-fade-in 0.3s ease both;
}

.alert svg {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-error {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.alert-success {
  background: var(--success-soft);
  border-color: rgba(34, 197, 94, 0.25);
  color: #86efac;
}

.alert-info {
  background: var(--info-soft);
  border-color: rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
}

.alert-warning {
  background: var(--warning-soft);
  border-color: rgba(245, 158, 11, 0.25);
  color: #fcd34d;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: mcc-fade-in 0.25s ease both;
}

.modal {
  background: var(--card-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: mcc-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal-lg {
  max-width: 720px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-3);
  transition: all var(--transition);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.modal-close svg {
  width: 19px;
  height: 19px;
}

.modal-body {
  padding: 22px 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-footer:empty {
  display: none;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.table th {
  text-align: left;
  padding: 13px 18px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 15px 18px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
  white-space: nowrap;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  transition: background var(--transition);
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.table td strong {
  color: var(--text);
  font-weight: 600;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border-radius: var(--radius);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.045), transparent);
  background-size: 400px 100%;
  animation: mcc-shimmer 1.4s infinite;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 56px 24px;
  gap: 10px;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 6px;
}

.empty-state-icon svg {
  width: 30px;
  height: 30px;
}

.empty-state h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.empty-state p {
  color: var(--text-3);
  font-size: 0.9rem;
  max-width: 380px;
}

.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  width: calc(100% - 36px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card-2);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  animation: mcc-toast-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.toast.out {
  animation: mcc-toast-out 0.28s ease both;
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--info); }

.toast-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-success .toast-icon { background: var(--success-soft); color: var(--success); }
.toast-error .toast-icon { background: var(--danger-soft); color: var(--danger); }
.toast-warning .toast-icon { background: var(--warning-soft); color: var(--warning); }
.toast-info .toast-icon { background: var(--info-soft); color: var(--info); }

.toast-icon svg {
  width: 18px;
  height: 18px;
}

.toast-title {
  font-weight: 700;
  font-size: 0.9rem;
}

.toast-message {
  font-size: 0.84rem;
  color: var(--text-2);
  margin-top: 2px;
  word-break: break-word;
}

@keyframes mcc-toast-in {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes mcc-toast-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(24px); }
}

.avatar {
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #000;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm { width: 34px; height: 34px; font-size: 0.8rem; }
.avatar-md { width: 44px; height: 44px; font-size: 0.95rem; }
.avatar-lg { width: 88px; height: 88px; font-size: 1.6rem; }

.divider {
  height: 1px;
  background: var(--border);
  border: none;
  margin: 20px 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.link {
  color: var(--accent);
  font-weight: 600;
  transition: opacity var(--transition);
}

.link:hover {
  opacity: 0.8;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  box-shadow: var(--glow);
  flex-shrink: 0;
  overflow: hidden;
}

.logo-mark svg {
  width: 20px;
  height: 20px;
}

.logo-mark.img {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  box-shadow: none;
  padding: 4px;
}

.logo-mark.img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.logo-sub {
  color: var(--accent);
}

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-subtitle {
  color: var(--text-3);
  margin-top: 4px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 20px;
  background: var(--accent);
  border-radius: var(--radius-full);
  box-shadow: var(--glow);
}
