:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #0b57d0;
  --primary-hover: #0948b3;
  --primary-dark: #083d94;
  --border: #e5e7eb;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --button-hover-bg: #374151;
  --skeleton-from: #f3f4f6;
  --skeleton-to: #e5e7eb;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --primary: #60a5fa;
  --primary-hover: #3b82f6;
  --primary-dark: #2563eb;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.4);
  --button-hover-bg: rgba(255, 255, 255, 0.1);
  --skeleton-from: #1e293b;
  --skeleton-to: #334155;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  z-index: 200;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

  background: rgba(255, 255, 255, 0.25);
}

  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 22px;
}

  display: block;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

  display: none;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
}

  display: flex;
}

  display: flex;
  flex-direction: column;
  gap: 2px;
}

  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 12px 2px;
}

  color: white;
  font-weight: 500;
  padding: 10px 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.15s ease;
  width: 100%;
  box-sizing: border-box;
  text-decoration: none;
}

  text-decoration: none;
  background: rgba(255, 255, 255, 0.18);
}

  background: rgba(255, 255, 255, 0.22);
  font-weight: 700;
  box-shadow: inset 3px 0 0 white;
}

  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.9;
}

  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

  position: relative;
  display: inline-block;
}

  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.15);
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  width: 100%;
  min-height: 44px;
  transition: background 0.15s ease;
}

  background: rgba(255, 255, 255, 0.25);
}

  flex: 1;
  text-align: left;
}

  font-size: 0.75rem;
  opacity: 0.7;
}

  display: none;
  position: static;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-top: 4px;
  overflow: hidden;
}

  display: block;
}

  padding: 12px 14px;
}

  font-weight: 600;
  font-size: 0.9rem;
}

  font-size: 0.8rem;
  opacity: 0.7;
  text-transform: capitalize;
}

  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 14px;
}

  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: white;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s ease;
}

  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
}

  width: 18px;
  text-align: center;
  opacity: 0.8;
}

  color: #fecaca;
}

  justify-content: center;
  font-weight: 600;
}

  position: relative;
  display: inline-block;
}

  background: rgba(255, 255, 255, 0.15);
  border: 0;
  border-radius: 8px;
  color: white;
  width: 44px;
  height: 44px;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  padding: 0;
  transition: background 0.15s ease;
}

  background: rgba(255, 255, 255, 0.25);
}

  background: rgba(255, 255, 255, 0.15);
  border: 0;
  border-radius: 8px;
  color: white;
  width: 44px;
  height: 44px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  padding: 0;
  transition: background 0.15s ease;
}

  background: rgba(255, 255, 255, 0.25);
}

  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 50%;
  padding: 2px 6px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

  animation: notif-pulse 2s ease-in-out infinite;
}

@keyframes notif-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

  display: none;
  position: absolute;
  top: 110%;
  right: 0;
  width: 300px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  z-index: 100;
  padding: 8px 0;
}

  display: block;
}

  display: block;
  padding: 8px 14px;
  color: var(--text);
  font-size: 0.85rem;
  text-decoration: none;
}

  background: var(--bg);
}

  background: rgba(11, 87, 208, 0.08);
  border-left: 3px solid var(--primary);
}

.notif-message {
  font-weight: 500;
}

.notif-time {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 2px;
}

.notif-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.notif-footer {
  border-top: 1px solid var(--border);
  font-weight: 600;
  text-align: center;
  color: var(--primary);
}

@media (min-width: 768px) {

    justify-content: flex-start;
    gap: 14px;
  }

    display: none;
  }

    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    padding-top: 0;
    flex: 1;
  }

    display: flex;
  }

    flex-direction: row;
    align-items: center;
    gap: 4px;
  }

    display: none;
  }

    width: auto;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
  }

    box-shadow: none;
    background: rgba(255, 255, 255, 0.18);
  }

    font-size: 0.85rem;
  }

    margin-top: 0;
    padding-top: 0;
    border-top: none;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
  }

    width: auto;
    padding: 6px 12px;
  }

    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    min-width: 180px;
    z-index: 101;
  }

    display: block;
  }

    padding: 10px 14px;
  }

    color: var(--text);
  }

    color: var(--muted);
  }

    color: var(--text);
  }

    color: var(--danger);
  }

    right: 0;
  }
}

