:root {
  color-scheme: dark;
  font-family: Inter, 'Segoe UI', Tahoma, Arial, sans-serif;
  background: #07090f;
  color: #edf2f7;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px circle at 10% -5%, #184a50 0, transparent 45%),
    radial-gradient(760px circle at 100% 0, #25215c 0, transparent 42%), #07090f;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  border: 0;
  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    background 0.15s ease;
}
button:hover:not(:disabled) {
  filter: brightness(1.12);
  transform: translateY(-1px);
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.shell {
  max-width: 1320px;
  margin: auto;
  padding: 36px 30px 54px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  font-weight: 850;
  font-size: 22px;
  letter-spacing: -0.5px;
}
.brand i {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #5de4c8, #6157e8);
  border-radius: 11px;
  box-shadow: 0 8px 26px #46d8c94d;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.top-actions {
  display: flex;
  gap: 8px;
}
.language {
  min-width: 56px;
}
.muted {
  color: #99a8bf;
  line-height: 1.6;
}
.card {
  background: linear-gradient(145deg, #151b29eb, #0e131eeb);
  border: 1px solid #2a3850;
  border-radius: 20px;
  padding: 22px;
  box-shadow: 0 20px 55px #0005;
  backdrop-filter: blur(16px);
}
.login {
  max-width: 450px;
  margin: 11vh auto;
}
.login h1 {
  margin: 18px 0 8px;
}
.field {
  display: grid;
  gap: 8px;
  margin: 15px 0;
}
.field label {
  font-size: 13px;
  font-weight: 650;
  color: #d7e0ed;
}
.field input,
.field select,
.field textarea,
select,
#search {
  background: #090d14;
  border: 1px solid #33435b;
  border-radius: 11px;
  color: #f8fafc;
  padding: 11px 12px;
  min-width: 0;
}
.field textarea {
  min-height: 86px;
  resize: vertical;
}
.field input:focus,
.field textarea:focus,
select:focus,
#search:focus {
  outline: 2px solid #55dfc066;
  border-color: #55dfc0;
}
.primary,
.danger,
.secondary {
  padding: 10px 14px;
  border-radius: 11px;
  font-weight: 720;
}
.primary {
  background: linear-gradient(135deg, #65e5ca, #49b8b2);
  color: #05201d;
}
.danger {
  background: #561b2a;
  color: #ffe0e5;
}
.secondary {
  background: #253248;
  color: #edf4ff;
}
.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  padding: 7px;
  border: 1px solid #26354b;
  border-radius: 14px;
  background: #0d121d99;
  width: max-content;
  max-width: 100%;
}
.nav button {
  padding: 9px 13px;
  border-radius: 9px;
  background: transparent;
  color: #b8c5d8;
}
.nav button.active {
  background: #174a47;
  color: #92f6df;
  box-shadow: inset 0 0 0 1px #55dfc033;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 14px;
}
.metric {
  min-height: 112px;
}
.metric b {
  font-size: 31px;
  display: block;
  margin-top: 11px;
  color: #fff;
}
.split {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.6fr);
  gap: 18px;
  margin-top: 18px;
}
.table {
  overflow: auto;
  margin-top: 16px;
  border: 1px solid #253247;
  border-radius: 13px;
}
.table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th,
.table td {
  text-align: start;
  padding: 12px;
  border-bottom: 1px solid #213045;
  white-space: nowrap;
}
.table th {
  color: #aebdd1;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #101725;
}
.table tbody tr:hover {
  background: #19223575;
}
.tag {
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #123e37;
  color: #77f3d7;
  font-weight: 700;
}
.tag.red {
  background: #4a1825;
  color: #fecdd3;
}
.notice {
  padding: 12px;
  border-radius: 11px;
  margin: 12px 0;
  background: #103a39;
  color: #a2f3e2;
}
.error {
  background: #481a27;
  color: #ffd4dc;
}
.detail {
  white-space: pre-wrap;
  font-family: ui-monospace, Consolas;
  font-size: 12px;
  max-height: 340px;
  overflow: auto;
  background: #090e17;
  border: 1px solid #26354a;
  border-radius: 12px;
  padding: 13px;
}
.row {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #020617c9;
  backdrop-filter: blur(7px);
}
.modal {
  position: relative;
  width: min(620px, 100%);
  max-height: 90vh;
  overflow: auto;
}
.modal h2 {
  margin: 0 34px 10px 0;
}
.modal-close {
  position: absolute;
  right: 15px;
  top: 12px;
  background: transparent;
  color: #cbd5e1;
  font-size: 27px;
}
.modal-actions {
  justify-content: flex-end;
  margin-top: 20px;
}
.generated-codes {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}
.generated-codes > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px;
  border: 1px solid #2d3b4f;
  border-radius: 11px;
  background: #090d14;
}
.generated-codes code {
  font-size: 14px;
  color: #72efd5;
}
.license-row {
  cursor: pointer;
}
.table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.table-heading h2 {
  margin: 0;
}
.table-heading input {
  min-width: min(100%, 290px);
  background: #090d14;
  border: 1px solid #33435b;
  border-radius: 11px;
  color: #f8fafc;
  padding: 11px 12px;
}
.table-heading input:focus {
  outline: 2px solid #55dfc066;
  border-color: #55dfc0;
}
.tag.green {
  background: #123e37;
  color: #77f3d7;
}
.tag.blue {
  background: #17365e;
  color: #b9dcff;
}
.activation-code {
  font-family: ui-monospace, Consolas, monospace;
  color: #91f5df;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.activation-code.masked {
  color: #aebdd1;
}
.owner {
  white-space: normal !important;
  min-width: 170px;
  line-height: 1.5;
}
#toast-host {
  position: fixed;
  z-index: 130;
  top: 18px;
  right: 18px;
  display: grid;
  gap: 9px;
  max-width: min(390px, calc(100vw - 36px));
}
.toast {
  padding: 12px 15px;
  border: 1px solid #296055;
  border-radius: 12px;
  background: #123a35;
  color: #d5fff5;
  box-shadow: 0 16px 38px #0008;
}
.toast.error {
  border-color: #7e3040;
  background: #451a25;
  color: #ffe0e5;
}
.permission-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  padding: 2px;
}
.permission-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #2b3a50;
  border-radius: 10px;
  background: #0b1019;
  color: #dce8f6;
  font-size: 13px;
  cursor: pointer;
}
.permission-option:has(input:checked) {
  border-color: #4ecdb5;
  background: #123832;
}
.permission-option input {
  accent-color: #59ddc3;
  width: 17px;
  height: 17px;
}
.permissions-summary {
  min-width: 260px;
  white-space: normal !important;
  line-height: 1.55;
}
.admin-layout {
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.65fr);
}
.admin-confirmation {
  border-color: #3d8779;
  box-shadow:
    0 0 0 1px #55dfc033,
    0 20px 55px #0005;
}
.audit-days {
  display: grid;
  gap: 11px;
  margin-top: 16px;
}
.audit-day {
  border: 1px solid #2a3a50;
  border-radius: 13px;
  overflow: hidden;
  background: #0b111b;
}
.audit-day > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  color: #e7f7f4;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}
.audit-day > summary::-webkit-details-marker {
  display: none;
}
.audit-day > summary::before {
  content: '›';
  font-size: 22px;
  line-height: 1;
  transform: rotate(0);
  transition: transform 0.15s ease;
}
.audit-day[open] > summary::before {
  transform: rotate(90deg);
}
.audit-day .table {
  margin: 0;
  border-width: 1px 0 0;
  border-radius: 0;
}
[dir='rtl'] #toast-host {
  right: auto;
  left: 18px;
}
[dir='rtl'] .modal-close {
  right: auto;
  left: 15px;
}
[dir='rtl'] .modal h2 {
  margin: 0 0 10px 34px;
}
@media (max-width: 760px) {
  .shell {
    padding: 18px;
  }
  .split,
  .admin-layout {
    grid-template-columns: 1fr;
  }
  .top {
    align-items: flex-start;
    gap: 13px;
    flex-direction: column;
  }
  .nav {
    width: 100%;
  }
  .nav button {
    flex: 1;
  }
  .table th,
  .table td {
    padding: 10px;
  }
  .modal-actions {
    justify-content: stretch;
  }
  .modal-actions button {
    flex: 1;
  }
  .permission-grid {
    grid-template-columns: 1fr;
  }
  .audit-day > summary {
    padding: 12px;
  }
  .permissions-summary {
    min-width: 180px;
  }
}
