.admin-shell {
  margin: 0;
  min-height: 100vh;
  background: #f5f8fc;
  color: #14314f;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.admin-shell *,
.admin-shell *::before,
.admin-shell *::after {
  box-sizing: border-box;
}

.admin-shell a {
  color: inherit;
  text-decoration: none;
}

.admin-app {
  min-height: 100vh;
}

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: 280px;
  flex-direction: column;
  gap: 1rem;
  padding: 0 1.2rem 1.6rem;
  overflow-y: auto;
  background: linear-gradient(180deg, #009b5a 0%, #00748c 45%, #0057a8 72%, #073b75 100%);
  color: #ffffff;
  box-shadow: 0 24px 50px rgba(7, 59, 117, 0.2);
}

.admin-sidebar__header {
  width: calc(100% + 2.4rem);
  margin: 0 -1.2rem;
  background: rgba(255, 255, 255, 0.04);
}

.admin-sidebar__logo-image,
.admin-sidebar__footer p {
  margin: 0;
}

.admin-sidebar__logo-image {
  display: block;
  width: 100%;
  height: auto;
}

.admin-sidebar__section-title {
  margin: 0.25rem 0 0.1rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-nav {
  display: grid;
  gap: 0.45rem;
}

.admin-nav__group {
  display: grid;
  gap: 0.45rem;
}

.admin-nav__group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.94);
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.admin-nav__group-title::-webkit-details-marker {
  display: none;
}

.admin-nav__group-arrow {
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(255, 255, 255, 0.9);
  border-bottom: 2px solid rgba(255, 255, 255, 0.9);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.admin-nav__group[open] .admin-nav__group-arrow {
  transform: rotate(225deg);
}

.admin-nav__group--active .admin-nav__group-title {
  background: rgba(255, 255, 255, 0.08);
}

.admin-nav__submenu {
  display: grid;
  gap: 0.35rem;
  margin-left: 1rem;
  padding-left: 0.9rem;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}

.admin-nav__submenu .admin-nav__link {
  min-height: 42px;
  padding: 0.65rem 0.85rem;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.95rem;
}

.admin-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0.85rem 1rem;
  border: 1px solid transparent;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.94);
  font-weight: 600;
  transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.admin-nav__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-nav__link:hover,
.admin-nav__link:focus-visible,
.admin-nav__link--active {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(3px);
}

.admin-sidebar__footer {
  display: grid;
  gap: 0.45rem;
  margin-top: auto;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.9rem;
}

.admin-sidebar__logout-button,
.admin-sidebar__footer .button_to {
  width: 100%;
}

.auth-shell {
  margin: 0;
  min-height: 100vh;
  color: #14314f;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(0, 155, 90, 0.14), transparent 30%),
    radial-gradient(circle at top right, rgba(0, 87, 168, 0.14), transparent 28%),
    linear-gradient(180deg, #f5f8fc 0%, #edf4fb 100%);
}

.auth-shell *,
.auth-shell *::before,
.auth-shell *::after {
  box-sizing: border-box;
}

.auth-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.auth-card {
  width: min(100%, 460px);
  padding: 1.5rem;
  border: 1px solid rgba(7, 59, 117, 0.08);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 54px rgba(7, 59, 117, 0.12);
}

.auth-card__brand {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

.auth-card__brand p {
  margin: 0;
  color: #60758d;
  line-height: 1.5;
}

.auth-card__logo {
  width: min(100%, 280px);
  height: auto;
}

.auth-card__form {
  gap: 1.1rem;
}

.auth-card__flash {
  margin: 0;
}

.auth-card__form .field {
  gap: 0.5rem;
  text-align: left;
}

.auth-card__form .field input {
  min-height: 42px;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.auth-card__actions {
  justify-content: stretch;
}

.auth-card__actions .button,
.auth-card__actions input[type="submit"] {
  width: 100%;
}

.admin-main {
  min-height: 100vh;
  margin-left: 280px;
  padding: 1rem 1rem 2rem;
}

.admin-topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid rgba(7, 59, 117, 0.08);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(7, 59, 117, 0.06);
}

.topbar-menu-button {
  display: inline-grid;
  gap: 4px;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 1px solid rgba(7, 59, 117, 0.1);
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
}

.topbar-menu-button span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: #073b75;
}

.topbar-search {
  position: relative;
  width: 100%;
}

.topbar-search::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 1rem;
  width: 14px;
  height: 14px;
  border: 2px solid #6f86a0;
  border-radius: 50%;
  transform: translateY(-58%);
}

.topbar-search::before {
  content: "";
  position: absolute;
  top: 56%;
  right: 0.74rem;
  width: 7px;
  height: 2px;
  background: #6f86a0;
  transform: rotate(45deg);
  transform-origin: center;
}

.topbar-search input {
  width: 100%;
  min-height: 46px;
  padding: 0.82rem 3rem 0.82rem 1rem;
  border: 1px solid rgba(7, 59, 117, 0.1);
  border-radius: 14px;
  background: #fbfdff;
  color: #14314f;
  font: inherit;
}

.admin-user__meta strong {
  color: #0b2340;
}

.admin-user__meta span {
  color: #6d8097;
  font-size: 0.9rem;
}

.admin-topbar__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-user__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e73be, #0b4e89);
  color: #ffffff;
  font-weight: 800;
}

