/**
 * Brutalist Design System - UI Components
 * Cards, Tables, Buttons, Forms, Badges, Alerts
 * Dark theme with lime green accents
 */

/* =============================================
   BUTTONS - Brutalist Style
   ============================================= */

.nordic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--nordic-space-2);
  font-family: var(--nordic-font-body);
  font-size: var(--nordic-text-sm);
  font-weight: var(--nordic-weight-semibold);
  letter-spacing: var(--nordic-tracking-wide);
  text-transform: uppercase;
  line-height: 1;
  padding: var(--nordic-space-3) var(--nordic-space-5);
  border-radius: 0;
  border: 1px solid var(--nordic-border-medium);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--nordic-duration-fast) var(--nordic-ease-default);
}

.nordic-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.nordic-btn svg {
  width: 16px;
  height: 16px;
}

/* Primary Button */
.nordic-btn--primary {
  background: var(--nordic-primary);
  color: var(--nordic-text-inverse);
  border-color: var(--nordic-primary);
}

.nordic-btn--primary:hover:not(:disabled) {
  background: var(--nordic-primary-light);
  border-color: var(--nordic-primary-light);
  box-shadow: var(--nordic-shadow-glow);
}

.nordic-btn--primary:active:not(:disabled) {
  background: var(--nordic-primary-dark);
}

/* Secondary Button */
.nordic-btn--secondary {
  background: var(--nordic-bg-surface);
  color: var(--nordic-text-primary);
  border: 1px solid var(--nordic-border-medium);
}

.nordic-btn--secondary:hover:not(:disabled) {
  border-color: var(--nordic-primary);
  color: var(--nordic-primary);
  background: var(--nordic-primary-subtle);
}

/* Ghost Button */
.nordic-btn--ghost {
  background: transparent;
  color: var(--nordic-text-secondary);
}

.nordic-btn--ghost:hover:not(:disabled) {
  background: var(--nordic-primary-subtle);
  color: var(--nordic-primary);
}

/* Accent Button */
.nordic-btn--accent {
  background: var(--nordic-accent);
  color: var(--nordic-text-inverse);
}

.nordic-btn--accent:hover:not(:disabled) {
  background: var(--nordic-accent-dark);
  transform: translateY(-1px);
  box-shadow: var(--nordic-shadow-md);
}

/* Danger Button */
.nordic-btn--danger {
  background: var(--nordic-error);
  color: var(--nordic-text-inverse);
}

.nordic-btn--danger:hover:not(:disabled) {
  background: var(--nordic-error-dark);
}

/* Button Sizes */
.nordic-btn--sm {
  padding: var(--nordic-space-2) var(--nordic-space-3);
  font-size: var(--nordic-text-xs);
}

.nordic-btn--lg {
  padding: var(--nordic-space-4) var(--nordic-space-6);
  font-size: var(--nordic-text-base);
}

/* Icon Button */
.nordic-btn--icon {
  width: 40px;
  height: 40px;
  padding: 0;
}

.nordic-btn--icon.nordic-btn--sm {
  width: 32px;
  height: 32px;
}

.nordic-btn--icon.nordic-btn--lg {
  width: 48px;
  height: 48px;
}

/* =============================================
   CARDS - Brutalist Style
   ============================================= */

.nordic-card {
  background: var(--nordic-bg-surface);
  border-radius: 0;
  border: 1px solid var(--nordic-border-light);
  box-shadow: none;
  overflow: hidden;
  transition: all var(--nordic-duration-normal) var(--nordic-ease-default);
}

.nordic-card--hoverable:hover {
  border-color: var(--nordic-primary);
  box-shadow: var(--nordic-shadow-glow);
}

.nordic-card--clickable {
  cursor: pointer;
}

.nordic-card__header {
  padding: var(--nordic-space-5) var(--nordic-space-6);
  border-bottom: 1px solid var(--nordic-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nordic-card__title {
  font-family: var(--nordic-font-body);
  font-size: var(--nordic-text-lg);
  font-weight: var(--nordic-weight-semibold);
  color: var(--nordic-text-primary);
  text-transform: uppercase;
  letter-spacing: var(--nordic-tracking-wide);
}

.nordic-card__subtitle {
  font-size: var(--nordic-text-sm);
  color: var(--nordic-text-muted);
  margin-top: var(--nordic-space-1);
}

.nordic-card__body {
  padding: var(--nordic-space-6);
}

.nordic-card__footer {
  padding: var(--nordic-space-4) var(--nordic-space-6);
  border-top: 1px solid var(--nordic-border-light);
  background: var(--nordic-bg-warm);
}

/* Card with accent left border on hover */
.nordic-card--accent-hover {
  position: relative;
  border-left: 3px solid transparent;
}

.nordic-card--accent-hover:hover {
  border-left-color: var(--nordic-primary);
}

/* =============================================
   EMPLOYEE CARD
   ============================================= */

.nordic-employee-card {
  background: var(--nordic-bg-surface);
  border-radius: var(--nordic-radius-2xl);
  border: 1px solid var(--nordic-border-light);
  box-shadow: var(--nordic-shadow-sm);
  overflow: hidden;
  transition: all var(--nordic-duration-normal) var(--nordic-ease-default);
  position: relative;
}

.nordic-employee-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--nordic-primary), var(--nordic-primary-light));
  opacity: 0;
  transition: opacity var(--nordic-duration-normal);
}