.container {
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

h1, h2, h3 {
  margin-top: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 {
  font-size: 1.5rem;
}

h2 {
  font-size: 1.25rem;
}

h3 {
  font-size: 1.1rem;
}

.muted {
  color: var(--muted);
  font-size: 0.95rem;
}

.top {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
select,
textarea {
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  width: 100%;
  min-height: 48px;
  background: var(--card);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.1);
}

button {
  padding: 8px 14px;
  cursor: pointer;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: white;
  font-size: 0.875rem;
  font-weight: 600;
  min-height: 44px;
  min-width: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.15s ease, transform 0.1s ease;
}

button:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button[type="button"] {
  background: #4b5563;
}

button[type="button"]:hover {
  background: var(--button-hover-bg);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

button.active {
  background: var(--primary-dark);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

.stats,
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.card {
  background: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.box-card {
  cursor: pointer;
}

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

.warning-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 16px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
}

.warning-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: white;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  color: #92400e;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s ease;
}

.warning-item:hover {
  background: #fef9c3;
  text-decoration: none;
}

.warning-icon {
  font-size: 1rem;
}

.info-widgets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 20px;
}

.box-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.stat-card {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.stat-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
}

.stat-info {
  flex: 1;
  min-width: 0;
}

.stat-info h3 {
  margin: 0 0 4px;
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-detail {
  margin: 3px 0 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.section:first-of-type {
  border-top: none;
  padding-top: 0;
}

ul {
  padding-left: 20px;
  margin-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}

.table-action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-action-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

@media (min-width: 768px) {
  .table-action-links {
    flex-direction: row;
  }
  .table-action-links a {
    display: inline-block;
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
  background: var(--card);
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--bg);
}

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

tr:hover td {
  background: var(--bg);
}

.action-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.action-bar form,
.action-bar a,
.action-bar button {
  display: inline-block;
  width: 100%;
  text-align: center;
}

.action-bar form button {
  width: 100%;
}

.action-group {
  margin-bottom: 18px;
}

.action-group h3 {
  font-size: 0.85rem;
  margin-bottom: 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.action-grid form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-grid form button,
.action-grid form select {
  width: 100%;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  align-items: center;
}

.actions-row a,
.actions-row button {
  display: inline-flex;
  min-height: 44px;
  padding: 10px 16px;
  align-items: center;
  justify-content: center;
}

form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
  display: block;
}

.form-group {
  margin-bottom: 16px;
}

.flash-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.flash {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.flash-success {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}

.flash-danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.flash-info {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}

.flash-warning {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 500;
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border-color: #a7f3d0;
}

.guest-box {
  background: #dbeafe;
  border: 1px solid #93c5fd;
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: 12px;
}

.guest-box h2 {
  color: #1e40af;
  margin-top: 0;
}

.qr-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 6px;
}

.qr-dot-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}

.box-card {
  position: relative;
}

.box-card .qr-status-badge {
  position: absolute;
  top: 12px;
  right: 12px;
}

.qr-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
}

.qr-status-badge .qr-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.qr-status-badge.active .qr-dot {
  animation: qr-pulse 2s ease-in-out infinite;
}

.qr-dot.active {
  animation: qr-pulse 2s ease-in-out infinite;
}

@keyframes qr-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.text-danger {
  color: var(--danger);
}

.back-link {
  display: inline-flex;
  margin-top: 16px;
}

.color-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.input-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.input-row input {
  flex: 1;
  min-width: 200px;
}

.mb-1 {
  margin-bottom: 6px;
}

.mt-3 {
  margin-top: 14px;
}

.text-muted-sm {
  font-size: 0.85rem;
  color: var(--muted);
}

.badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-block;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-xs {
  padding: 6px 10px;
  font-size: 0.75rem;
  min-height: 44px;
  min-width: 44px;
}

.hidden {
  display: none !important;
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination a {
  padding: 10px 16px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.15s ease;
}

.pagination a:hover {
  background: var(--primary-dark);
  text-decoration: none;
}

.pagination span {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

.pagination-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pagination-per-page {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.pagination-per-page label {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.pagination-per-page select {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  font-size: 0.85rem;
  min-height: 36px;
  cursor: pointer;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pagination-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.pagination-jump label {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.pagination-jump input[type="number"] {
  width: 70px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
  font-size: 0.85rem;
  min-height: 36px;
  text-align: center;
}

.pagination-jump button {
  padding: 6px 12px;
  background: var(--primary);
  color: white;
  border: 0;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
  transition: background 0.15s ease;
}

.pagination-jump button:hover {
  background: var(--primary-dark);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 18px;
  font-size: 0.9rem;
}

.breadcrumbs a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs span {
  color: var(--muted);
}

.filter-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-state h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1.1rem;
}

.empty-state p {
  margin: 0;
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-header h1 {
  margin: 0;
}

.text-center {
  text-align: center;
}

@media (min-width: 480px) {
  .container {
    padding: 20px;
  }


  .stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .box-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .info-widgets {
    grid-template-columns: repeat(2, 1fr);
  }

  .action-bar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .action-bar a,
  .action-bar button,
  .action-bar form button {
    width: auto;
  }

  table {
    min-width: auto;
  }
}

@media (min-width: 768px) {
  .container {
    padding: 24px;
    max-width: 1100px;
  }


    justify-content: flex-start;
    gap: 14px;
  }

    display: none;
  }

    display: flex;
    flex-direction: row;
    gap: 16px;
    padding-top: 0;
  }

    background: transparent;
    padding: 6px 0;
    min-height: auto;
    border-radius: 0;
  }

    background: transparent;
    text-decoration: underline;
  }

    margin-left: auto;
    padding: 0;
  }

  .top {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  input[type="text"],
  input[type="password"],
  input[type="number"],
  input[type="email"],
  select,
  textarea {
    width: auto;
    max-width: 360px;
  }

  .stats {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .cards {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .box-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .action-bar {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .action-bar a,
  .action-bar button,
  .action-bar form button {
    width: auto;
  }

  table {
    min-width: auto;
  }

  .search-form {
    flex-direction: row;
    align-items: center;
  }

  .filter-form {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
}

@media (min-width: 1024px) {
  .stats {
    grid-template-columns: repeat(5, 1fr);
  }

  .stat-card {
    gap: 8px;
  }

  .stat-icon {
    font-size: 1.2rem;
  }

  .stat-info h3 {
    font-size: 0.7rem;
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .stat-detail {
    font-size: 0.7rem;
  }

  .card {
    padding: 16px;
  }

 .cards {
     grid-template-columns: repeat(4, 1fr);
   }

  .box-grid {
     grid-template-columns: repeat(4, 1fr);
   }
 }

.sort-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
    font-size: 0.85rem;
  }

  .sort-controls span {
    color: var(--muted);
  }

  .sort-controls a {
    padding: 10px 10px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--primary);
    border: 1px solid var(--border);
    min-height: 44px;
    min-width: 44px;
  }

  .sort-controls a:hover {
    background: var(--bg);
  }

  .sort-controls a.active {
    background: #0b57d0;
    color: white;
    border-color: #0b57d0;
  }

 @media print {
  .action-bar,
  .action-group,
  .back-link,
  .section:last-child {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .card {
    box-shadow: none;
    border: none;
    padding: 0;
  }
}

.editor-wrapper {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.editor-wrapper .EasyMDEContainer {
  border: none;
  border-radius: 0;
}

.editor-wrapper .EasyMDEContainer .CodeMirror {
  border: none;
  border-radius: 0;
  min-height: 120px;
  font-size: 1rem;
  padding: 12px 14px;
}

.editor-wrapper .EasyMDEContainer .editor-toolbar {
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  padding: 8px 10px;
}

.editor-wrapper .EasyMDEContainer .editor-toolbar a {
  color: var(--text);
}

.editor-wrapper .EasyMDEContainer .editor-toolbar a:hover {
  background: var(--bg);
}

.editor-wrapper .EasyMDEContainer .editor-toolbar .fa {
  color: var(--text);
}

.editor-wrapper .EasyMDEContainer .editor-preview,
.editor-wrapper .EasyMDEContainer .editor-preview-side {
  background: var(--card);
  padding: 14px;
}

.box-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.box-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 4px;
}

.box-header-info h1 {
  margin: 0 0 6px;
}

.box-header-info p {
  margin: 0 0 4px;
}

.box-notes {
  margin-top: 6px;
}

.box-header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  color: white;
  font-size: 0.85rem;
  font-weight: 500;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

.btn-danger-ghost {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

.btn-danger-ghost:hover {
  background: rgba(239, 68, 68, 0.2);
}

.qr-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qr-url-box {
  display: flex;
  gap: 8px;
}

.qr-url-box input {
  flex: 1;
  min-width: 0;
}

.qr-status-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  min-height: 36px;
  transition: background 0.15s ease;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.2);
  text-decoration: none;
}

.chip-active {
  background: rgba(255, 255, 255, 0.25);
  font-weight: 700;
}

.items-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.item-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.item-card-top {
  display: flex;
  gap: 12px;
  padding: 14px;
  align-items: flex-start;
}

.item-card-photo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.item-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-photo-placeholder {
  color: var(--muted);
  font-size: 1.2rem;
}

.item-card-body {
  flex: 1;
  min-width: 0;
}

.item-card-body h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 700;
  word-break: break-word;
}

.item-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.item-card-quantity {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  background: var(--bg);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.qty-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.qty-label {
  color: var(--muted);
  font-size: 0.8rem;
}

.item-notes {
  margin: 8px 0 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

.item-card-actions {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  flex-wrap: wrap;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: white;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  font-size: 0.9rem;
}

.btn-icon:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  text-decoration: none;
}

@media (max-width: 767px) {

    display: none !important;
  }

    display: flex !important;
  }

  .box-header {
    gap: 10px;
  }

  .box-header-actions {
    width: 100%;
  }

  .box-header-actions .btn-ghost {
    flex: 1;
    justify-content: center;
  }

  .qr-url-box {
    flex-direction: column;
  }

  .section-header {
    align-items: stretch;
  }

  .section-header .actions-row {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    flex-wrap: nowrap;
  }

  .chip {
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .item-card-top {
    gap: 10px;
    padding: 12px;
  }

  .item-card-photo {
    width: 56px;
    height: 56px;
  }

  .item-card-actions {
    gap: 6px;
    padding: 10px;
    justify-content: flex-end;
  }

  .btn-icon {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 767px) {
  .container {
    padding: 12px;
  }

  h1 {
    font-size: 1.25rem;
  }

  h2 {
    font-size: 1.1rem;
  }

  .card {
    padding: 14px;
    border-radius: var(--radius-sm);
  }

  .actions-row {
    flex-direction: column;
    align-items: stretch;
  }

  .actions-row a,
  .actions-row button {
    width: 100%;
    justify-content: center;
  }

  .top a,
  .top button {
    width: 100%;
    justify-content: center;
  }

  .search-form {
    gap: 8px;
  }

  .search-form button[type="submit"] {
    width: 100%;
  }

  .box-card {
    padding: 14px;
  }

  .box-card .qr-status-badge {
    position: static;
    margin-top: 8px;
    align-self: flex-start;
  }

  .box-card input[type="checkbox"] {
    width: 24px;
    height: 24px;
    min-width: 24px;
    margin-top: 0;
  }

  .box-card > div {
    flex-wrap: wrap;
  }

  .action-grid {
    grid-template-columns: 1fr;
  }

  .stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-icon {
    font-size: 1.2rem;
  }

  .stat-value {
    font-size: 1.15rem;
  }

  .table-wrap {
    border: none;
    overflow: visible;
  }

  table {
    min-width: 0;
    border: none;
  }

  thead {
    display: none;
  }

  tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  tr {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
  }

  td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 4px 0;
    border: none;
    text-align: right;
    gap: 8px;
  }

  td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    margin-right: auto;
    padding-right: 12px;
  }

  td:last-child {
    border-bottom: none;
  }

  .pagination {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .pagination a {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .pagination-info {
    width: 100%;
    justify-content: center;
  }

  .pagination-controls {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .pagination-jump {
    width: 100%;
    justify-content: center;
  }

  .sort-controls {
    flex-wrap: wrap;
    gap: 6px;
  }

  .sort-controls a {
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
    font-size: 0.8rem;
    padding: 8px 10px;
  }

  .filter-form {
    width: 100%;
  }

  .filter-form select,
  .filter-form input {
    width: 100%;
    max-width: none;
  }

  .filter-form a,
  .filter-form button {
    width: 100%;
    justify-content: center;
  }

  .input-row {
    flex-direction: column;
  }

  .input-row input {
    width: 100%;
  }

  .btn-xs {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 12px;
  }

  .back-link {
    margin-top: 12px;
  }

  .back-link button {
    width: 100%;
    justify-content: center;
  }

  .empty-state {
    padding: 28px 16px;
  }

  .empty-state-icon {
    font-size: 2.5rem;
  }

  .breadcrumbs {
    font-size: 0.8rem;
  }

  .section {
    margin-top: 20px;
    padding-top: 16px;
  }

  .form-group {
    margin-bottom: 14px;
  }

  label {
    font-size: 0.9rem;
    margin-bottom: 6px;
  }

  input[type="text"],
  input[type="password"],
  input[type="number"],
  input[type="email"],
  select,
  textarea {
    padding: 14px;
    min-height: 52px;
    font-size: 1rem;
  }

  button[type="submit"] {
    width: 100%;
    justify-content: center;
  }

  .card {
    padding: 14px;
  }

  h1 {
    font-size: 1.25rem;
  }

  h2 {
    font-size: 1.1rem;
  }

  .error-page {
    text-align: center;
    padding: 40px 20px;
  }

  .error-icon {
    font-size: 4rem;
    margin-bottom: 16px;
  }

  .error-page h1 {
    font-size: 3rem;
    margin: 0 0 12px;
  }

  .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
  }

  .spinner-dark {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary);
  }

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

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

  .btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
  }

  .search-wrapper {
    position: relative;
    flex: 1;
    min-width: 0;
  }

  .search-wrapper input {
    padding-right: 80px;
  }

  .search-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 4px;
  }

  .search-clear {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.9rem;
  }

  .search-clear.visible {
    display: inline-flex;
  }

  .search-clear:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
  }

  .search-spinner {
    display: none;
    width: 20px;
    height: 20px;
  }

  .search-spinner.visible {
    display: inline-block;
  }

  .skeleton {
    background: linear-gradient(90deg, var(--skeleton-from) 25%, var(--skeleton-to) 50%, var(--skeleton-from) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-sm);
  }

  @keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }

  .skeleton-text {
    height: 14px;
    margin-bottom: 8px;
  }

  .skeleton-title {
    height: 20px;
    width: 60%;
    margin-bottom: 12px;
  }

  .qr-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
  }

  .lightbox {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }

  .lightbox.open {
    display: flex;
  }

  .lightbox img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  }

  .lightbox-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    border: 0;
    border-radius: 50%;
    color: white;
    width: 48px;
    height: 48px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: background 0.15s ease;
  }

  .lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.3);
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
  }

  .lightbox-prev {
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
  }

  .lightbox-next {
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
  }

  .lightbox-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
  }

  .photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
  }

  .photo-gallery-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    aspect-ratio: 1;
  }

  .photo-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .photo-gallery-item form {
    position: absolute;
    bottom: 8px;
    right: 8px;
  }

  .photo-count-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
  }
}

