:root {
  color-scheme: light;
  --bg-main: #eef4f1;
  --bg-panel: rgba(255, 255, 255, 0.82);
  --bg-strong: #0e2a22;
  --surface: #ffffff;
  --surface-muted: rgba(255, 255, 255, 0.56);
  --text-main: #10221d;
  --text-soft: #53655f;
  --text-inverse: #f4f8f6;
  --line: rgba(16, 34, 29, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --accent: #66BB6A;
  --accent-strong: #4CAF50;
  --danger: #b13b3b;
  --shadow-lg: 0 28px 80px rgba(16, 34, 29, 0.16);
  --shadow-md: 0 18px 40px rgba(16, 34, 29, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text-main);
  scroll-behavior: smooth;
  background:
    radial-gradient(circle at top left, rgba(30, 122, 90, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(197, 145, 72, 0.18), transparent 28%),
    linear-gradient(135deg, #f5f8f6 0%, #e6efea 45%, #eef4f1 100%);
}

.auth-body,
.dashboard-body {
  display: grid;
}

.auth-body {
  background:
    linear-gradient(135deg, rgba(14, 42, 34, 0.75), rgba(17, 56, 44, 0.65)),
    url('./assets/hero-login.webp') center/cover no-repeat fixed;
}

.auth-layout {
  width: min(1280px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: stretch;
  padding: 0;
  min-height: 100vh;
}

.dashboard-shell {
  width: min(1180px, calc(100% - 32px));
  margin: auto;
}

.brand-panel,
.auth-card,
.hero-card,
.metric-card,
.dashboard-topbar {
  backdrop-filter: blur(16px);
}

.brand-panel {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 720px;
  padding: 48px;
  border-radius: 32px;
  background:
    linear-gradient(160deg, rgba(14, 42, 34, 0.94), rgba(17, 56, 44, 0.84)),
    linear-gradient(35deg, rgba(197, 145, 72, 0.18), transparent 50%);
  color: var(--text-inverse);
  box-shadow: var(--shadow-lg);
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: auto -10% -20% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(197, 145, 72, 0.35), transparent 66%);
}

.brand-panel h1,
.dashboard-topbar h1,
.hero-card h2,
.auth-header h2 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  letter-spacing: -0.02em;
}

.brand-panel h1 {
  max-width: 12ch;
  font-size: clamp(2.6rem, 5vw, 4.6rem);
  line-height: 0.98;
}

.brand-copy,
.auth-header p,
.hero-copy,
.metric-card p,
.brand-grid span {
  color: rgba(244, 248, 246, 0.78);
  line-height: 1.65;
}

.brand-copy {
  max-width: 48ch;
  font-size: 1.05rem;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow.muted {
  color: var(--text-soft);
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.brand-grid article {
  position: relative;
  z-index: 1;
  padding: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
}

.brand-grid strong,
.metric-card strong,
.session-badge strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.auth-panel {
  display: grid;
  align-items: center;
  width: 100%;
  max-width: 480px;
  margin-left: auto;
  align-self: center;
}

.auth-brand {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  justify-self: start;
  align-self: start;
  width: 100%;
  padding: 0;
}

.auth-brand-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.auth-logo-frame {
  margin: 0 0 20px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

.auth-brand .logo-frame {
  align-items: flex-start;
  justify-content: flex-start;
}

.auth-logo-frame .company-logo {
  height: 120px;
  filter: drop-shadow(0 4px 12px rgba(255, 255, 255, 0.3));
}

.auth-logo-frame .logo-fallback {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.auth-company-name {
  margin: 0;
  font-family: "Rubik", "Manrope", sans-serif;
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  letter-spacing: -0.01em;
  line-height: 1.3;
  max-width: 18ch;
}

.auth-card {
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 28px 80px rgba(16, 34, 29, 0.3);
}

.auth-header {
  margin-bottom: 28px;
}

.auth-header h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.auth-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 6px;
  font-weight: 700;
  color: var(--text-main);
}

.field span {
  font-size: 0.88rem;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(16, 34, 29, 0.14);
  border-radius: 10px;
  outline: none;
  font: inherit;
  font-size: 0.92rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(16, 34, 29, 0.14);
  border-radius: 10px;
  outline: none;
  font: inherit;
  font-size: 0.92rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.field textarea {
  width: 100%;
  resize: vertical;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid rgba(16, 34, 29, 0.14);
  border-radius: 10px;
  outline: none;
  font: inherit;
  font-size: 0.92rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.field input:focus {
  border-color: rgba(102, 187, 106, 0.55);
  box-shadow: 0 0 0 4px rgba(102, 187, 106, 0.12);
  transform: translateY(-1px);
}

.field select:focus {
  border-color: rgba(102, 187, 106, 0.55);
  box-shadow: 0 0 0 4px rgba(102, 187, 106, 0.12);
  transform: translateY(-1px);
}

.field textarea:focus {
  border-color: rgba(102, 187, 106, 0.55);
  box-shadow: 0 0 0 4px rgba(102, 187, 106, 0.12);
  transform: translateY(-1px);
}

.primary-button,
.secondary-button {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 8px 16px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-button {
  color: var(--text-inverse);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 14px 26px rgba(102, 187, 106, 0.22);
}

.secondary-button {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(16, 34, 29, 0.08);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.7;
  cursor: wait;
}

.form-message {
  min-height: 1.5em;
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-soft);
}

.form-message.error {
  color: var(--danger);
}

.form-message.success {
  color: var(--accent-strong);
}

.dashboard-shell {
  width: 100%;
  margin: 0;
  display: flex;
  gap: 0;
  align-items: stretch;
  padding: 100px 0 36px;
}

.page-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  width: 100%;
  padding: 0 24px;
  background: #ffffff;
  border-top: 8px solid #0f6676;
  border-bottom: 1px solid rgba(16, 34, 29, 0.08);
  box-shadow: 0 8px 24px rgba(16, 34, 29, 0.06);
}

.dashboard-sidebar {
  position: fixed;
  top: 100px;
  left: 0;
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 18px 18px 24px;
  border: 0;
  border-right: 1px solid rgba(16, 34, 29, 0.12);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-main);
  height: calc(100vh - 100px);
  overflow: hidden;
}

.dashboard-topbar {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
}

.topbar-brand {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
}

.logo-frame {
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.company-logo {
  width: auto;
  height: 44px;
  object-fit: contain;
}

.company-logo.is-hidden {
  display: none;
}

.logo-fallback {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: rgba(23, 99, 72, 0.82);
}

.topbar-brand h1 {
  margin: 0;
  font-family: "Rubik", "Manrope", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
}

.topbar-brand .eyebrow {
  margin-bottom: 6px;
}

.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 14px;
  overflow-y: auto;
  padding-right: 8px;
}

.nav-group {
  display: grid;
  gap: 8px;
}

.nav-divider {
  height: 1px;
  background: rgba(16, 34, 29, 0.12);
}

.nav-item {
  position: relative;
  padding: 12px 14px 12px 18px;
  border-radius: 12px;
  color: #455650;
  text-decoration: none;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(16, 34, 29, 0.08);
  transition: background 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(102, 187, 106, 0.1);
  color: var(--accent-strong);
  transform: translateX(2px);
  box-shadow: inset 0 0 0 1px rgba(102, 187, 106, 0.12);
}

.nav-item:hover::before,
.nav-item.active::before {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

.sidebar-user {
  flex: 0 0 auto;
  margin-top: 0;
  padding: 20px 12px 0 14px;
  border-radius: 0;
  background: transparent;
  border: 0;
}

.sidebar-user .eyebrow.muted {
  color: rgba(83, 101, 95, 0.68);
  font-weight: 600;
}

.sidebar-user strong {
  color: rgba(16, 34, 29, 0.62);
}

.sidebar-user strong {
  display: block;
  margin-top: 4px;
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 0.95rem;
  word-break: break-word;
}

.topbar-button {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
}

.topbar-button:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: var(--text-inverse);
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(102, 187, 106, 0.16);
}

.dashboard-content {
  flex: 1;
  display: grid;
  gap: 0;
  width: calc(100% - 250px);
  margin-left: 250px;
  padding: 0 24px;
}

.content-stack {
  display: grid;
  gap: 0;
}

.content-section {
  scroll-margin-top: 100px;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 18px;
  padding: 0;
}

.content-section[hidden] {
  display: none;
}

.section-header-row {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 8px;
}

.section-header-row-split {
  width: 100%;
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.section-action-button {
  flex-shrink: 0;
  margin-left: auto;
  padding: 8px 16px;
  font-size: 0.88rem;
  border-radius: 10px;
}

.section-header-row h2 {
  margin: 0;
  font-family: "Rubik", "Manrope", sans-serif;
  font-size: 1.45rem;
  font-weight: 600;
}

.section-header-row p {
  margin: 0;
  max-width: 48ch;
  color: var(--text-soft);
  line-height: 1.7;
}

.section-grid {
  display: grid;
  gap: 18px;
}

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

.section-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.section-card {
  padding: 0;
}

.section-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.02rem;
}

.section-card p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.dashboard-coming-soon {
  width: 100%;
  min-height: 320px;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 32px;
  border: 1px dashed rgba(16, 34, 29, 0.18);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(246, 250, 247, 0.88));
  text-align: center;
}

.dashboard-coming-soon-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: rgba(102, 187, 106, 0.12);
  color: var(--accent-strong);
  font-size: 2rem;
}

.dashboard-coming-soon strong {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

.dashboard-coming-soon p {
  max-width: 38ch;
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.table-panel {
  width: 100%;
  display: grid;
  gap: 12px;
}

#my-rights-table-view {
  width: fit-content;
  max-width: 100%;
}

#my-rights-table-view .table-scroll {
  width: fit-content;
  max-width: 100%;
}

.search-bar-container {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid rgba(16, 34, 29, 0.14);
  border-radius: 10px;
  outline: none;
  font: inherit;
  font-size: 0.92rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-input:focus {
  border-color: rgba(102, 187, 106, 0.55);
  box-shadow: 0 0 0 4px rgba(102, 187, 106, 0.12);
}

.search-button {
  flex-shrink: 0;
  padding: 10px 18px;
  font-size: 0.9rem;
  border-radius: 10px;
  white-space: nowrap;
}

.table-status {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(16, 34, 29, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 14px 32px rgba(16, 34, 29, 0.06);
}

.data-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(16, 34, 29, 0.08);
  border-right: 1px solid rgba(16, 34, 29, 0.08);
  text-align: left;
  vertical-align: top;
  font-size: 0.95rem;
}

.data-table th:last-child,
.data-table td:last-child {
  border-right: 0;
}

.data-table th {
  position: sticky;
  top: 0;
  background: #f3f7f4;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4b5f58;
}

.data-table tbody tr:hover {
  background: rgba(102, 187, 106, 0.05);
}

.data-table tbody tr.clickable-row {
  cursor: pointer;
}

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

.data-table td:first-child {
  max-width: 220px;
  word-break: break-word;
}

.data-table td:nth-child(2) {
  min-width: 180px;
}

.data-table td:nth-child(4) {
  min-width: 240px;
}

.rights-table {
  width: max-content;
  min-width: 0;
  border-collapse: collapse;
  margin-top: 8px;
  table-layout: auto;
}

.rights-table th,
.rights-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(16, 34, 29, 0.08);
  border-right: 1px solid rgba(16, 34, 29, 0.08);
  text-align: left;
  font-size: 0.92rem;
}

.rights-table th:last-child,
.rights-table td:last-child {
  border-right: 0;
}

.rights-table th {
  background: #f3f7f4;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #4b5f58;
}

.rights-table td:first-child {
  font-weight: 600;
  color: #2d3e38;
  width: auto;
  min-width: 0;
  white-space: nowrap;
}

.rights-table td:not(:first-child) {
  text-align: center;
  width: 52px;
}

.rights-table th:not(:first-child) {
  width: 52px;
  text-align: center;
}

.rights-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #66BB6A;
}

.rights-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
}

.rights-indicator.is-allowed {
  color: #ffffff;
  background: #66BB6A;
}

.rights-indicator.is-denied {
  color: #ffffff;
  background: #c46b6b;
}

.rights-table tbody tr:hover {
  background: rgba(102, 187, 106, 0.03);
}

fieldset.field {
  border: 1px solid rgba(16, 34, 29, 0.12);
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0;
}

fieldset.field legend {
  font-weight: 700;
  font-size: 0.9rem;
  color: #2d3e38;
  padding: 0 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(8, 24, 20, 0.45);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 0;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 0;
  padding: 20px 20px 14px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid rgba(16, 34, 29, 0.08);
  backdrop-filter: blur(12px);
}

.modal-header h2 {
  margin: 0;
  font-family: "Rubik", "Manrope", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
}

.modal-close-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border-radius: 999px;
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1;
}