.nordic-employee-card:hover {
  box-shadow: var(--nordic-shadow-lg);
  transform: translateY(-4px);
  border-color: transparent;
}

.nordic-employee-card:hover::before {
  opacity: 1;
}

.nordic-employee-card__photo-section {
  position: relative;
  padding-top: 80%;
  background: var(--nordic-bg-warm);
  overflow: hidden;
}

.nordic-employee-card__photo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--nordic-duration-slow) var(--nordic-ease-default);
}

.nordic-employee-card:hover .nordic-employee-card__photo {
  transform: scale(1.05);
}

.nordic-employee-card__status {
  position: absolute;
  top: var(--nordic-space-3);
  left: var(--nordic-space-3);
  background: var(--nordic-glass-bg-light);
  backdrop-filter: var(--nordic-glass-blur);
  padding: var(--nordic-space-1) var(--nordic-space-3);
  border-radius: var(--nordic-radius-full);
  font-size: var(--nordic-text-xs);
  font-weight: var(--nordic-weight-medium);
}

.nordic-employee-card__status--online { color: var(--nordic-success); }
.nordic-employee-card__status--absent { color: var(--nordic-warning-dark); }
.nordic-employee-card__status--away { color: var(--nordic-error); }

.nordic-employee-card__content {
  padding: var(--nordic-space-5);
}

.nordic-employee-card__name {
  font-family: var(--nordic-font-body);
  font-size: var(--nordic-text-lg);
  font-weight: var(--nordic-weight-semibold);
  color: var(--nordic-text-primary);
  margin-bottom: var(--nordic-space-1);
}

.nordic-employee-card__position {
  font-size: var(--nordic-text-sm);
  color: var(--nordic-primary);
  margin-bottom: var(--nordic-space-1);
}

.nordic-employee-card__unit {
  font-size: var(--nordic-text-xs);
  color: var(--nordic-text-muted);
}

.nordic-employee-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--nordic-space-3) var(--nordic-space-5);
  border-top: 1px solid var(--nordic-border-light);
  background: var(--nordic-bg-warm);
}

.nordic-employee-card__rating {
  display: flex;
  align-items: center;
  gap: var(--nordic-space-1);
  font-size: var(--nordic-text-sm);
  font-weight: var(--nordic-weight-medium);
  color: var(--nordic-text-primary);
}

.nordic-employee-card__rating svg {
  width: 14px;
  height: 14px;
  fill: var(--nordic-accent);
}

/* =============================================
   TABLES - Brutalist Terminal Style
   ============================================= */

.nordic-table-container {
  background: var(--nordic-bg-surface);
  border-radius: 0;
  border: 1px solid var(--nordic-border-medium);
  overflow: hidden;
}

.nordic-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--nordic-font-mono);
}

.nordic-table thead {
  background: var(--nordic-bg-elevated);
}

.nordic-table th {
  padding: var(--nordic-space-4) var(--nordic-space-5);
  text-align: left;
  font-size: var(--nordic-text-xs);
  font-weight: var(--nordic-weight-semibold);
  color: var(--nordic-primary);
  text-transform: uppercase;
  letter-spacing: var(--nordic-tracking-widest);
  border-bottom: 2px solid var(--nordic-primary);
  white-space: nowrap;
}

.nordic-table th--sortable {
  cursor: pointer;
  user-select: none;
  transition: color var(--nordic-duration-fast);
}

.nordic-table th--sortable:hover {
  color: var(--nordic-primary);
}

.nordic-table th--sorted {
  color: var(--nordic-primary);
}

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

.nordic-table tbody tr:hover {
  background: var(--nordic-primary-subtle);
}

.nordic-table td {
  padding: var(--nordic-space-4) var(--nordic-space-5);
  border-bottom: 1px solid var(--nordic-border-light);
  font-size: var(--nordic-text-sm);
  color: var(--nordic-text-primary);
  vertical-align: middle;
}

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

/* Table Cell Variants */
.nordic-table__cell--employee {
  display: flex;
  align-items: center;
  gap: var(--nordic-space-3);
}

.nordic-table__avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--nordic-radius-md);
  object-fit: cover;
}

.nordic-table__actions {
  display: flex;
  gap: var(--nordic-space-2);
  justify-content: flex-end;
}

.nordic-table__action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--nordic-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nordic-text-muted);
  transition: all var(--nordic-duration-fast);
}

.nordic-table__action-btn:hover {
  background: var(--nordic-primary-subtle);
  color: var(--nordic-primary);
}