.login-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, #0b57d0 0%, #0948b3 100%);
}

.login-brand {
  text-align: center;
  color: white;
  margin-bottom: 24px;
}

.login-logo {
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
}

.login-brand h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: white;
}

.login-brand p {
  margin: 0;
  opacity: 0.9;
  font-size: 0.95rem;
}

.login-card {
  width: 100%;
  max-width: 400px;
  padding: 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.login-card h2 {
  margin: 0 0 20px;
  text-align: center;
  font-size: 1.5rem;
  color: var(--text);
}

.login-footer {
  text-align: center;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.login-footer a {
  color: var(--primary);
  font-size: 0.9rem;
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
}

.form-group-row {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.login-card .form-group {
  margin-bottom: 16px;
}

.login-card .form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.login-card input[type="text"],
.login-card input[type="password"] {
  padding: 12px 14px;
  min-height: 48px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-card input[type="text"]:focus,
.login-card input[type="password"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 87, 208, 0.1);
  outline: none;
}

.login-card button[type="submit"] {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 600;
  justify-content: center;
  margin-top: 8px;
}

@media (max-width: 480px) {
  .login-page {
    padding: 16px;
    justify-content: flex-start;
    padding-top: 60px;
  }

  .login-brand h1 {
    font-size: 1.5rem;
  }

  .login-card {
    padding: 24px 20px;
  }
}

.location-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.location-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 4px;
}

.location-info h1 {
  margin: 0 0 6px;
}

.location-info p {
  margin: 0;
}

.location-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.location-actions form {
  display: inline;
}

.section-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.section-header a {
  text-decoration: none;
}

@media (max-width: 767px) {
  .location-header {
    gap: 10px;
  }

  .location-actions {
    width: 100%;
  }

  .location-actions .btn-ghost {
    flex: 1;
    justify-content: center;
  }

  .section-header {
    align-items: stretch;
  }

  .section-header a {
    width: 100%;
  }

  .section-header a button {
    width: 100%;
    justify-content: center;
  }
}

@media (min-width: 768px) {
  .location-header {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .location-info {
    flex: 1;
    min-width: 0;
  }

  .section-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

kbd {
  display: inline-block;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: 500;
  line-height: 1;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--border);
}

  margin-left: auto;
  padding-left: 8px;
  font-size: 0.7rem;
  opacity: 0.7;
}

@media (max-width: 767px) {
    display: none;
  }
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
}

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

.modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 16px 20px;
}

