/* GateNoc Module — design tokens, tables, mobile (light UI) */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,400..700;1,14..32,400..700&display=swap');

:root {
  --gn-canvas: 248 250 252;
  --gn-elevated: 255 255 255;
  --gn-border: 226 232 240;
  --gn-border-strong: 203 213 225;
  --gn-text: 15 23 42;
  --gn-text-muted: 100 116 139;
  --gn-accent: 5 150 105;
  --gn-ring: 16 185 129;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: light;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

body {
  font-family:
    'Inter',
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  background-color: rgb(var(--gn-canvas)) !important;
  color: rgb(var(--gn-text));
}

/* Sidebar nav: icon + label alignment */
.gn-nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.gn-nav-link .gn-nav-icon {
  flex-shrink: 0;
}

/* —— Professional data tables —— */
.gn-table-wrap {
  -webkit-overflow-scrolling: touch;
  border-radius: 0.75rem;
  border-width: 1px;
  border-style: solid;
  border-color: rgb(var(--gn-border-strong));
  background: linear-gradient(180deg, rgb(255 255 255) 0%, rgb(248 250 252) 100%);
  box-shadow:
    0 1px 0 0 rgb(255 255 255 / 0.8) inset,
    0 1px 3px 0 rgb(15 23 42 / 0.06),
    0 8px 24px -8px rgb(15 23 42 / 0.08);
}

.gn-table {
  width: 100%;
  min-width: 640px;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 0.8125rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}

/* Wide tables (many columns): keep a sensible minimum width; smaller viewports scroll horizontally */
.gn-table.gn-table--wide {
  min-width: 52rem;
}

@media (min-width: 640px) {
  .gn-table {
    font-size: 0.875rem;
  }

  .gn-table:not(.gn-table--wide) {
    min-width: 0;
  }
}

.gn-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 0.75rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgb(71 85 105);
  background: linear-gradient(180deg, rgb(248 250 252) 0%, rgb(241 245 249) 100%);
  border-bottom: 1px solid rgb(203 213 225);
  box-shadow: 0 1px 0 0 rgb(255 255 255 / 0.9);
  vertical-align: middle;
}

/* Column grid lines (readability on wide tables + horizontal scroll on small screens) */
.gn-table thead th:not(:last-child),
.gn-table tbody td:not(:last-child) {
  border-right: 1px solid rgb(235 240 246);
}

@media (min-width: 640px) {
  .gn-table thead th {
    padding: 0.875rem 1rem;
    font-size: 0.75rem;
  }
}

.gn-table tbody td {
  padding: 0.625rem 0.75rem;
  vertical-align: middle;
  border-bottom: 1px solid rgb(226 232 240 / 0.95);
  color: rgb(var(--gn-text));
  transition:
    background-color 0.12s ease,
    box-shadow 0.12s ease;
}

@media (min-width: 640px) {
  .gn-table tbody td {
    padding: 0.75rem 1rem;
  }
}

.gn-table tbody td[colspan] {
  border-bottom: none !important;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
}

.gn-table tbody tr:last-child td:not([colspan]) {
  border-bottom: none;
}

.gn-table tbody tr:nth-child(even) td:not([colspan]) {
  background-color: rgb(248 250 252 / 0.85);
}

.gn-table tbody tr:hover td:not([colspan]) {
  background-color: rgb(236 253 245 / 0.65);
}

.gn-table tbody tr:hover td:first-child:not([colspan]) {
  box-shadow: inset 3px 0 0 0 rgb(16 185 129 / 0.45);
}

/* Right-aligned action column */
.gn-table th.gn-th-actions {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}

.gn-table td.gn-td-actions {
  text-align: right;
  width: 1%;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

/* Actions column: dropdown trigger + fixed panel (position set by table-actions.js) */
.gn-actions {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
  vertical-align: middle;
}

.gn-actions-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgb(203 213 225);
  background: linear-gradient(180deg, rgb(255 255 255) 0%, rgb(248 250 252) 100%);
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgb(51 65 85);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.06);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

.gn-actions-btn:hover {
  border-color: rgb(16 185 129 / 0.45);
  color: rgb(15 23 42);
  box-shadow: 0 2px 6px rgb(15 23 42 / 0.08);
}

.gn-actions-btn[aria-expanded='true'] {
  border-color: rgb(16 185 129 / 0.55);
  background: rgb(236 253 245);
  color: rgb(6 78 59);
}