.admin-user__meta {
  display: grid;
  gap: 0.1rem;
}

.admin-content {
  display: grid;
  gap: 1.25rem;
}

.flash {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(0, 155, 90, 0.12);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(7, 59, 117, 0.05);
}

.flash--notice {
  background: #eefaf3;
  color: #0a7a4b;
}

.flash--alert {
  background: #fff3f3;
  color: #bb3d3d;
}

.confirm-modal {
  width: min(92vw, 420px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: 0 30px 70px rgba(7, 59, 117, 0.22);
}

.confirm-modal::backdrop {
  background: rgba(11, 35, 64, 0.48);
  backdrop-filter: blur(3px);
}

.confirm-modal__content {
  padding: 1.35rem;
  border: 1px solid rgba(7, 59, 117, 0.08);
  border-radius: 18px;
  background: #ffffff;
}

.confirm-modal__header h3,
.confirm-modal__message {
  margin: 0;
}

.confirm-modal__message {
  margin-top: 0.8rem;
  color: #60758d;
  line-height: 1.5;
}

.confirm-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.dashboard-hero,
.panel__header,
.panel__actions,
.form-actions,
.filters-form__actions,
.table-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dashboard-hero {
  justify-content: space-between;
  padding: 1.5rem 1.6rem;
  border: 1px solid rgba(7, 59, 117, 0.06);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
  box-shadow: 0 12px 28px rgba(7, 59, 117, 0.05);
}

.dashboard-hero__eyebrow,
.panel__eyebrow,
.stat-card__label {
  margin: 0;
  color: #009b5a;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dashboard-hero h1,
.panel h3 {
  margin: 0;
  color: #073b75;
}

.dashboard-hero__content p:last-child {
  margin: 0.45rem 0 0;
  color: #60758d;
  max-width: 42rem;
  font-size: 1.05rem;
}

.dashboard-hero__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dashboard-hero__timestamp {
  display: grid;
  gap: 0.2rem;
  min-width: 180px;
  color: #60758d;
  text-align: right;
}

.dashboard-hero__timestamp strong {
  color: #073b75;
  font-size: 0.98rem;
}

.dashboard-notice {
  padding: 1rem 1.2rem;
  border: 1px solid rgba(245, 158, 11, 0.18);
  border-radius: 16px;
  background: #fff8eb;
  color: #8a5a00;
}

.dashboard-notice p {
  margin: 0;
  line-height: 1.5;
}

.stats-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card,
.panel,
.details-card {
  border: 1px solid rgba(7, 59, 117, 0.07);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(7, 59, 117, 0.05);
}

.stat-card {
  padding: 1.1rem 1.2rem;
}

.stat-card__header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.stat-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.stat-card__icon-svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.stat-card__icon--primary {
  background: #eaf8f0;
  color: #009b5a;
}

.stat-card__icon--secondary {
  background: #ecf4ff;
  color: #1f6ae0;
}

.stat-card__icon--warning {
  background: #fff4e8;
  color: #ff8b08;
}

.stat-card__icon--info {
  background: #f2ecff;
  color: #713bff;
}

.stat-card__label {
  color: #60758d;
  font-size: 0.98rem;
  letter-spacing: 0;
  text-transform: none;
}

.stat-card__value {
  margin: 0.9rem 0 0.45rem;
  color: #0b2340;
  font-size: 2.05rem;
  font-weight: 700;
}

.stat-card__trend {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
}

.stat-card__trend--primary,
.stat-card__trend--secondary,
.stat-card__trend--info {
  color: #0e9f5a;
}

.stat-card__trend--warning {
  color: #f05f3b;
}

.stat-card__sparkline {
  height: 36px;
  margin-top: 0.9rem;
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(0, 155, 90, 0.16), rgba(0, 155, 90, 0.02)),
    linear-gradient(135deg, transparent 0%, transparent 12%, rgba(255, 255, 255, 0) 12%);
  clip-path: polygon(0 86%, 10% 80%, 18% 84%, 28% 70%, 36% 74%, 49% 58%, 58% 62%, 67% 44%, 79% 52%, 90% 28%, 100% 54%, 100% 100%, 0 100%);
}

.stat-card--secondary .stat-card__sparkline {
  background: linear-gradient(180deg, rgba(31, 106, 224, 0.18), rgba(31, 106, 224, 0.02));
}

.stat-card--warning .stat-card__sparkline {
  background: linear-gradient(180deg, rgba(255, 139, 8, 0.18), rgba(255, 139, 8, 0.02));
}

.stat-card--info .stat-card__sparkline {
  background: linear-gradient(180deg, rgba(113, 59, 255, 0.18), rgba(113, 59, 255, 0.02));
}

.dashboard-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
}