.shortcut-group {
  margin-bottom: 16px;
}

.shortcut-group:last-child {
  margin-bottom: 0;
}

.shortcut-group h3 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 8px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

.shortcut-row kbd:first-child {
  min-width: 24px;
  text-align: center;
}

.shortcut-row span {
  color: var(--text);
  font-size: 0.9rem;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 140;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sidebar-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--primary);
  color: white;
  z-index: 150;
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.15);
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 12px;
}

.sidebar-title {
  color: white;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.sidebar-close {
  background: rgba(255, 255, 255, 0.15);
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 4px;
}

.sidebar-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 12px 4px;
}

.sidebar-link {
  color: white;
  font-weight: 500;
  padding: 10px 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.15s ease;
  width: 100%;
  box-sizing: border-box;
  text-decoration: none;
}

.sidebar-link:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, 0.18);
}

.sidebar-link.active {
  background: rgba(255, 255, 255, 0.22);
  font-weight: 700;
  box-shadow: inset 3px 0 0 white;
}

.sidebar-link i {
  width: 18px;
  text-align: center;
  font-size: 0.95rem;
  opacity: 0.9;
}

.sidebar-bottom {
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.15);
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s ease;
}

.sidebar-theme-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.15);
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  font-weight: 500;
}

.sidebar-user:hover {
  background: rgba(255, 255, 255, 0.25);
}

