* {
  box-sizing: border-box;
}

:root {
  --access-bg: #f3f3f1;
  --access-panel: #ffffff;
  --access-sidebar: #171717;
  --access-sidebar-hover: #252525;
  --access-sidebar-active: #303030;

  --access-border: #dedbd4;
  --access-muted: #707070;

  --access-green: #198754;
  --access-green-soft: #eaf4ee;

  --access-red: #b42318;
  --access-red-soft: #fff0ee;

  --access-orange: #b54708;
  --access-orange-soft: #fff4e5;

  --access-blue: #326ea0;

  --access-radius: 16px;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

.access-body {
  margin: 0;
  min-height: 100vh;
  background: var(--access-bg);
  color: #191919;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

input,
select,
textarea {
  color: #191919;
}

/* =======================================================
   APP LAYOUT
======================================================= */

.access-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  width: 100%;
  min-height: 100vh;
  background: var(--access-bg);
}

.access-sidebar {
  position: sticky;
  top: 0;

  display: flex;
  flex-direction: column;

  width: 260px;
  height: 100vh;

  padding: 22px 16px;

  overflow-y: auto;

  color: #fff;
  background: var(--access-sidebar);
}

.access-main {
  min-width: 0;
  width: 100%;

  padding: 28px;

  background: var(--access-bg);
}

#accessContent {
  width: 100%;
}

/* =======================================================
   SIDEBAR
======================================================= */

.access-brand {
  padding: 0 9px;
  margin-bottom: 28px;
}

.access-brand-small {
  margin-bottom: 4px;

  color: #9b9b9b;

  font-size: 0.7rem;
  font-weight: 800;

  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.access-brand-title {
  margin: 0;

  color: #fff;

  font-size: 1.65rem;
  font-weight: 850;
  line-height: 1.1;
}

.access-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.access-nav-item {
  width: 100%;

  padding: 12px 13px;

  border: 0;
  border-radius: 10px;

  color: #dedede;
  background: transparent;

  text-align: left;

  font-weight: 750;

  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.access-nav-item:hover {
  color: #fff;
  background: var(--access-sidebar-hover);
}

.access-nav-item.active {
  color: #fff;
  background: var(--access-sidebar-active);
}

.access-sidebar-footer {
  margin-top: auto;
  padding: 22px 8px 2px;

  color: #a4a4a4;

  font-size: 0.78rem;
}

/* =======================================================
   PAGE HEADER
======================================================= */

.access-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 18px;

  margin-bottom: 22px;
}

.access-page-header h1 {
  margin: 0 0 5px;

  font-size: 2rem;
  line-height: 1.1;
}

.access-page-header p {
  margin: 0;

  color: var(--access-muted);

  line-height: 1.5;
}

.access-back {
  display: inline-flex;

  margin: 0 0 14px;
  padding: 0;

  border: 0;

  color: #555;
  background: transparent;

  font-weight: 750;
}

.access-back:hover {
  color: #111;
}

/* =======================================================
   BRIDGE STATUS
======================================================= */

.bridge-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 14px;

  margin-bottom: 24px;
  padding: 14px 16px;

  border-radius: 14px;

  background: var(--access-green-soft);
}

.bridge-banner.online {
  background: var(--access-green-soft);
}

.bridge-banner.offline {
  background: var(--access-red-soft);
}

.bridge-banner strong {
  display: block;

  margin-bottom: 2px;
}

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

.access-card {
  min-width: 0;

  margin-bottom: 16px;
  padding: 19px;

  background: var(--access-panel);

  border: 1px solid var(--access-border);
  border-radius: var(--access-radius);
}

.access-card h2,
.access-card h3 {
  margin-top: 0;
}

.access-card h2 {
  margin-bottom: 12px;
}

.access-card h3 {
  margin-bottom: 6px;
}

.access-stack {
  display: grid;
  gap: 14px;
}

.access-rule {
  margin-bottom: 0;
}

.access-rule-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 15px;

  margin-bottom: 16px;
}

.access-rule-header h2,
.access-rule-header h3 {
  margin: 0 0 4px;
}

/* =======================================================
   DASHBOARD STATS
======================================================= */