.nordic-table__action-btn svg {
  width: 16px;
  height: 16px;
}

/* =============================================
   FORMS - Brutalist Dark Style
   ============================================= */

/* Form Group */
.nordic-form-group {
  margin-bottom: var(--nordic-space-6);
}

.nordic-form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--nordic-space-4);
}

@media (max-width: 640px) {
  .nordic-form-row {
    grid-template-columns: 1fr;
  }
}

/* Label */
.nordic-label {
  display: block;
  font-size: var(--nordic-text-xs);
  font-weight: var(--nordic-weight-semibold);
  color: var(--nordic-text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--nordic-tracking-wider);
  margin-bottom: var(--nordic-space-2);
}

.nordic-label--required::after {
  content: ' *';
  color: var(--nordic-error);
}

/* Input */
.nordic-input {
  width: 100%;
  padding: var(--nordic-space-3) var(--nordic-space-4);
  font-family: var(--nordic-font-mono);
  font-size: var(--nordic-text-base);
  color: var(--nordic-text-primary);
  background: var(--nordic-bg-elevated);
  border: 1px solid var(--nordic-border-medium);
  border-radius: 0;
  transition: all var(--nordic-duration-fast) var(--nordic-ease-default);
}

.nordic-input::placeholder {
  color: var(--nordic-text-muted);
}

.nordic-input:hover {
  border-color: var(--nordic-border-strong);
}

.nordic-input:focus {
  outline: none;
  border-color: var(--nordic-primary);
  box-shadow: var(--nordic-shadow-focus);
  background: var(--nordic-bg-surface);
}

.nordic-input--error {
  border-color: var(--nordic-error);
}

.nordic-input--error:focus {
  box-shadow: var(--nordic-shadow-focus-error);
}

/* Textarea */
.nordic-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Select */
.nordic-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%238A8A8A'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--nordic-space-4) center;
  padding-right: var(--nordic-space-10);
  cursor: pointer;
}

/* Checkbox */
.nordic-checkbox {
  display: flex;
  align-items: center;
  gap: var(--nordic-space-3);
  cursor: pointer;
}

.nordic-checkbox__input {
  width: 20px;
  height: 20px;
  border: 2px solid var(--nordic-border-medium);
  border-radius: var(--nordic-radius-sm);
  appearance: none;
  cursor: pointer;
  transition: all var(--nordic-duration-fast);
  position: relative;
  flex-shrink: 0;
}

.nordic-checkbox__input:checked {
  background: var(--nordic-primary);
  border-color: var(--nordic-primary);
}

.nordic-checkbox__input:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.nordic-checkbox__input:focus {
  box-shadow: var(--nordic-shadow-focus);
}

.nordic-checkbox__label {
  font-size: var(--nordic-text-sm);
  color: var(--nordic-text-primary);
}

/* Radio */
.nordic-radio {
  display: flex;
  align-items: center;
  gap: var(--nordic-space-3);
  cursor: pointer;
}

.nordic-radio__input {
  width: 20px;
  height: 20px;
  border: 2px solid var(--nordic-border-medium);
  border-radius: var(--nordic-radius-full);
  appearance: none;
  cursor: pointer;
  transition: all var(--nordic-duration-fast);
  position: relative;
  flex-shrink: 0;
}

.nordic-radio__input:checked {
  border-color: var(--nordic-primary);
}

.nordic-radio__input:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: var(--nordic-primary);
  border-radius: var(--nordic-radius-full);
}

/* Help & Error Text */
.nordic-help-text {
  margin-top: var(--nordic-space-2);
  font-size: var(--nordic-text-xs);
  color: var(--nordic-text-muted);
}

.nordic-error-text {
  margin-top: var(--nordic-space-2);
  font-size: var(--nordic-text-xs);
  color: var(--nordic-error);
  display: flex;
  align-items: center;
  gap: var(--nordic-space-1);
}

/* =============================================
   GLOBAL FORM OVERRIDES - Brutalist Terminal Style
   For native HTML elements and Bootstrap forms
   ============================================= */

/* Base input/select/textarea styles */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="month"],
input[type="week"],
select,
textarea,
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--nordic-font-mono);
  font-size: 0.875rem;
  color: var(--nordic-text-primary);
  background-color: var(--nordic-bg-surface);
  border: 1px solid var(--nordic-border-light);
  border-radius: 0;
  transition: all 0.15s ease;
  outline: none;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="tel"]:hover,
input[type="url"]:hover,
input[type="search"]:hover,
input[type="date"]:hover,
input[type="datetime-local"]:hover,
input[type="time"]:hover,
input[type="month"]:hover,
input[type="week"]:hover,
select:hover,
textarea:hover,
.form-control:hover {
  border-color: var(--nordic-border-medium);
  background-color: var(--nordic-bg-elevated);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="time"]:focus,
input[type="month"]:focus,
input[type="week"]:focus,
select:focus,
textarea:focus,
.form-control:focus {
  border-color: var(--nordic-primary);
  background-color: var(--nordic-bg-elevated);
  box-shadow: 0 0 0 1px var(--nordic-primary);
}

