/* ============================================================
   PREMIUM DESIGN SYSTEM
   After-Sales Service Management System
   ============================================================ */

/* ----------------------------------------------------------
   1. CSS VARIABLES
   ---------------------------------------------------------- */
:root {
  /* Primary */
  --color-primary: #4361ee;
  --color-primary-hover: #3651d4;
  --color-primary-light: #eef2ff;

  /* Backgrounds */
  --color-bg: #ffffff;
  --color-bg-secondary: #f8f9fa;
  --color-bg-tertiary: #f1f3f5;

  /* Text */
  --color-text: #1a1a2e;
  --color-text-secondary: #6c757d;
  --color-text-muted: #adb5bd;

  /* Borders */
  --color-border: #e9ecef;
  --color-border-light: #f1f3f5;

  /* Status */
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Transitions */
  --transition: all 0.2s ease;
}

/* ----------------------------------------------------------
   2. CSS RESET
   ---------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  overflow-wrap: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ----------------------------------------------------------
   3. TYPOGRAPHY
   ---------------------------------------------------------- */
body {
  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text);
  background-color: var(--color-bg-secondary);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
  margin-bottom: 0.5em;
}

h1 {
  font-size: 2rem;
  letter-spacing: -0.025em;
}

h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 1.25rem;
  letter-spacing: -0.015em;
}

h4 {
  font-size: 1.1rem;
}

h5 {
  font-size: 1rem;
}

h6 {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

p {
  margin-bottom: 1rem;
  color: var(--color-text);
  line-height: 1.7;
}

small,
.text-small {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
}

a {
  color: var(--color-primary);
  transition: var(--transition);
}

a:hover {
  color: var(--color-primary-hover);
}

strong {
  font-weight: 600;
}

/* ----------------------------------------------------------
   4. LAYOUT
   ---------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
}

form {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-wrapper > .container {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: auto;
}

.content-area {
  flex: 1;
  padding: 32px 0;
}

/* Grid */
.grid {
  display: grid;
  gap: 24px;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ----------------------------------------------------------
   5. NAVIGATION
   ---------------------------------------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 24px;
  background-color: var(--color-bg);
  box-shadow: var(--shadow-sm);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0;
  color: var(--color-text);
  text-decoration: none;
}

.nav-brand .nav-brand-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
  /* Invert white logo → dark for light navbar */
  filter: brightness(0);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.nav-item:hover {
  background-color: var(--color-bg-secondary);
  color: var(--color-text);
}

.nav-item.active {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  font-weight: 600;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 16px;
  padding-left: 16px;
  border-left: 1px solid var(--color-border);
}

.nav-user .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  overflow: hidden;
}

.nav-user .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-user .user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.nav-logout {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-logout:hover {
  color: var(--color-danger);
  background-color: #fef2f2;
}

.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 4px;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-hamburger:hover {
  background-color: var(--color-bg-secondary);
}

.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Hamburger animation → X */
.nav-hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.is-open span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Overlay backdrop for mobile menu */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 999;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.nav-overlay.is-open {
  display: block;
}
  background-color: var(--color-text);
  border-radius: 1px;
  transition: var(--transition);
}

/* ----------------------------------------------------------
   6. CARDS
   ---------------------------------------------------------- */
.card {
  background-color: var(--color-bg);
  border: 1px solid #dee2e6;
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 24px;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border-light);
}

.card-header h3,
.card-header h4 {
  margin-bottom: 0;
}

.card-body {
  flex: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-light);
}

.card + .card {
  margin-top: 20px;
}

/* ----------------------------------------------------------
   7. BUTTONS
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary */
.btn-primary {
  background-color: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.btn-primary:active {
  background-color: #2d44b8;
}

/* Secondary */
.btn-secondary {
  background-color: var(--color-bg-tertiary);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-border);
}

/* Outline */
.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: #ffffff;
}

/* Danger */
.btn-danger {
  background-color: var(--color-danger);
  color: #ffffff;
  border-color: var(--color-danger);
}

.btn-danger:hover {
  background-color: #dc2626;
  border-color: #dc2626;
}

/* Sizes */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

/* Loading */
.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.btn-outline.btn-loading::after {
  border-color: rgba(67, 97, 238, 0.3);
  border-top-color: var(--color-primary);
}

.btn-secondary.btn-loading::after {
  border-color: rgba(26, 26, 46, 0.3);
  border-top-color: var(--color-text);
}

/* Icon button */
.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-icon.btn-sm {
  width: 30px;
  height: 30px;
}