.product-form {
  display: grid;
  gap: 12px;
  padding: 16px 20px 20px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.form-row-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.panel-label {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
}

@media (max-width: 980px) {
  .auth-layout,
  .section-grid-two,
  .section-grid-three {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    justify-content: flex-start;
    padding: 0 0 20px;
  }

  .auth-panel {
    margin-left: 0;
  }

  .brand-panel {
    min-height: auto;
  }

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

  .dashboard-shell {
    flex-direction: column;
    padding: 92px 0 24px;
  }

  .dashboard-sidebar {
    position: static;
    width: 100%;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid rgba(16, 34, 29, 0.12);
    height: auto;
    max-height: none;
  }

  .dashboard-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .dashboard-content {
    width: 100%;
    margin-left: 0;
    padding: 20px 16px 0;
  }

  .section-header-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-header-row-split {
    flex-direction: column;
  }

  .section-action-button {
    margin-left: 0;
  }

  .modal-header,
  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .auth-layout,
  .dashboard-shell {
    width: 100%;
  }

  .page-topbar {
    padding: 0 10px;
  }

  .brand-panel,
  .auth-card,
  .content-section {
    padding: 24px;
    border-radius: 24px;
  }

  .section-card {
    padding: 0;
  }

  .dashboard-sidebar {
    padding: 18px 12px;
  }

  .dashboard-content {
    padding: 18px 12px 0;
  }

  .brand-panel h1 {
    max-width: none;
  }
}