.access-stat-grid {
  display: grid;
  grid-template-columns:
    repeat(
      4,
      minmax(0, 1fr)
    );

  gap: 14px;

  margin-bottom: 25px;
}

.access-stat {
  padding: 19px;

  background: #fff;

  border: 1px solid var(--access-border);
  border-radius: var(--access-radius);
}

.access-stat-value {
  margin-bottom: 4px;

  font-size: 2rem;
  font-weight: 850;
  line-height: 1;
}

.access-stat-label {
  color: var(--access-muted);

  font-size: 0.82rem;
  font-weight: 700;
}

.access-section-title {
  margin: 0 0 12px;

  font-size: 1.2rem;
  font-weight: 850;
}

/* =======================================================
   DOORS
======================================================= */

.access-door-grid {
  display: grid;
  grid-template-columns:
    repeat(
      auto-fit,
      minmax(260px, 1fr)
    );

  gap: 14px;
}

.access-door-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;

  gap: 12px;

  margin-bottom: 14px;
}

.access-door-header h3 {
  margin: 0 0 4px;
}

/* =======================================================
   BUTTONS
======================================================= */

.access-actions {
  display: flex;
  flex-wrap: wrap;

  gap: 8px;

  margin-top: 16px;
}

.access-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-height: 42px;

  padding: 9px 14px;

  border: 0;
  border-radius: 10px;

  color: #fff;
  background: var(--access-blue);

  font-weight: 800;

  text-decoration: none;

  transition:
    filter 0.15s ease,
    transform 0.05s ease;
}

.access-button:hover {
  filter: brightness(0.94);
}

.access-button:active {
  transform: translateY(1px);
}

.access-button.secondary {
  color: #1b1b1b;
  background: #e9e7e1;
}

.access-button.secondary:hover {
  background: #dcdbd5;
}

.access-button.danger {
  color: #fff;
  background: var(--access-red);
}

.access-button.green {
  color: #fff;
  background: var(--access-green);
}

.access-button.small {
  min-height: 34px;

  padding: 6px 10px;

  font-size: 0.82rem;
}

/* =======================================================
   TABLES
======================================================= */

.access-table-wrap {
  width: 100%;

  overflow-x: auto;
}

.access-table {
  width: 100%;

  border-collapse: collapse;
}

.access-table th,
.access-table td {
  padding: 13px 14px;

  border-bottom: 1px solid #eceae5;

  text-align: left;
  vertical-align: middle;
}

.access-table th {
  color: #555;

  font-size: 0.73rem;
  font-weight: 800;

  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.access-table tr:last-child td {
  border-bottom: 0;
}

/* =======================================================
   FORMS
======================================================= */

.access-field {
  display: block;

  width: 100%;
  margin-bottom: 14px;
}

.access-field > span {
  display: block;

  margin-bottom: 6px;

  color: #555;

  font-size: 0.78rem;
  font-weight: 800;
}

.access-field input,
.access-field select,
.access-field textarea {
  display: block;

  width: 100%;

  padding: 10px 11px;

  border: 1px solid #cac7bf;
  border-radius: 9px;

  outline: none;

  background: #fff;
}

.access-field select {
  min-height: 42px;
}

.access-field textarea {
  resize: vertical;
}

.access-field input:focus,
.access-field select:focus,
.access-field textarea:focus {
  border-color: #8f8b82;

  box-shadow:
    0 0 0 3px
    rgba(0, 0, 0, 0.04);
}

.access-field-action {
  display: flex;
  align-items: flex-end;

  padding-bottom: 14px;
}

.access-row {
  display: grid;
  grid-template-columns:
    repeat(
      2,
      minmax(0, 1fr)
    );

  gap: 12px;
}

.access-divider {
  height: 1px;

  margin: 17px 0;

  background: #eceae5;
}

/* =======================================================
   CHECKBOXES
======================================================= */

.access-checkbox-grid {
  display: flex;
  flex-wrap: wrap;

  gap: 8px;
}

.access-check {
  display: inline-flex;
  align-items: center;

  gap: 8px;

  padding: 8px 10px;

  border: 1px solid #d6d2ca;
  border-radius: 9px;

  background: #fafafa;

  font-size: 0.88rem;

  cursor: pointer;
}

.access-check input {
  margin: 0;
}

/* =======================================================
   PILLS / TAGS
======================================================= */

.access-pill {
  display: inline-flex;
  align-items: center;

  margin: 2px 3px 2px 0;
  padding: 5px 9px;

  border-radius: 999px;

  background: #eeeae3;

  font-size: 0.77rem;
  font-weight: 800;
}

/* =======================================================
   STATUS
======================================================= */

.access-status {
  display: inline-flex;
  align-items: center;

  gap: 7px;

  padding: 6px 10px;

  border-radius: 999px;

  background: #ededeb;

  white-space: nowrap;

  font-size: 0.76rem;
  font-weight: 850;
}

.access-status::before {
  content: "";

  width: 8px;
  height: 8px;

  border-radius: 50%;

  background: #999;
}

.access-status.active::before,
.access-status.online::before,
.access-status.unlocked::before {
  background: var(--access-green);
}

.access-status.deactivated::before,
.access-status.offline::before {
  background: var(--access-red);
}

.access-status.pending::before,
.access-status.warning::before {
  background: var(--access-orange);
}

/* =======================================================
   INFO
======================================================= */

.access-muted {
  color: var(--access-muted);
}

.access-info-grid {
  display: grid;
  grid-template-columns:
    repeat(
      auto-fit,
      minmax(140px, 1fr)
    );

  gap: 14px;
}

.access-info-grid > div {
  display: grid;

  gap: 3px;
}

.access-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 16px;

  margin-top: 12px;
  padding-top: 12px;

  border-top: 1px solid #eceae5;
}