/* ----------------------------------------------------------
   8. FORMS
   ---------------------------------------------------------- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.form-label .required {
  color: var(--color-danger);
  margin-left: 2px;
}

.form-control {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  appearance: none;
}

.form-control::placeholder {
  color: var(--color-text-muted);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.form-control:disabled {
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

.form-control.is-error {
  border-color: var(--color-danger);
}

.form-control.is-error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236c757d' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.form-error {
  display: block;
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--color-danger);
}

.input-icon-wrapper {
  position: relative;
}

.input-icon-wrapper .form-control {
  padding-left: 40px;
}

.input-icon-wrapper .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: 0.875rem;
  pointer-events: none;
}

.input-icon-wrapper .input-icon-right {
  left: auto;
  right: 12px;
  pointer-events: auto;
  cursor: pointer;
}

.input-icon-wrapper .form-control.has-icon-right {
  padding-right: 40px;
}

/* Checkbox / Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 0.875rem;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* ----------------------------------------------------------
   9. TABLES
   ---------------------------------------------------------- */
.table-wrapper {
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.table-wrapper > div {
  width: 100%;
}

.table-wrapper .table {
  margin: 0;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  border-width: 0 !important;
}

.table {
  width: 100%;
  table-layout: auto;
  font-size: 0.875rem;
  text-align: left;
  border: none !important;
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  border-top: none !important;
  border-left: none !important;
}

.table thead th, .table tbody th, .table tbody td {
  border-left: none !important;
  border-right: none !important;
}

.table thead th, .table tbody th {
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
  background-color: var(--color-bg-secondary);
  border-bottom: 2px solid var(--color-border);
  border-top: none !important;
  vertical-align: top;
}

.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
  vertical-align: top;
}

.table tbody tr {
  transition: background-color 0.15s ease;
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.table-striped tbody tr:nth-child(even) {
  background-color: var(--color-bg-secondary);
}

.table-hover tbody tr:hover {
  background-color: var(--color-primary-light);
}

.table .actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* Info / Key-Value Table (clean two-column layout) */
.table-info {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
}

.table-info td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

.table-info td:first-child {
  font-weight: 500;
  color: var(--color-text-secondary);
  background-color: var(--color-bg-secondary);
  width: 180px;
  white-space: nowrap;
}

.table-info td:last-child {
  color: var(--color-text);
}

.table-info tr:last-child td {
  border-bottom: none;
}

/* Info Table - edit mode with third column for actions */
.table-info-edit {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
}

.table-info-edit td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border-light);
  vertical-align: middle;
}

.table-info-edit td:first-child {
  font-weight: 500;
  color: var(--color-text-secondary);
  background-color: var(--color-bg-secondary);
  width: 160px;
  white-space: nowrap;
}

.table-info-edit td:nth-child(2) {
  width: auto;
}

.table-info-edit td:last-child {
  width: 80px;
  text-align: center;
}

.table-info-edit tr:last-child td {
  border-bottom: none;
}

/* GridView textarea styling for read-only multi-line content */
.table textarea.txtbox_temp {
  outline: none !important;
  padding: 6px 10px !important;
  margin: 0 !important;
  width: 100% !important;
  min-width: 180px;
  max-width: 100%;
  border: none !important;
  border-radius: var(--radius-sm);
  background-color: var(--color-bg-secondary);
  color: var(--color-text);
  font-size: 0.8125rem !important;
  line-height: 1.6;
  resize: vertical;
  overflow-y: auto;
  box-sizing: border-box;
  height: auto !important;
}

.table tr:hover textarea.txtbox_temp {
  background-color: transparent;
}

/* ----------------------------------------------------------
   10. BADGES / STATUS
   ---------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  border-radius: 999px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-success {
  background-color: #ecfdf5;
  color: #059669;
}

.badge-success::before {
  background-color: var(--color-success);
}

.badge-warning {
  background-color: #fffbeb;
  color: #b45309;
}

.badge-warning::before {
  background-color: var(--color-warning);
}

.badge-danger {
  background-color: #fef2f2;
  color: #dc2626;
}

.badge-danger::before {
  background-color: var(--color-danger);
}

.badge-info {
  background-color: #eff6ff;
  color: #2563eb;
}

.badge-info::before {
  background-color: var(--color-info);
}

.badge-neutral {
  background-color: var(--color-bg-tertiary);
  color: var(--color-text-secondary);
}

.badge-neutral::before {
  background-color: var(--color-text-muted);
}

/* ----------------------------------------------------------
   11. TOAST NOTIFICATIONS
   ---------------------------------------------------------- */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 320px;
  max-width: 420px;
  padding: 16px 20px;
  background-color: var(--color-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slideIn 0.3s ease forwards;
  border-left: 4px solid transparent;
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.toast-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  transition: var(--transition);
}

.toast-close:hover {
  color: var(--color-text);
}

.toast-success {
  border-left-color: var(--color-success);
}

.toast-success .toast-icon {
  color: var(--color-success);
}