input::placeholder,
textarea::placeholder,
.form-control::placeholder {
  color: var(--nordic-text-muted);
}

/* Select arrow styling */
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23BFFF00'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

/* Select options */
select option {
  background-color: var(--nordic-bg-elevated);
  color: var(--nordic-text-primary);
  padding: 0.5rem;
}

/* Textarea */
textarea {
  min-height: 100px;
  resize: vertical;
}

/* Labels */
label,
.form-label,
.control-label {
  display: block;
  font-family: var(--nordic-font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--nordic-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

/* Bootstrap form-group */
.form-group,
.control-group {
  margin-bottom: 1.5rem;
}

/* Submit buttons */
input[type="submit"],
button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--nordic-font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--nordic-text-inverse);
  background-color: var(--nordic-primary);
  border: 1px solid var(--nordic-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

input[type="submit"]:hover,
button[type="submit"]:hover {
  background-color: var(--nordic-primary-dark);
  border-color: var(--nordic-primary-dark);
}

/* =============================================
   BOOTSTRAP BUTTON OVERRIDES - Brutalist Style
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  font-family: var(--nordic-font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
  border-radius: 0;
  border: 1px solid;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.6875rem;
}

.btn-lg {
  padding: 0.875rem 1.5rem;
  font-size: 0.875rem;
}

/* Primary Button - Lime Green */
.btn-primary {
  color: var(--nordic-text-inverse);
  background-color: var(--nordic-primary);
  border-color: var(--nordic-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  color: var(--nordic-text-inverse);
  background-color: var(--nordic-primary-dark);
  border-color: var(--nordic-primary-dark);
  box-shadow: 0 0 0 2px var(--nordic-primary-subtle);
}

.btn-primary:active {
  background-color: var(--nordic-primary-dark);
  border-color: var(--nordic-primary-dark);
}

/* Secondary Button - Outlined */
.btn-secondary,
.btn-default {
  color: var(--nordic-text-primary);
  background-color: transparent;
  border-color: var(--nordic-border-light);
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-default:hover,
.btn-default:focus {
  color: var(--nordic-text-primary);
  background-color: var(--nordic-bg-surface-hover);
  border-color: var(--nordic-text-primary);
}

/* Outline Primary */
.btn-outline-primary {
  color: var(--nordic-primary);
  background-color: transparent;
  border-color: var(--nordic-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  color: var(--nordic-text-inverse);
  background-color: var(--nordic-primary);
  border-color: var(--nordic-primary);
}

/* Danger Button */
.btn-danger {
  color: var(--nordic-text-primary);
  background-color: var(--nordic-error);
  border-color: var(--nordic-error);
}

.btn-danger:hover,
.btn-danger:focus {
  background-color: var(--nordic-error-dark);
  border-color: var(--nordic-error-dark);
}

/* Success Button */
.btn-success {
  color: var(--nordic-text-inverse);
  background-color: var(--nordic-success);
  border-color: var(--nordic-success);
}

.btn-success:hover,
.btn-success:focus {
  background-color: var(--nordic-success-dark);
  border-color: var(--nordic-success-dark);
}

/* Warning Button */
.btn-warning {
  color: var(--nordic-text-inverse);
  background-color: var(--nordic-warning);
  border-color: var(--nordic-warning);
}

.btn-warning:hover,
.btn-warning:focus {
  background-color: var(--nordic-warning-dark);
  border-color: var(--nordic-warning-dark);
}

/* Info Button */
.btn-info {
  color: var(--nordic-text-inverse);
  background-color: var(--nordic-info);
  border-color: var(--nordic-info);
}

.btn-info:hover,
.btn-info:focus {
  background-color: var(--nordic-info-light);
  border-color: var(--nordic-info-light);
}

/* Link Button */
.btn-link {
  color: var(--nordic-primary);
  background-color: transparent;
  border-color: transparent;
  text-decoration: none;
}

.btn-link:hover,
.btn-link:focus {
  color: var(--nordic-primary-light);
  text-decoration: underline;
}

/* Disabled state */
.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Crispy forms overrides */
.asteriskField {
  color: var(--nordic-error);
}

.textinput,
.dateinput,
.emailinput,
.numberinput,
.textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--nordic-font-mono);
  font-size: 0.875rem;
  color: var(--nordic-text-primary);
  background-color: var(--nordic-bg-surface);
  border: 1px solid var(--nordic-border-light);
  border-radius: 0;
}

.textinput:focus,
.dateinput:focus,
.emailinput:focus,
.numberinput:focus,
.textarea:focus {
  border-color: var(--nordic-primary);
  box-shadow: 0 0 0 1px var(--nordic-primary);
  outline: none;
}

/* Help text */
.help-block,
.form-text {
  font-family: var(--nordic-font-mono);
  font-size: 0.6875rem;
  color: var(--nordic-text-muted);
  margin-top: 0.25rem;
}

/* Error states */
.has-error .form-control,
.is-invalid,
input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: var(--nordic-error);
}

.has-error .form-control:focus,
.is-invalid:focus {
  border-color: var(--nordic-error);
  box-shadow: 0 0 0 1px var(--nordic-error);
}

.invalid-feedback,
.has-error .help-block {
  color: var(--nordic-error);
  font-size: 0.6875rem;
}

/* Disabled state */
input:disabled,
select:disabled,
textarea:disabled,
.form-control:disabled {
  background-color: var(--nordic-bg-elevated);
  color: var(--nordic-text-muted);
  border-color: var(--nordic-border-light);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Read-only state */
input:read-only,
textarea:read-only {
  background-color: var(--nordic-bg-elevated);
  color: var(--nordic-text-secondary);
}

/* =============================================
   BADGES - Brutalist Square Style
   ============================================= */

.nordic-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--nordic-space-1);
  padding: var(--nordic-space-1) var(--nordic-space-3);
  font-size: var(--nordic-text-xs);
  font-weight: var(--nordic-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--nordic-tracking-wide);
  border-radius: 0;
  white-space: nowrap;
}

.nordic-badge--primary {
  background: var(--nordic-primary-subtle);
  color: var(--nordic-primary);
}

.nordic-badge--accent {
  background: var(--nordic-accent-subtle);
  color: var(--nordic-accent-dark);
}

.nordic-badge--success {
  background: var(--nordic-success-bg);
  color: var(--nordic-success-dark);
}

.nordic-badge--warning {
  background: var(--nordic-warning-bg);
  color: var(--nordic-warning-dark);
}

.nordic-badge--error {
  background: var(--nordic-error-bg);
  color: var(--nordic-error);
}

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

.nordic-badge--neutral {
  background: var(--nordic-bg-warm);
  color: var(--nordic-text-secondary);
}

/* =============================================
   ALERTS
   ============================================= */

.nordic-alert {
  display: flex;
  gap: var(--nordic-space-3);
  padding: var(--nordic-space-4);
  border-radius: var(--nordic-radius-lg);
  font-size: var(--nordic-text-sm);
}

.nordic-alert__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nordic-alert__content {
  flex: 1;
}

.nordic-alert__title {
  font-weight: var(--nordic-weight-semibold);
  margin-bottom: var(--nordic-space-1);
}

.nordic-alert__close {
  width: 20px;
  height: 20px;
  border-radius: var(--nordic-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
  transition: opacity var(--nordic-duration-fast);
}

.nordic-alert__close:hover {
  opacity: 1;
}

.nordic-alert--info {
  background: var(--nordic-info-bg);
  color: var(--nordic-info);
  border: 1px solid rgba(74, 144, 164, 0.2);
}

.nordic-alert--success {
  background: var(--nordic-success-bg);
  color: var(--nordic-success-dark);
  border: 1px solid rgba(129, 178, 154, 0.2);
}

.nordic-alert--warning {
  background: var(--nordic-warning-bg);
  color: var(--nordic-warning-dark);
  border: 1px solid rgba(242, 204, 143, 0.3);
}

.nordic-alert--error {
  background: var(--nordic-error-bg);
  color: var(--nordic-error);
  border: 1px solid rgba(230, 57, 70, 0.2);
}

/* =============================================
   AVATAR
   ============================================= */

.nordic-avatar {
  position: relative;
  display: inline-flex;
  border-radius: var(--nordic-radius-full);
  overflow: hidden;
  flex-shrink: 0;
}

.nordic-avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nordic-avatar__fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nordic-primary-subtle);
  color: var(--nordic-primary);
  font-weight: var(--nordic-weight-semibold);
}