.access-info-row span {
  color: var(--access-muted);

  font-size: 0.82rem;
}

/* =======================================================
   ALERT / WARNING
======================================================= */

.access-warning {
  margin-top: 14px;
  padding: 11px 13px;

  border-radius: 10px;

  color: #7a3d00;
  background: var(--access-orange-soft);

  font-size: 0.85rem;
  line-height: 1.45;
}

/* =======================================================
   ACTIVITY
======================================================= */

.activity-card {
  margin-bottom: 0;
}

.activity-card strong {
  display: block;

  margin-bottom: 4px;
}

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

.empty-box {
  padding: 26px;

  color: var(--access-muted);
  background: #fff;

  border: 1px dashed #c9c5bc;
  border-radius: 14px;

  text-align: center;
}

/* =======================================================
   MOBILE / TABLET
======================================================= */

@media (max-width: 1050px) {
  .access-stat-grid {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );
  }
}

@media (max-width: 800px) {
  .access-layout {
    display: block;
  }

  .access-sidebar {
    position: relative;

    width: 100%;
    height: auto;

    padding: 18px;
  }

  .access-brand {
    margin-bottom: 16px;
  }

  .access-nav {
    display: grid;
    grid-template-columns:
      repeat(
        3,
        minmax(0, 1fr)
      );

    gap: 7px;
  }

  .access-nav-item {
    text-align: center;
  }

  .access-sidebar-footer {
    margin-top: 16px;
    padding: 8px 6px 0;
  }

  .access-main {
    padding: 18px;
  }

  .access-page-header {
    flex-direction: column;
  }

  .access-stat-grid {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );
  }

  .access-row {
    grid-template-columns: 1fr;
  }

  .access-field-action {
    padding-bottom: 0;
  }

  .access-rule-header,
  .access-door-header {
    align-items: flex-start;
  }

  .access-info-row {
    align-items: flex-start;

    flex-direction: column;

    gap: 4px;
  }
}

@media (max-width: 560px) {
  .access-main {
    padding: 14px;
  }

  .access-sidebar {
    padding: 14px;
  }

  .access-nav {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );
  }

  .access-stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .access-card {
    padding: 16px;
  }

  .access-page-header h1 {
    font-size: 1.7rem;
  }

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

  .access-actions .access-button {
    width: 100%;
  }

  .bridge-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .bridge-banner .access-button {
    width: 100%;
  }

  .access-table th,
  .access-table td {
    padding: 11px;
  }
}