.gn-actions-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.gn-actions-btn[aria-expanded='true'] .gn-actions-chevron {
  transform: rotate(180deg);
}

.gn-actions-panel {
  min-width: 11rem;
  border-radius: 0.625rem;
  border: 1px solid rgb(226 232 240);
  background: rgb(255 255 255);
  padding: 0.35rem 0;
  box-shadow:
    0 4px 6px -1px rgb(0 0 0 / 0.08),
    0 12px 32px -8px rgb(15 23 42 / 0.18);
}

.gn-actions-panel form {
  margin: 0;
}

.gn-actions-item {
  display: flex;
  width: 100%;
  align-items: center;
  border: none;
  background: transparent;
  padding: 0.625rem 0.9rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(51 65 85);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s ease;
}

a.gn-actions-item:hover,
button.gn-actions-item:hover {
  background: rgb(248 250 252);
}

.gn-actions-item--sky {
  color: rgb(3 105 161);
}

.gn-actions-item--sky:hover {
  background: rgb(240 249 255);
}

.gn-actions-item--emerald {
  color: rgb(4 120 87);
}

.gn-actions-item--emerald:hover {
  background: rgb(236 253 245);
}

.gn-actions-item--muted {
  color: rgb(71 85 105);
}

.gn-actions-item--muted:hover {
  background: rgb(241 245 249);
}

.gn-actions-item--danger {
  color: rgb(190 18 60);
}

.gn-actions-item--danger:hover {
  background: rgb(255 241 242);
}

/* Tighter cell padding on phones inside scroll container */
@media (max-width: 639px) {
  .gn-table thead th {
    padding: 0.625rem 0.5rem;
    font-size: 0.625rem;
  }

  .gn-table tbody td {
    padding: 0.5rem 0.5rem;
  }

  .gn-table td.gn-td-actions {
    padding-left: 0.5rem;
  }
}

/* —— Dashboard: overview tiles & hero —— */
.gn-dash-hero {
  margin-bottom: 1.75rem;
  border-radius: 1rem;
  border: 1px solid rgb(var(--gn-border));
  padding: 1.25rem 1.25rem 1.5rem;
  background: linear-gradient(135deg, rgb(255 255 255) 0%, rgb(248 250 252) 100%);
  box-shadow:
    0 1px 3px 0 rgb(0 0 0 / 0.05),
    0 1px 2px -1px rgb(0 0 0 / 0.05);
}

.gn-dash-stat,
.gn-dash-tile {
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  border: 1px solid rgb(var(--gn-border));
  background-color: rgb(var(--gn-elevated));
  box-shadow:
    0 1px 3px 0 rgb(0 0 0 / 0.06),
    0 1px 2px -1px rgb(0 0 0 / 0.06);
}

.gn-main .gn-dash-stat:hover,
.gn-main .gn-dash-tile:hover {
  border-color: rgb(16 185 129 / 0.35);
}

.gn-dash-section {
  margin-top: 2.5rem;
  border-radius: 1rem;
  border: 1px solid rgb(var(--gn-border));
  padding: 1rem;
  background-color: rgb(var(--gn-elevated));
}

@media (min-width: 640px) {
  .gn-dash-section {
    padding: 1.25rem 1.25rem 1.5rem;
  }
}

@media (min-width: 1024px) {
  #nav-drawer-backdrop,
  #nav-drawer {
    display: none !important;
  }
}

.nav-drawer-panel.nav-drawer-open {
  transform: translateX(0);
}
.nav-drawer-backdrop.nav-drawer-backdrop-open {
  opacity: 1;
  pointer-events: auto;
}

.nav-hamburger-open .nav-line-t {
  transform: translateY(6px) rotate(45deg);
}
.nav-hamburger-open .nav-line-m {
  opacity: 0;
}
.nav-hamburger-open .nav-line-b {
  transform: translateY(-6px) rotate(-45deg);
}

.overflow-x-auto {
  -webkit-overflow-scrolling: touch;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgb(5 150 105);
  outline-offset: 2px;
}

input[type='email'],
input[type='password'],
input[type='text'],
input[type='url'],
input[type='number'],
select,
textarea {
  font-size: 16px;
}

@media (min-width: 640px) {
  input[type='email'],
  input[type='password'],
  input[type='text'],
  input[type='url'],
  input[type='number'],
  select,
  textarea {
    font-size: inherit;
  }
}