.nordic-avatar--xs { width: 24px; height: 24px; font-size: var(--nordic-text-xs); }
.nordic-avatar--sm { width: 32px; height: 32px; font-size: var(--nordic-text-xs); }
.nordic-avatar--md { width: 40px; height: 40px; font-size: var(--nordic-text-sm); }
.nordic-avatar--lg { width: 56px; height: 56px; font-size: var(--nordic-text-base); }
.nordic-avatar--xl { width: 80px; height: 80px; font-size: var(--nordic-text-lg); }
.nordic-avatar--2xl { width: 120px; height: 120px; font-size: var(--nordic-text-2xl); }

/* Avatar Status Indicator */
.nordic-avatar__status {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 25%;
  height: 25%;
  min-width: 8px;
  min-height: 8px;
  border-radius: var(--nordic-radius-full);
  border: 2px solid var(--nordic-bg-surface);
}

.nordic-avatar__status--online { background: var(--nordic-success); }
.nordic-avatar__status--away { background: var(--nordic-warning); }
.nordic-avatar__status--offline { background: var(--nordic-text-muted); }
.nordic-avatar__status--busy { background: var(--nordic-error); }

/* =============================================
   STAT CARDS
   ============================================= */

.nordic-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--nordic-space-4);
}

.nordic-stat-card {
  background: var(--nordic-bg-surface);
  border-radius: var(--nordic-radius-xl);
  border: 1px solid var(--nordic-border-light);
  padding: var(--nordic-space-5);
  transition: all var(--nordic-duration-fast);
}