.sidebar-user-name {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-chevron {
  font-size: 0.75rem;
  opacity: 0.7;
}

.sidebar-user-menu {
  display: none;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-top: 4px;
  overflow: hidden;
}

.sidebar-user-menu.open {
  display: block;
}

.sidebar-user-menu a {
  display: block;
  padding: 10px 12px;
  color: white;
  text-decoration: none;
}

.sidebar-user-menu a:hover {
  background: rgba(255, 255, 255, 0.1);
}

@media (min-width: 1025px) {
  .sidebar {
    position: fixed;
    transform: translateX(0);
    z-index: 200;
  }

  .sidebar.closed {
    transform: translateX(-100%);
  }

  .sidebar-overlay {
    display: none;
  }


  .main-content {
    margin-left: 260px;
  }

  .sidebar.closed ~ .main-content {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .sidebar:not(.closed) ~ .sidebar-toggle {
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 1024px) {
  .main-content {
    margin-left: 0;
  }
}

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 160;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--primary);
  border: 0;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  box-shadow: var(--shadow-hover);
  align-items: center;
  justify-content: center;
}

@media (min-width: 1025px) {
  .sidebar-toggle {
    display: inline-flex;
  }
}

@media (max-width: 1024px) {
  .sidebar-toggle {
    display: inline-flex;
  }
}

@media (max-width: 767px) {
  .sidebar-toggle {
    top: 10px;
    left: 14px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .sidebar-toggle {
    top: 12px;
    left: 20px;
  }
}
}