.toast-error {
  border-left-color: var(--color-danger);
}

.toast-error .toast-icon {
  color: var(--color-danger);
}

.toast-info {
  border-left-color: var(--color-info);
}

.toast-info .toast-icon {
  color: var(--color-info);
}

.toast.toast-exit {
  animation: fadeOut 0.25s ease forwards;
}

/* ----------------------------------------------------------
   12. UTILITIES
   ---------------------------------------------------------- */

/* Text alignment */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* Margin top */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }

/* Margin bottom */
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 32px; }

/* Padding */
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }
.p-5 { padding: 32px; }

/* Flex */
.flex {
  display: flex;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

/* Visibility */
.hidden { display: none !important; }
.visible { display: block !important; }

/* Text colors */
.text-primary { color: var(--color-primary); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.text-info { color: var(--color-info); }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }

/* Truncate */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Width */
.w-full { width: 100%; }

/* ----------------------------------------------------------
   13. RESPONSIVE
   ---------------------------------------------------------- */

/* Tablet */
@media (max-width: 768px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    background-color: var(--color-bg);
    padding: 8px 16px 16px;
    box-shadow: var(--shadow-md);
    border-top: 1px solid var(--color-border-light);
    border-bottom: 3px solid var(--color-primary);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links .nav-item {
    display: flex;
    width: 100%;
    padding: 12px 16px;
    font-size: 0.9375rem;
    border-radius: var(--radius-sm);
    border-bottom: 1px solid var(--color-border-light);
  }
  .nav-links .nav-item:last-child {
    border-bottom: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-user {
    margin-left: auto;
    padding-left: 12px;
    border-left: none;
  }

  .nav-user .user-name {
    display: none;
  }

  .content-area {
    padding: 20px 0;
  }

  .card {
    padding: 18px;
  }

  .table {
    font-size: 0.8125rem;
  }

  .table thead th,
  .table tbody td {
    padding: 10px 12px;
  }

  .toast-container {
    right: 12px;
    left: 12px;
  }

  .toast {
    min-width: auto;
  }

  .hide-tablet {
    display: none !important;
  }

  .show-tablet {
    display: block !important;
  }
}

/* Mobile */
@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .grid-auto {
    grid-template-columns: 1fr;
  }

  .navbar {
    padding: 0 12px;
    height: 56px;
  }

  .nav-brand {
    text-decoration: none;
  }
  .nav-brand .nav-brand-logo {
    height: 26px;
    width: auto;
  }

  .nav-links {
    top: 56px;
    padding: 4px 12px 12px;
  }

  .nav-links .nav-item {
    padding: 14px 12px;
    font-size: 0.9375rem;
  }

  .nav-user {
    gap: 6px;
    padding-left: 8px;
  }

  .nav-user .nav-item,
  .nav-user .nav-logout {
    font-size: 0.75rem;
    padding: 5px 8px;
  }

  .nav-hamburger {
    width: 36px;
    height: 36px;
    padding: 6px;
  }

  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .card {
    padding: 16px;
    border-radius: var(--radius-sm);
  }

  .btn-lg {
    padding: 12px 20px;
    font-size: 0.875rem;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .card-footer {
    flex-direction: column;
  }

  .card-footer .btn {
    width: 100%;
  }

  .hide-mobile {
    display: none !important;
  }

  .show-mobile {
    display: block !important;
  }
}

/* ----------------------------------------------------------
   14. ANIMATIONS
   ---------------------------------------------------------- */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----------------------------------------------------------
   15. PAGE-SPECIFIC HELPERS
   ---------------------------------------------------------- */
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 2px solid var(--color-border);
  letter-spacing: -0.02em;
}

.page-title .page-title-action {
  float: right;
  margin-top: -4px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background-color: var(--color-border-light);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.empty-state .empty-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  color: var(--color-text-muted);
  opacity: 0.5;
}

.empty-state .empty-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.empty-state .empty-description {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  max-width: 400px;
  margin-bottom: 24px;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.loading-overlay .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-overlay .loading-text {
  margin-top: 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-secondary);
}

/* Inline spinner */
.spinner-inline {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
}

/* Divider */
.divider {
  height: 1px;
  background-color: var(--color-border-light);
  margin: 20px 0;
  border: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
  background-color: var(--color-text-muted);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-text-secondary);
}

/* Selection */
::selection {
  background-color: var(--color-primary);
  color: #ffffff;
}

/* Focus visible (keyboard navigation) */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Print helpers */
@media print {
  .navbar,
  .toast-container,
  .btn,
  .loading-overlay {
    display: none !important;
  }

  .card {
    box-shadow: none;
    border: 1px solid var(--color-border);
    break-inside: avoid;
  }

  body {
    background-color: #ffffff;
    color: #000000;
  }
}