.nordic-stat-card:hover {
  box-shadow: var(--nordic-shadow-md);
  transform: translateY(-2px);
}

.nordic-stat-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--nordic-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--nordic-space-4);
}

.nordic-stat-card__icon--primary {
  background: var(--nordic-primary-subtle);
  color: var(--nordic-primary);
}

.nordic-stat-card__icon--accent {
  background: var(--nordic-accent-subtle);
  color: var(--nordic-accent);
}

.nordic-stat-card__icon--success {
  background: var(--nordic-success-bg);
  color: var(--nordic-success);
}

.nordic-stat-card__value {
  font-family: var(--nordic-font-display);
  font-size: var(--nordic-text-3xl);
  color: var(--nordic-text-primary);
  line-height: var(--nordic-leading-tight);
}

.nordic-stat-card__label {
  font-size: var(--nordic-text-sm);
  color: var(--nordic-text-muted);
  margin-top: var(--nordic-space-1);
}

.nordic-stat-card__trend {
  display: flex;
  align-items: center;
  gap: var(--nordic-space-1);
  font-size: var(--nordic-text-xs);
  font-weight: var(--nordic-weight-medium);
  margin-top: var(--nordic-space-2);
}

.nordic-stat-card__trend--up { color: var(--nordic-success); }
.nordic-stat-card__trend--down { color: var(--nordic-error); }

/* =============================================
   MODAL & PANEL
   ============================================= */

/* Modal Backdrop */
.nordic-modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--nordic-bg-overlay);
  z-index: var(--nordic-z-modal-backdrop);
  opacity: 0;
  transition: opacity var(--nordic-duration-normal);
}

.nordic-modal-backdrop--visible {
  opacity: 1;
}

/* Modal */
.nordic-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: var(--nordic-z-modal);
  background: var(--nordic-bg-surface);
  border-radius: var(--nordic-radius-2xl);
  box-shadow: var(--nordic-shadow-2xl);
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  opacity: 0;
  transition: all var(--nordic-duration-normal) var(--nordic-ease-out);
}

.nordic-modal--visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.nordic-modal__header {
  padding: var(--nordic-space-6);
  border-bottom: 1px solid var(--nordic-border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nordic-modal__title {
  font-family: var(--nordic-font-display);
  font-size: var(--nordic-text-xl);
  color: var(--nordic-text-primary);
}

.nordic-modal__close {
  width: 36px;
  height: 36px;
  border-radius: var(--nordic-radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nordic-text-muted);
  transition: all var(--nordic-duration-fast);
}

.nordic-modal__close:hover {
  background: var(--nordic-bg-warm);
  color: var(--nordic-text-primary);
}

.nordic-modal__body {
  padding: var(--nordic-space-6);
  overflow-y: auto;
  max-height: calc(90vh - 180px);
}

.nordic-modal__footer {
  padding: var(--nordic-space-4) var(--nordic-space-6);
  border-top: 1px solid var(--nordic-border-light);
  display: flex;
  justify-content: flex-end;
  gap: var(--nordic-space-3);
}

/* Slide-in Panel */
.nordic-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 400px;
  max-width: 100vw;
  background: var(--nordic-bg-surface);
  box-shadow: var(--nordic-shadow-2xl);
  z-index: var(--nordic-z-modal);
  transform: translateX(100%);
  transition: transform var(--nordic-duration-normal) var(--nordic-ease-out);
  display: flex;
  flex-direction: column;
}

.nordic-panel--visible {
  transform: translateX(0);
}

/* =============================================
   TABS
   ============================================= */

.nordic-tabs {
  background: var(--nordic-bg-surface);
  border-radius: var(--nordic-radius-2xl);
  overflow: hidden;
}

.nordic-tabs__nav {
  display: flex;
  background: var(--nordic-bg-warm);
  border-bottom: 1px solid var(--nordic-border-light);
  padding: 0 var(--nordic-space-4);
  overflow-x: auto;
}

.nordic-tabs__btn {
  position: relative;
  padding: var(--nordic-space-4) var(--nordic-space-5);
  font-size: var(--nordic-text-sm);
  font-weight: var(--nordic-weight-medium);
  color: var(--nordic-text-muted);
  white-space: nowrap;
  transition: color var(--nordic-duration-fast);
}

.nordic-tabs__btn:hover {
  color: var(--nordic-text-primary);
}

.nordic-tabs__btn--active {
  color: var(--nordic-primary);
}

.nordic-tabs__btn--active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: var(--nordic-space-4);
  right: var(--nordic-space-4);
  height: 3px;
  background: var(--nordic-primary);
  border-radius: var(--nordic-radius-full) var(--nordic-radius-full) 0 0;
}