.panel {
  padding: 1.4rem;
}

.panel__header {
  justify-content: space-between;
  margin-bottom: 1.15rem;
}

.panel__header--stacked {
  align-items: flex-start;
}

.quick-actions-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.quick-action-card {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1rem;
  border: 1px solid rgba(7, 59, 117, 0.08);
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.quick-action-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 16px;
  color: #ffffff;
}

.quick-action-card__icon-svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.quick-action-card--primary .quick-action-card__icon {
  background: linear-gradient(135deg, #0ea54f, #008e68);
}

.quick-action-card--secondary .quick-action-card__icon {
  background: linear-gradient(135deg, #226ce8, #1157d1);
}

.quick-action-card--teal .quick-action-card__icon {
  background: linear-gradient(135deg, #099fa4, #0b7cb7);
}

.quick-action-card--violet .quick-action-card__icon {
  background: linear-gradient(135deg, #5d17d8, #7226f0);
}

.quick-action-card__content {
  display: grid;
  gap: 0.25rem;
}

.quick-action-card__content strong {
  color: #0b2340;
}

.quick-action-card__content span {
  color: #6d8097;
  line-height: 1.45;
}

.alerts-list {
  display: grid;
  gap: 0.9rem;
}

.alert-card {
  padding: 1rem;
  border-radius: 16px;
  border-left: 4px solid #0057a8;
  background: #f8fbff;
}

.alert-card--warning {
  border-left-color: #f59e0b;
  background: #fff9ef;
}

.alert-card--danger {
  border-left-color: #ef4444;
  background: #fff3f3;
}

.alert-card--success {
  border-left-color: #10b981;
  background: #eefaf3;
}

.alert-card h4,
.alert-card p {
  margin: 0;
}

.alert-card p {
  margin-top: 0.45rem;
  color: #60758d;
  line-height: 1.5;
}

.button,
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.72rem 1.15rem;
  border: 1px solid rgba(7, 59, 117, 0.1);
  border-radius: 12px;
  background: #ffffff;
  color: #073b75;
  font: inherit;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(7, 59, 117, 0.04);
  cursor: pointer;
}

.button:hover,
.button:focus-visible,
input[type="submit"]:hover,
input[type="submit"]:focus-visible {
  background: #f8fbff;
  border-color: rgba(7, 59, 117, 0.16);
}

.button--secondary {
  background: #f8fbff;
}

.button--sidebar {
  width: 100%;
  justify-content: center;
  border-color: rgba(7, 59, 117, 0.42);
  background: #073b75;
  color: #ffffff;
  box-shadow: none;
}

.button--sidebar:hover,
.button--sidebar:focus-visible {
  background: #052f5d;
  border-color: rgba(7, 59, 117, 0.58);
}

.button_to {
  margin: 0;
}

.button_to--inline {
  display: inline-flex;
}

.filters-form,
.resource-form {
  display: grid;
  gap: 1rem;
}

.resource-form__grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-section {
  padding: 1.1rem;
  border: 1px solid rgba(7, 59, 117, 0.08);
  border-radius: 16px;
  background: #fbfdff;
}

.form-section__header {
  margin-bottom: 1rem;
}

.form-section__header h4 {
  margin: 0;
  color: #073b75;
  font-size: 1rem;
}

.filters-form {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  margin-bottom: 1.2rem;
}

.filters-form__actions {
  align-self: end;
  min-height: 46px;
}

.field {
  display: grid;
  gap: 0.42rem;
}

.field--full {
  grid-column: 1 / -1;
}

.field label {
  color: #073b75;
  font-weight: 700;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 46px;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(7, 59, 117, 0.1);
  border-radius: 12px;
  background: #ffffff;
  color: #14314f;
  font: inherit;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.table-wrapper {
  overflow-x: auto;
}

.resource-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.resource-table th,
.resource-table td {
  padding: 0.95rem 0.75rem;
  border-bottom: 1px solid rgba(7, 59, 117, 0.08);
  text-align: left;
  vertical-align: middle;
}

.resource-table th {
  color: #6d8097;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.table-link {
  color: #0057a8;
  font-weight: 700;
}

.table-link--button {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.table-actions {
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
}

.button--table {
  min-height: 36px;
  padding: 0.5rem 0.8rem;
  border-radius: 10px;
  font-size: 0.88rem;
  box-shadow: none;
}

.button--danger {
  border-color: rgba(191, 61, 61, 0.18);
  color: #b73636;
  background: #fff5f5;
}

.button--danger:hover,
.button--danger:focus-visible {
  border-color: rgba(191, 61, 61, 0.28);
  background: #ffeaea;
}

.permission-matrix th:not(:first-child),
.permission-matrix td:not(:first-child) {
  text-align: center;
}

.permission-matrix input[type="checkbox"] {
  width: 18px;
  height: 18px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 0.38rem 0.78rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.status-badge--active {
  background: #e7f9f0;
  color: #08955b;
}

.status-badge--inactive {
  background: #fff2f2;
  color: #d24a4a;
}

.status-badge--blocked {
  background: #fef3c7;
  color: #b45309;
}

.details-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.details-card {
  padding: 1.2rem;
}

.details-card dt {
  margin-bottom: 0.4rem;
  color: #6d8097;
  font-size: 0.9rem;
  font-weight: 700;
}

.details-card dd {
  margin: 0;
  color: #0b2340;
  font-size: 1.05rem;
}

.form-errors {
  padding: 1rem 1.15rem;
  border-radius: 16px;
  background: #fff4f4;
  color: #bf3d3d;
}

.form-errors h3,
.form-errors ul {
  margin: 0;
}

.form-errors ul {
  margin-top: 0.6rem;
  padding-left: 1.2rem;
}

.permissions-summary {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(7, 59, 117, 0.08);
  border-radius: 16px;
  background: #fbfdff;
}

.permissions-summary strong {
  color: #073b75;
}

.permissions-summary span {
  color: #60758d;
  line-height: 1.5;
}

.empty-state {
  margin: 0;
  padding: 1.7rem;
  border: 1px dashed rgba(7, 59, 117, 0.15);
  border-radius: 16px;
  text-align: center;
  color: #6d8097;
}

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

@media (max-width: 1024px) {
  .admin-sidebar {
    width: 240px;
  }

  .admin-main {
    margin-left: 240px;
  }

  .admin-topbar,
  .dashboard-grid,
  .filters-form,
  .resource-form__grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .admin-topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .admin-topbar__actions {
    grid-column: 1 / -1;
  }
}

@media (max-width: 840px) {
  .admin-sidebar {
    position: static;
    width: auto;
    max-height: none;
    border-radius: 0 0 18px 18px;
  }

  .admin-main {
    margin-left: 0;
    padding-top: 0.8rem;
  }

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

  .stats-grid,
  .quick-actions-grid,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    align-items: flex-start;
  }

  .dashboard-hero__actions {
    width: 100%;
    justify-content: space-between;
  }

  .dashboard-hero__timestamp {
    text-align: left;
  }
}

@media (max-width: 640px) {
  .admin-sidebar,
  .admin-main {
    padding: 1rem;
  }

  .auth-card__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-nav {
    grid-template-columns: 1fr;
  }

  .admin-topbar {
    padding: 0.9rem;
  }

  .admin-topbar__actions,
  .dashboard-hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-user {
    justify-content: flex-start;
  }

  .dashboard-hero__timestamp {
    min-width: 0;
  }

  .resource-table {
    min-width: 640px;
  }
}