.nordic-tabs__content {
  padding: var(--nordic-space-6);
}

.nordic-tabs__panel {
  display: none;
}

.nordic-tabs__panel--active {
  display: block;
}

/* =============================================
   TOOLTIP
   ============================================= */

.nordic-tooltip {
  position: relative;
}

.nordic-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  padding: var(--nordic-space-2) var(--nordic-space-3);
  background: var(--nordic-text-primary);
  color: var(--nordic-text-inverse);
  font-size: var(--nordic-text-xs);
  white-space: nowrap;
  border-radius: var(--nordic-radius-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--nordic-duration-fast);
  z-index: var(--nordic-z-tooltip);
  pointer-events: none;
}

.nordic-tooltip:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-8px);
}

/* =============================================
   EMPTY STATE
   ============================================= */

.nordic-empty-state {
  text-align: center;
  padding: var(--nordic-space-12) var(--nordic-space-6);
}

.nordic-empty-state__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--nordic-space-5);
  color: var(--nordic-text-muted);
  opacity: 0.5;
}

.nordic-empty-state__title {
  font-size: var(--nordic-text-lg);
  font-weight: var(--nordic-weight-semibold);
  color: var(--nordic-text-primary);
  margin-bottom: var(--nordic-space-2);
}

.nordic-empty-state__description {
  font-size: var(--nordic-text-sm);
  color: var(--nordic-text-muted);
  max-width: 360px;
  margin: 0 auto var(--nordic-space-5);
}

/* =============================================
   VIEW TOGGLE (Grid/List)
   ============================================= */

.nordic-view-toggle {
  display: flex;
  background: var(--nordic-bg-warm);
  border-radius: var(--nordic-radius-lg);
  padding: 4px;
}

.nordic-view-toggle__btn {
  padding: var(--nordic-space-2);
  border-radius: var(--nordic-radius-md);
  color: var(--nordic-text-muted);
  transition: all var(--nordic-duration-fast);
}

.nordic-view-toggle__btn:hover {
  color: var(--nordic-text-primary);
}

.nordic-view-toggle__btn--active {
  background: var(--nordic-bg-surface);
  color: var(--nordic-primary);
  box-shadow: var(--nordic-shadow-sm);
}

.nordic-view-toggle__btn svg {
  width: 20px;
  height: 20px;
}


/* =============================================
   DROPDOWN MENU
   ============================================= */

.nordic-unit-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: var(--nordic-space-4);
}

.nordic-dropdown {
  position: relative;
  display: inline-block;
}

.nordic-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--nordic-space-2);
  padding: var(--nordic-space-3) var(--nordic-space-4);
  font-family: var(--nordic-font-body);
  font-size: var(--nordic-text-sm);
  font-weight: 500;
  color: var(--nordic-text-primary);
  background: var(--nordic-bg-surface);
  border: 1px solid var(--nordic-border-medium);
  border-radius: var(--nordic-radius-lg);
  cursor: pointer;
  transition: all var(--nordic-duration-fast) var(--nordic-ease-default);
}

.nordic-dropdown-toggle:hover {
  border-color: var(--nordic-primary);
  box-shadow: var(--nordic-shadow-sm);
}

.nordic-dropdown-toggle svg {
  color: var(--nordic-text-muted);
}

.nordic-dropdown-arrow {
  transition: transform var(--nordic-duration-fast);
}

.nordic-dropdown.open .nordic-dropdown-arrow {
  transform: rotate(180deg);
}

.nordic-dropdown.open .nordic-dropdown-toggle {
  border-color: var(--nordic-primary);
  box-shadow: var(--nordic-shadow-focus);
}

.nordic-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--nordic-bg-surface);
  border: 1px solid var(--nordic-border-light);
  border-radius: var(--nordic-radius-xl);
  box-shadow: var(--nordic-shadow-xl);
  padding: var(--nordic-space-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--nordic-duration-fast) var(--nordic-ease-default);
  z-index: 1000;
}

.nordic-dropdown.open .nordic-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nordic-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--nordic-space-3);
  padding: var(--nordic-space-3) var(--nordic-space-4);
  font-family: var(--nordic-font-body);
  font-size: var(--nordic-text-sm);
  color: var(--nordic-text-primary);
  text-decoration: none;
  border-radius: var(--nordic-radius-md);
  transition: all var(--nordic-duration-fast);
}

.nordic-dropdown-item:hover {
  background: var(--nordic-primary-subtle);
  color: var(--nordic-primary);
}

.nordic-dropdown-item svg {
  color: var(--nordic-text-muted);
  flex-shrink: 0;
}

.nordic-dropdown-item:hover svg {
  color: var(--nordic-primary);
}

.nordic-dropdown-divider {
  height: 1px;
  background: var(--nordic-border-light);
  margin: var(--nordic-space-2) 0;
}

/* Close dropdown when clicking outside */
.nordic-dropdown-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
}


/* =============================================
   NOTIFICATIONS PANEL
   ============================================= */

.nordic-notifications-panel {
  background: linear-gradient(135deg, var(--nordic-primary) 0%, var(--nordic-primary-dark) 100%);
  border-radius: var(--nordic-radius-xl);
  margin-bottom: var(--nordic-space-6);
  overflow: hidden;
  transition: all var(--nordic-duration-normal) var(--nordic-ease-default);
}

.nordic-notifications-panel.collapsed {
  max-height: 0;
  margin-bottom: 0;
  opacity: 0;
  pointer-events: none;
}

.nordic-notifications-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--nordic-space-4) var(--nordic-space-5);
  color: var(--nordic-text-inverse);
}

.nordic-notifications-panel__title {
  display: flex;
  align-items: center;
  gap: var(--nordic-space-3);
  font-family: var(--nordic-font-body);
  font-weight: 600;
  font-size: var(--nordic-text-base);
}

.nordic-notifications-panel__title svg {
  opacity: 0.9;
}

.nordic-notifications-panel__count {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: var(--nordic-radius-full);
  font-size: var(--nordic-text-xs);
  font-weight: 600;
}

.nordic-notifications-panel__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: var(--nordic-radius-md);
  color: var(--nordic-text-inverse);
  cursor: pointer;
  transition: all var(--nordic-duration-fast);
}

.nordic-notifications-panel__close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.nordic-notifications-panel__body {
  padding: 0 var(--nordic-space-5) var(--nordic-space-5);
  display: flex;
  flex-direction: column;
  gap: var(--nordic-space-3);
}

.nordic-notification-item {
  display: flex;
  align-items: flex-start;
  gap: var(--nordic-space-3);
  background: rgba(255, 255, 255, 0.95);
  padding: var(--nordic-space-4);
  border-radius: var(--nordic-radius-lg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nordic-notification-item__icon {
  flex-shrink: 0;
  color: var(--nordic-primary);
  margin-top: 2px;
}

.nordic-notification-item__content {
  flex: 1;
  font-size: var(--nordic-text-sm);
  color: var(--nordic-text-primary);
  line-height: 1.5;
}

.nordic-notification-item__content a {
  color: var(--nordic-primary);
  font-weight: 500;
}

.nordic-notification-item__content a:hover {
  text-decoration: underline;
}

/* Bell button active state when panel is collapsed */
.nordic-header__icon-btn.has-hidden-notifications {
  background: var(--nordic-accent);
  color: var(--nordic-text-inverse);
}

.nordic-header__icon-btn.has-hidden-notifications:hover {
  background: var(--nordic-accent-dark);
}

.nordic-header__icon-btn.has-hidden-notifications .nordic-badge-dot {
  background: var(--nordic-text-inverse);
}


/* =============================================
   BOOTSTRAP TABLE OVERRIDES (Dark Theme)
   ============================================= */

/* Base table */
.table {
  color: var(--nordic-text-primary);
  background-color: var(--nordic-bg-surface);
  border-color: var(--nordic-border-medium);
  font-family: var(--nordic-font-mono);
}

/* Table headers */
.table th,
.table thead th {
  background-color: var(--nordic-bg-elevated);
  color: var(--nordic-primary);
  border-color: var(--nordic-border-medium);
  border-bottom: 2px solid var(--nordic-primary);
  font-weight: var(--nordic-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--nordic-tracking-wide);
  font-size: var(--nordic-text-xs);
}

/* Table cells */
.table td {
  border-color: var(--nordic-border-light);
  color: var(--nordic-text-primary);
  vertical-align: middle;
}

/* Bordered table */
.table-bordered {
  border: 1px solid var(--nordic-border-medium);
}

.table-bordered th,
.table-bordered td {
  border: 1px solid var(--nordic-border-light);
}

/* Striped table */
.table-striped tbody tr:nth-of-type(odd) {
  background-color: var(--nordic-bg-elevated);
}

.table-striped tbody tr:nth-of-type(even) {
  background-color: var(--nordic-bg-surface);
}

/* Hover effect */
.table-hover tbody tr:hover,
.table tbody tr:hover {
  background-color: var(--nordic-primary-subtle) !important;
  color: var(--nordic-text-primary);
}

/* Links in tables */
.table a {
  color: var(--nordic-primary);
  text-decoration: none;
}

.table a:hover {
  color: var(--nordic-primary-light);
  text-decoration: underline;
}

/* Table responsive */
.table-responsive {
  background-color: var(--nordic-bg-surface);
  border: 1px solid var(--nordic-border-medium);
}

/* Warning text - visible on dark background */
.table .text-danger,
h2[style*="color: red"],
h2[style*="color:red"],
span[style*="color: red"],
span[style*="color:red"] {
  color: var(--nordic-error) !important;
}

/* Image thumbnails in tables */
.table .img-thumbnail {
  background-color: var(--nordic-bg-elevated);
  border-color: var(--nordic-border-medium);
}
