:root {
  --admin-bg: #f5efe5;
  --admin-panel: rgba(255, 255, 255, 0.86);
  --admin-panel-strong: #ffffff;
  --admin-text: #14213d;
  --admin-muted: #5d6a7f;
  --admin-line: rgba(20, 33, 61, 0.12);
  --admin-orange: #f77f00;
  --admin-yellow: #f77f00;
  --admin-shadow: 0 18px 40px rgba(13, 27, 42, 0.1);
  --admin-radius: 24px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--admin-text);
  background:
    radial-gradient(circle at top left, rgba(247, 127, 0, 0.1), transparent 28%),
    linear-gradient(180deg, #fffdf8 0%, var(--admin-bg) 100%);
}
a { color: inherit; text-decoration: none; }

body.sidebar-open {
  overflow: hidden;
}

.admin-login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.admin-login-card,
.admin-card {
  background: var(--admin-panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--admin-line);
  border-radius: var(--admin-radius);
  box-shadow: var(--admin-shadow);
}

.admin-login-card {
  width: min(100%, 480px);
  padding: 36px;
}

.admin-login-brand {
  display: grid;
  justify-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-login-logo {
  display: block;
  width: 72px;
  height: auto;
  margin: 0 auto;
}

.admin-login-brand-copy {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.admin-login-brand-copy strong {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--admin-text);
}

.admin-login-brand-copy small {
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--admin-orange);
  font-weight: 800;
}

.admin-eyebrow,
.admin-topbar-kicker {
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--admin-orange);
  font-weight: 800;
}

.admin-login-text,
.admin-muted,
.admin-inline-note {
  color: var(--admin-muted);
  line-height: 1.7;
}

.admin-login-note {
  margin-top: 18px;
  color: var(--admin-muted);
  font-size: 0.92rem;
}

.admin-form {
  display: grid;
  gap: 16px;
}

.admin-form label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
}

.admin-form input,
.admin-form textarea,
.admin-form select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 16px;
  border: 1px solid var(--admin-line);
  background: rgba(255,255,255,0.92);
  color: var(--admin-text);
  font: inherit;
}

.admin-form textarea { min-height: 110px; resize: vertical; }
.admin-field-hint {
  color: var(--admin-muted);
  font-weight: 600;
  line-height: 1.5;
}

.admin-checkbox-group {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--admin-line);
  border-radius: 16px;
  background: rgba(255,255,255,0.66);
}

.admin-checkbox-group legend {
  padding: 0 6px;
  font-weight: 800;
}

.admin-checkbox-group p {
  margin: 0;
  color: var(--admin-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.admin-category-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.admin-category-options label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 12px;
  background: rgba(255,255,255,0.86);
}

.admin-category-options input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.admin-related-options {
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.admin-related-fieldset {
  gap: 14px;
}

.related-article-search label {
  display: grid;
  gap: 8px;
}

.related-article-search label > span:first-child {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--admin-text);
}

.admin-related-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  max-height: 430px;
  padding: 2px 4px 2px 0;
}

.admin-related-card {
  display: grid !important;
  grid-template-columns: 18px 90px minmax(0, 1fr);
  align-items: center;
  gap: 12px !important;
  min-height: 116px;
  padding: 10px !important;
  border: 1px solid var(--admin-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.admin-related-card[hidden] {
  display: none !important;
}

.admin-related-card input {
  width: 18px;
  height: 18px;
}

.admin-related-card img {
  width: 90px;
  height: 90px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(20, 33, 61, 0.06);
}

.admin-related-card-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.admin-related-card-copy strong {
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.admin-related-card-copy small {
  color: var(--admin-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.admin-related-empty {
  padding: 14px;
  border: 1px dashed rgba(20, 33, 61, 0.18);
  border-radius: 8px;
  color: var(--admin-muted);
  font-weight: 800;
  text-align: center;
}

.admin-editor { min-height: 240px !important; }
.tiptap-field {
  display: grid;
  gap: 10px;
}

.tiptap-field.is-tiptap-ready .tiptap-source {
  display: none;
}

.tiptap-field.is-tiptap-ready.is-source-visible .tiptap-source {
  display: block;
  min-height: 340px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.55;
}

.tiptap-field.is-source-visible .tiptap-editor {
  display: none;
}

.tiptap-field-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-end;
  font-size: 0.95rem;
  font-weight: 800;
}

.tiptap-field-header small {
  color: var(--admin-muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: right;
}

.tiptap-editor {
  min-height: 340px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,250,241,0.92)),
    radial-gradient(circle at top right, rgba(252, 191, 73, 0.14), transparent 34%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 16px 34px rgba(13, 27, 42, 0.07);
}

.tiptap-editor[contenteditable="true"] {
  min-height: 340px;
  padding: 22px;
  outline: 0;
  color: var(--admin-text);
  line-height: 1.72;
}

.tiptap-editor.is-empty::before {
  content: attr(data-placeholder);
  position: absolute;
  top: 22px;
  left: 22px;
  right: 22px;
  color: rgba(93, 106, 127, 0.72);
  pointer-events: none;
}

.tiptap-editor > *:first-child {
  margin-top: 0;
}

.tiptap-editor > *:last-child {
  margin-bottom: 0;
}

.tiptap-editor h2,
.tiptap-editor h3 {
  line-height: 1.22;
  margin: 24px 0 10px;
}

.tiptap-editor h2 {
  font-size: 1.7rem;
}

.tiptap-editor h3 {
  font-size: 1.28rem;
}

.tiptap-editor p {
  margin: 0 0 14px;
}

.tiptap-editor ul,
.tiptap-editor ol {
  padding-left: 24px;
  margin: 0 0 16px;
}

.tiptap-editor blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  border-left: 4px solid var(--admin-orange);
  border-radius: 0 16px 16px 0;
  background: rgba(247, 127, 0, 0.08);
  color: #253654;
  font-weight: 700;
}

.tiptap-editor a {
  color: var(--admin-orange);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tiptap-editor img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px 0;
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(13, 27, 42, 0.1);
}

.admin-button,
.admin-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, var(--admin-orange), #ff962e);
  color: white;
}

.admin-link-button.logout {
  background: rgba(20, 33, 61, 0.08);
  color: var(--admin-text);
}

.admin-link-inline,
.admin-text-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-weight: 800;
  color: var(--admin-orange);
  cursor: pointer;
}

.admin-alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 16px;
  font-weight: 700;
}

.admin-alert.success {
  background: rgba(54, 179, 126, 0.12);
  border: 1px solid rgba(54, 179, 126, 0.28);
}

.admin-alert.error {
  background: rgba(204, 56, 89, 0.12);
  border: 1px solid rgba(204, 56, 89, 0.28);
}

.admin-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
}

.admin-mobile-header {
  display: none;
}

.admin-mobile-close {
  display: none;
}

.admin-mobile-toggle {
  z-index: 1200;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--admin-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--admin-shadow);
  color: var(--admin-text);
  font: inherit;
  font-weight: 800;
  backdrop-filter: blur(12px);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.admin-mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: var(--admin-text);
}

.admin-mobile-brand img {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 8px 18px rgba(13, 27, 42, 0.12);
}

.admin-mobile-brand span {
  display: grid;
  min-width: 0;
}

.admin-mobile-brand strong,
.admin-mobile-brand small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-mobile-brand strong {
  font-size: 1rem;
  line-height: 1.2;
}

.admin-mobile-brand small {
  color: var(--admin-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-mobile-toggle-icon {
  display: inline-flex;
  width: 18px;
  flex-direction: column;
  gap: 4px;
}

.admin-mobile-toggle-icon span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.admin-mobile-close-icon {
  position: relative;
  display: block;
  width: 20px;
  height: 20px;
}

.admin-mobile-close-icon span {
  position: absolute;
  top: 9px;
  left: 0;
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.admin-mobile-close-icon span:first-child {
  transform: rotate(45deg);
}

.admin-mobile-close-icon span:last-child {
  transform: rotate(-45deg);
}

.admin-mobile-toggle strong {
  font-size: 0.92rem;
}

.admin-sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(13, 27, 42, 0.36);
  backdrop-filter: blur(2px);
}

.admin-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 100vh;
  padding: 28px 22px;
  border-right: 1px solid var(--admin-line);
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
}

.admin-sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: var(--admin-text);
}

.admin-sidebar-brand img {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
}

.admin-sidebar-brand span {
  display: grid;
  min-width: 0;
}

.admin-sidebar-brand strong,
.admin-sidebar-brand small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-sidebar-brand strong {
  font-size: 1.05rem;
  line-height: 1.15;
  font-weight: 800;
}

.admin-sidebar-brand small {
  color: var(--admin-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-nav {
  display: grid;
  gap: 10px;
  margin-top: 30px;
}

.admin-nav a {
  padding: 13px 16px;
  border-radius: 16px;
  font-weight: 700;
  color: var(--admin-muted);
}

.admin-nav a.is-active,
.admin-nav a:hover {
  background: rgba(247, 127, 0, 0.12);
  color: var(--admin-text);
}

.admin-menu-actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding-top: 24px;
}

.admin-menu-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 16px;
  font-weight: 800;
  border: 1px solid rgba(247, 127, 0, 0.2);
  color: #9a4b00;
  background: rgba(247, 127, 0, 0.08);
}

.admin-menu-action:hover,
.admin-menu-action.view-site {
  border-color: rgba(247, 127, 0, 0.42);
  background: linear-gradient(135deg, var(--admin-orange), #ff962e);
  color: #fff;
}

.admin-menu-action.logout {
  border-color: rgba(204, 56, 89, 0.2);
  background: rgba(204, 56, 89, 0.08);
  color: #9f2340;
}

.admin-menu-action.logout:hover {
  border-color: rgba(204, 56, 89, 0.42);
  background: #cc3859;
  color: #fff;
}

.admin-main {
  padding: 28px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.admin-topbar h1,
.admin-card-header h2 {
  margin: 0;
}

.admin-topbar-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

.admin-stats {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 22px;
}

.admin-card {
  padding: 24px;
  min-width: 0;
}

.admin-stats .admin-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.75rem;
}

.admin-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}

.admin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.admin-card-header.compact { margin-top: 12px; }

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

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 540px;
}

.admin-table th,
.admin-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--admin-line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--admin-muted);
}

.admin-actions-cell {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-blog-table {
  table-layout: fixed;
  min-width: 760px;
}

.admin-blog-table th:nth-child(1),
.admin-blog-table td:nth-child(1) {
  width: 31%;
}

.admin-blog-table th:nth-child(2),
.admin-blog-table td:nth-child(2) {
  width: 15%;
}

.admin-blog-table th:nth-child(3),
.admin-blog-table td:nth-child(3) {
  width: 31%;
}

.admin-blog-table th:nth-child(4),
.admin-blog-table td:nth-child(4) {
  width: 13%;
}

.admin-blog-table th:nth-child(5),
.admin-blog-table td:nth-child(5) {
  width: 10%;
}

.admin-blog-table td {
  vertical-align: middle;
}

.admin-table-clamp {
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.admin-table-code {
  font-family: "Manrope", sans-serif;
  color: var(--admin-muted);
}

.admin-empty-table {
  padding: 22px 10px !important;
  color: var(--admin-muted);
  font-weight: 800;
  text-align: center !important;
}

.admin-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(20, 33, 61, 0.08);
  color: var(--admin-text);
  font-size: 0.88rem;
  font-weight: 800;
  white-space: nowrap;
}

.admin-blog-table .admin-actions-cell {
  align-items: center;
  gap: 8px;
}

.admin-blog-table .admin-actions-cell,
.admin-blog-table .admin-actions-cell form {
  min-width: 0;
}

.admin-inline-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-users-table {
  min-width: 760px;
}

.admin-users-table td {
  vertical-align: middle;
}

.admin-role-form {
  gap: 8px;
  flex-wrap: nowrap;
}

.admin-role-select {
  min-width: 150px;
  height: 42px;
  padding: 0 36px 0 12px;
  border: 1px solid rgba(20, 33, 61, 0.16);
  border-radius: 12px;
  background: #fff;
  color: var(--admin-text);
  font: inherit;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(13, 27, 42, 0.05);
}

.admin-role-select:focus {
  outline: none;
  border-color: rgba(247, 127, 0, 0.62);
  box-shadow: 0 0 0 3px rgba(247, 127, 0, 0.14);
}

.admin-role-update {
  min-width: 98px;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
}

.admin-filter-bar {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid rgba(20, 33, 61, 0.09);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.74));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82);
}

.admin-filter-bar label {
  display: grid;
  gap: 6px;
  color: var(--admin-text);
  font-size: 0.88rem;
  font-weight: 800;
}

.admin-filter-bar input,
.admin-filter-bar select {
  height: 48px;
  min-width: 220px;
  padding: 0 14px;
  border: 1px solid rgba(20, 33, 61, 0.18);
  border-radius: 14px;
  background: #fff;
  color: var(--admin-text);
  font: inherit;
  box-shadow: 0 3px 12px rgba(13, 27, 42, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-filter-bar input {
  flex: 1 1 360px;
}

.dashboard-sales-filter {
  margin-bottom: 18px;
}

.dashboard-sales-controls {
  display: grid;
  gap: 14px;
}

.dashboard-quick-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard-quick-ranges a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(247, 127, 0, 0.22);
  border-radius: 8px;
  background: rgba(247, 127, 0, 0.08);
  color: #9a4b00;
  font-weight: 800;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.dashboard-quick-ranges a:hover,
.dashboard-quick-ranges a.is-active {
  border-color: rgba(247, 127, 0, 0.62);
  background: var(--admin-orange);
  color: #fff;
}

.dashboard-date-forms {
  display: grid;
  grid-template-columns: minmax(310px, 0.7fr) minmax(520px, 1.3fr);
  gap: 14px;
  align-items: stretch;
}

.dashboard-date-forms .admin-filter-bar {
  margin-bottom: 0;
  align-items: end;
}

.dashboard-sales-filter .admin-filter-bar input[type="date"] {
  min-width: 170px;
  flex: 0 0 190px;
}

.dashboard-single-date-filter label {
  flex: 1 1 190px;
}

.dashboard-range-filter label {
  flex: 1 1 180px;
}

.admin-filter-bar select {
  flex: 0 0 190px;
}

.admin-filter-bar input::placeholder {
  color: rgba(20, 33, 61, 0.5);
}

.admin-filter-bar input:focus,
.admin-filter-bar select:focus {
  outline: none;
  border-color: rgba(247, 127, 0, 0.62);
  box-shadow: 0 0 0 3px rgba(247, 127, 0, 0.14);
}

.admin-filter-bar .admin-link-button {
  height: 48px;
  width: auto;
  min-width: 130px;
  border-radius: 14px;
  padding: 0 22px;
  box-shadow: none;
}

.admin-pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 100%;
  margin-top: 18px;
  overflow: visible;
}

.admin-pagination a {
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(20, 33, 61, 0.08);
  font-weight: 800;
  padding: 0 14px;
}

.admin-pagination a.is-active {
  background: linear-gradient(135deg, var(--admin-orange), #ff962e);
  color: white;
}

.admin-pagination .is-disabled,
.admin-pagination-ellipsis {
  min-width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 14px;
  font-weight: 700;
  color: var(--admin-muted);
  background: rgba(20, 33, 61, 0.06);
}

.admin-pagination .is-disabled {
  opacity: 0.72;
}

.editor-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: -2px;
}

.editor-tool {
  padding: 10px 14px;
  border: 1px solid var(--admin-line);
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.editor-tool-select {
  min-width: 170px;
  border-radius: 14px;
  font-weight: 700;
}

.editor-tool:hover,
.editor-tool.is-active {
  border-color: rgba(247, 127, 0, 0.42);
  background: rgba(247, 127, 0, 0.1);
  color: #b75e00;
}

.editor-tool.is-mode-active {
  border-color: rgba(20, 33, 61, 0.25);
  background: rgba(20, 33, 61, 0.08);
  color: var(--admin-text);
}

.tiptap-editor pre {
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(20, 33, 61, 0.92);
  color: #f6f6f6;
  white-space: pre-wrap;
}

.tiptap-editor table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
}

.tiptap-editor th,
.tiptap-editor td {
  border: 1px solid rgba(20, 33, 61, 0.22);
  padding: 8px 10px;
  vertical-align: top;
}

.tiptap-editor th {
  background: rgba(247, 127, 0, 0.08);
  font-weight: 800;
}

.media-library {
  display: grid;
  gap: 14px;
}

.media-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--admin-line);
  border-radius: 18px;
  background: rgba(255,255,255,0.75);
}

.media-card-preview {
  min-height: 110px;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
}

.media-card-copy {
  display: grid;
  gap: 8px;
}

.media-card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.media-card-actions .admin-inline-form {
  margin: 0;
}

.media-delete-button {
  color: #c43d3d;
}

.media-delete-button:hover {
  color: #a62f2f;
}

.media-card-copy small {
  color: var(--admin-muted);
  word-break: break-all;
}

.admin-activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.admin-activity-list li {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--admin-line);
  display: grid;
  gap: 4px;
}

.admin-activity-list strong {
  color: var(--admin-orange);
  font-size: 0.82rem;
}

.admin-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-feature-grid article {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(20, 33, 61, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
}

.admin-feature-grid strong {
  color: var(--admin-text);
  font-size: 1rem;
}

.admin-feature-grid span {
  color: var(--admin-muted);
  line-height: 1.6;
}

.admin-subgrid,
.admin-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-settings-grid button {
  width: fit-content;
  align-self: start;
  justify-self: start;
  min-height: 0;
}

.settings-tab-layout {
  align-items: start;
}

.settings-tab-layout .admin-card-header {
  align-items: flex-start;
}

.settings-tab-layout .admin-card-header .admin-muted {
  flex-basis: 100%;
  margin: -6px 0 0;
}

.admin-settings-full,
.admin-settings-actions {
  grid-column: 1 / -1;
}

.admin-settings-full textarea {
  min-height: 150px;
}

.admin-settings-actions {
  display: flex;
  justify-content: flex-start;
  padding-top: 4px;
}

.settings-password-card {
  max-width: 980px;
  padding: 0;
  overflow: hidden;
}

.settings-password-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(320px, 1.2fr);
  gap: 28px;
  padding: 30px;
  align-items: start;
}

.settings-password-copy {
  padding: 22px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(247, 127, 0, 0.09), rgba(247, 127, 0, 0.03));
  border: 1px solid rgba(247, 127, 0, 0.14);
}

.settings-password-copy h2 {
  margin: 0 0 10px;
}

.settings-password-copy .admin-muted {
  margin: 0;
}

.settings-password-form {
  max-width: none;
}

.settings-password-form .admin-button {
  width: fit-content;
  min-width: 230px;
}

.settings-password-help {
  margin: 0;
  padding: 20px 30px;
  background: rgba(20, 33, 61, 0.035);
}

.settings-password-help .admin-muted {
  margin: 0;
}

.settings-password-help .admin-muted + .admin-muted {
  margin-top: 8px;
}

.admin-checkbox {
  display: flex !important;
  align-items: center;
  gap: 10px !important;
}

.admin-checkbox input {
  width: 18px;
  height: 18px;
}

.invoice-layout {
  grid-template-columns: 1.3fr 0.9fr;
}

.invoice-tab-layout {
  gap: 16px;
}

.admin-tab-layout {
  gap: 16px;
}

.admin-tabs {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(13, 27, 42, 0.08);
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}

.admin-tab-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
  color: var(--admin-muted);
  background: transparent;
  cursor: pointer;
}

.admin-tab-button:hover {
  color: var(--admin-text);
  background: rgba(20, 33, 61, 0.06);
}

.admin-tab-button.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--admin-orange), #ff962e);
}

.admin-tab-panel[hidden] {
  display: none !important;
}

.dashboard-tab-layout {
  margin-bottom: 22px;
}

.dashboard-main-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  padding: 6px;
  border-radius: 16px;
}

.dashboard-main-tabs .admin-tab-button {
  min-width: 0;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 12px;
  text-align: center;
  line-height: 1.2;
}

.products-tab-layout .product-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  padding: 6px;
  border-radius: 16px;
}

.products-tab-layout .product-tabs .admin-tab-button {
  min-width: 0;
  min-height: 48px;
  padding: 0 10px;
  border-radius: 12px;
  text-align: center;
  line-height: 1.2;
}

.bulk-import-layout {
  display: grid;
  gap: 16px;
}

.bulk-preview-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.bulk-preview-summary .admin-card {
  padding: 14px;
  border-radius: 14px;
}

.bulk-preview-summary span {
  display: block;
  color: var(--admin-muted);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.bulk-preview-summary strong {
  font-size: 1.15rem;
  color: var(--admin-text);
}

.bulk-preview-table {
  min-width: 820px;
}

.bulk-preview-table td[data-label="Status"] {
  font-weight: 800;
}

.bulk-skip-list {
  margin-top: 12px;
}

.bulk-skip-table {
  min-width: 760px;
}

.bulk-skip-table td[data-label="Reason"],
.bulk-preview-table td[data-label="Reason"] {
  color: var(--admin-muted);
  max-width: 280px;
}

.bulk-preview-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.bulk-preview-actions form {
  margin: 0;
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(20, 33, 61, 0.08);
  color: var(--admin-text);
  font-size: 0.88rem;
  font-weight: 800;
}

.invoice-tabs {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(13, 27, 42, 0.08);
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}

.invoice-tab-button {
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
  color: var(--admin-muted);
  background: transparent;
  cursor: pointer;
}

.invoice-tab-button:hover {
  color: var(--admin-text);
  background: rgba(20, 33, 61, 0.06);
}

.invoice-tab-button.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--admin-orange), #ff962e);
}

.invoice-tab-label-short {
  display: none;
}

.invoice-tab-panel[hidden] {
  display: none !important;
}

.invoice-latest-summary {
  margin-top: 18px;
}

.invoice-summary-number {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(247, 127, 0, 0.14);
  color: #b75e00;
  font-weight: 800;
}

.invoice-summary-actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.invoice-summary-actions .admin-link-button {
  min-height: 44px;
}

.invoice-inline-note {
  margin: -4px 0 8px;
}

.invoice-history-search-field {
  flex: 1 1 620px;
  min-width: min(100%, 520px);
}

.invoice-search-picker {
  position: relative;
  display: block;
}

.admin-filter-bar .invoice-search-picker {
  flex: 1 1 260px;
  min-width: 220px;
}

.invoice-search-picker input {
  width: 100%;
  min-width: 0;
}

.invoice-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  overflow: hidden;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 24px rgba(13, 27, 42, 0.12);
}

.invoice-search-dropdown[hidden] {
  display: none !important;
}

.invoice-search-options {
  display: block;
  max-height: 240px;
  overflow: auto;
}

.invoice-search-option {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(20, 33, 61, 0.08);
  background: #fff;
  text-align: left;
  padding: 10px 12px;
  font: inherit;
  color: var(--admin-text);
  cursor: pointer;
}

.invoice-search-option:last-child {
  border-bottom: 0;
}

.invoice-search-option:hover,
.invoice-search-option:focus {
  background: rgba(247, 127, 0, 0.1);
  outline: none;
}

.invoice-search-empty {
  display: block;
  padding: 12px;
  color: var(--admin-muted);
  font-weight: 700;
}

.invoice-search-empty[hidden] {
  display: none !important;
}

.invoice-history-search-form {
  align-items: end;
  margin-bottom: 0;
  display: flex;
  gap: 14px;
  flex-wrap: nowrap;
}

.invoice-history-search-form .admin-link-button {
  min-width: 160px;
}

.invoice-filter-clear {
  background: rgba(20, 33, 61, 0.08);
  color: var(--admin-text);
}

.invoice-history-controls {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-sales-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.dashboard-sales-controls .dashboard-filter-tabs {
  flex: 0 0 auto;
  padding: 4px;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(13, 27, 42, 0.06);
}

.dashboard-sales-controls .invoice-filter-tab {
  min-height: 40px;
  padding: 0 14px;
}

.dashboard-filter-panel:not([hidden]) {
  flex: 1 1 auto;
  min-width: 0;
}

.dashboard-filter-panel .dashboard-quick-ranges {
  align-items: center;
}

.dashboard-filter-panel .dashboard-date-forms {
  width: 100%;
}

.invoice-filter-tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 6px;
  border: 1px solid rgba(20, 33, 61, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 24px rgba(13, 27, 42, 0.08);
}

.invoice-filter-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--admin-muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.invoice-filter-tab:hover {
  color: var(--admin-text);
  background: rgba(20, 33, 61, 0.06);
}

.invoice-filter-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--admin-orange), #ff962e);
}

.invoice-filter-panel[hidden] {
  display: none !important;
}

.dashboard-filter-panel[hidden] {
  display: none !important;
}

.invoice-date-forms {
  grid-template-columns: minmax(310px, 0.7fr) minmax(520px, 1.3fr);
}

.invoice-company-picker {
  position: relative;
}

.invoice-company-trigger {
  width: 100%;
  min-height: 56px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 16px;
  background: rgba(255,255,255,0.92);
  color: var(--admin-text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  padding: 0 46px 0 14px;
  cursor: pointer;
  position: relative;
}

.invoice-company-trigger::after {
  content: "\25BE";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--admin-muted);
  font-size: 0.92rem;
}

.invoice-company-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 24px rgba(13, 27, 42, 0.12);
}

.invoice-company-search-wrap {
  padding: 10px;
  border-bottom: 1px solid rgba(20, 33, 61, 0.09);
}

.invoice-company-search-wrap input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(20, 33, 61, 0.16);
  border-radius: 12px;
  padding: 0 12px;
  font: inherit;
}

.invoice-company-options {
  max-height: 240px;
  overflow: auto;
}

.invoice-company-option {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(20, 33, 61, 0.08);
  background: #fff;
  text-align: left;
  padding: 10px 12px;
  font: inherit;
  color: var(--admin-text);
  cursor: pointer;
}

.invoice-company-option:last-child {
  border-bottom: 0;
}

.invoice-company-option:hover,
.invoice-company-option:focus {
  background: rgba(247, 127, 0, 0.1);
  outline: none;
}

.invoice-company-option.is-add-company {
  background: rgba(247, 127, 0, 0.12);
  color: #b75e00;
  font-weight: 800;
}

.invoice-company-empty {
  padding: 10px;
  border-top: 1px solid rgba(20, 33, 61, 0.09);
  display: grid;
  gap: 8px;
}

.invoice-company-empty[hidden] {
  display: none !important;
}

.invoice-company-empty p {
  margin: 0;
  color: var(--admin-muted);
  font-size: 0.92rem;
}

.invoice-company-empty .admin-link-button {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  padding: 0 14px;
}

.invoice-new-company-fields[hidden] {
  display: none !important;
}

.invoice-table-wrap {
  padding: 8px 0 2px;
}

.invoice-items-table {
  min-width: 980px;
}

.invoice-items-table thead th {
  padding-top: 8px;
  padding-bottom: 16px;
}

.invoice-items-table tbody tr {
  background: rgba(255, 255, 255, 0.72);
}

.invoice-items-table tbody td {
  padding-top: 14px;
  padding-bottom: 14px;
  vertical-align: top;
}

.invoice-field {
  min-width: 0;
  height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(247, 247, 247, 0.95));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

.invoice-name-field {
  min-width: 170px;
}

.invoice-code-field {
  min-width: 90px;
}

.invoice-price,
.invoice-gst,
.invoice-qty {
  min-width: 86px;
  text-align: center;
}

.invoice-product-select {
  min-width: 150px;
}

.invoice-product-picker {
  position: relative;
  min-width: 180px;
}

.invoice-product-trigger {
  width: 100%;
  min-height: 56px;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--admin-text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  padding: 0 44px 0 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-product-trigger::after {
  content: "\25BE";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--admin-muted);
  font-size: 0.92rem;
}

.invoice-product-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 45;
  border: 1px solid rgba(20, 33, 61, 0.14);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 24px rgba(13, 27, 42, 0.12);
}

.invoice-product-dropdown.is-floating {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  z-index: 1300;
}

.invoice-product-dropdown[hidden] {
  display: none !important;
}

.invoice-product-search-wrap {
  padding: 10px;
  border-bottom: 1px solid rgba(20, 33, 61, 0.09);
}

.invoice-product-search {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(20, 33, 61, 0.16);
  border-radius: 12px;
  padding: 0 12px;
  font: inherit;
}

.invoice-product-options {
  max-height: 220px;
  overflow: auto;
}

.invoice-product-option {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(20, 33, 61, 0.08);
  background: #fff;
  text-align: left;
  padding: 10px 12px;
  font: inherit;
  color: var(--admin-text);
  cursor: pointer;
}

.invoice-product-option:last-child {
  border-bottom: 0;
}

.invoice-product-option:hover,
.invoice-product-option:focus {
  background: rgba(247, 127, 0, 0.1);
  outline: none;
}

.invoice-product-option.is-custom-product {
  background: rgba(247, 127, 0, 0.12);
  color: #b75e00;
  font-weight: 800;
}

.invoice-product-more-hint {
  padding: 10px 12px;
  border-top: 1px solid rgba(20, 33, 61, 0.08);
  color: var(--admin-muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.invoice-product-empty {
  padding: 10px;
  border-top: 1px solid rgba(20, 33, 61, 0.09);
  display: grid;
  gap: 8px;
}

.invoice-product-empty[hidden] {
  display: none !important;
}

.invoice-product-empty p {
  margin: 0;
  color: var(--admin-muted);
  font-size: 0.92rem;
}

.invoice-product-custom-cta {
  width: 100%;
  min-height: 42px;
  border-radius: 12px;
  padding: 0 14px;
}

.invoice-line-total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  min-height: 56px;
  padding: 0 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(247, 127, 0, 0.1), rgba(252, 191, 73, 0.16));
  color: var(--admin-text);
  font-weight: 800;
  line-height: 1.3;
}

.remove-invoice-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 8px;
  white-space: nowrap;
}

.invoice-summary-box {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(247, 127, 0, 0.08);
}

.invoice-summary-box p { margin: 6px 0; }

.invoice-grand-row {
  margin-top: 12px !important;
  padding-top: 12px;
  border-top: 1px solid rgba(20, 33, 61, 0.1);
  font-size: 1.05rem;
}

.invoice-form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.invoice-form-actions .admin-button,
.invoice-form-actions .admin-link-button {
  flex: 1 1 220px;
}

.invoice-preview {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--admin-line);
}

.invoice-new-company-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.invoice-new-company-actions .admin-link-button {
  width: auto;
  min-width: 180px;
}

.invoice-new-company-actions .admin-field-hint {
  flex: 1 1 240px;
}

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

.admin-settings-help {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--admin-line);
}

@media (max-width: 1180px) {
  .admin-app {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--admin-line);
    display: block;
  }

  .admin-stats,
  .admin-two-col,
  .admin-subgrid,
  .admin-feature-grid,
  .admin-settings-grid {
    grid-template-columns: 1fr;
  }

  .admin-settings-full,
  .admin-settings-actions {
    grid-column: auto;
  }

  .admin-settings-actions .admin-button {
    width: 100%;
  }

  .settings-password-layout {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px;
  }

  .settings-password-copy {
    padding: 18px;
  }

  .settings-password-form .admin-button {
    width: 100%;
    min-width: 100%;
  }

  .settings-password-help {
    padding: 18px 20px;
  }
}

@media (max-width: 980px) {
  .admin-mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1120;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 78px;
    padding: 12px 18px;
    border: 0;
    border-bottom: 1px solid var(--admin-line);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(13, 27, 42, 0.08);
    backdrop-filter: blur(14px);
  }

  .admin-mobile-toggle {
    display: inline-flex;
    position: static;
    flex: 0 0 auto;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.66);
  }

  .admin-mobile-close {
    position: fixed;
    top: 50%;
    left: min(86vw, 340px);
    z-index: 1210;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: 1px solid rgba(20, 33, 61, 0.34);
    border-radius: 50%;
    background: #fff;
    color: var(--admin-text);
    box-shadow: 0 14px 28px rgba(13, 27, 42, 0.18);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.86);
    transition: opacity 0.16s ease, transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.18s ease;
  }

  .admin-app {
    display: block;
  }

  .admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1100;
    width: min(86vw, 340px);
    height: 100vh;
    min-height: 0;
    border-right: 1px solid var(--admin-line);
    border-bottom: 0;
    background: #fff;
    backdrop-filter: none;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    overflow-y: auto;
    padding-top: 24px;
    padding-bottom: 24px;
  }

  .admin-menu-actions {
    margin-top: 24px;
  }

  body.sidebar-open .admin-sidebar {
    transform: translateX(0);
  }

  body.sidebar-open .admin-sidebar-backdrop {
    top: 0;
  }

  body.sidebar-open .admin-mobile-header {
    left: 0;
    right: auto;
    top: 0;
    width: 0;
    height: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    pointer-events: none;
  }

  body.sidebar-open .admin-mobile-brand {
    display: none;
  }

  body.sidebar-open .admin-mobile-toggle {
    opacity: 0;
    pointer-events: none;
  }

  body.sidebar-open .admin-mobile-close {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
  }

  .admin-main {
    padding: 104px 18px 24px;
  }

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

  .admin-topbar-actions {
    width: 100%;
  }

  .admin-topbar-actions .admin-link-button {
    flex: 1 1 180px;
  }

  .invoice-preview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .admin-login-card,
  .admin-card {
    border-radius: 20px;
  }

  .admin-login-card,
  .admin-card,
  .admin-main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .admin-card {
    padding-top: 18px;
    padding-bottom: 18px;
  }

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

  .admin-related-card {
    grid-template-columns: 18px 78px minmax(0, 1fr);
    min-height: 104px;
  }

  .admin-related-card img {
    width: 78px;
    height: 78px;
  }

  .admin-mobile-toggle {
    padding: 10px 13px;
  }

  .admin-mobile-header {
    min-height: 70px;
    padding: 10px 14px;
    gap: 8px;
  }

  .admin-sidebar {
    top: 0;
    height: 100vh;
  }

  body.sidebar-open .admin-sidebar-backdrop {
    top: 0;
  }

  .admin-mobile-brand {
    gap: 8px;
  }

  .admin-mobile-brand img {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .admin-mobile-brand strong {
    font-size: 0.92rem;
  }

  .admin-mobile-brand small {
    font-size: 0.72rem;
  }

  .admin-form {
    gap: 14px;
  }

  .admin-form input,
  .admin-form textarea,
  .admin-form select {
    padding: 12px 13px;
    border-radius: 14px;
  }

  .tiptap-field-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .tiptap-field-header small {
    text-align: left;
  }

  .tiptap-toolbar {
    gap: 8px;
  }

  .tiptap-toolbar .editor-tool {
    flex: 1 1 auto;
  }

  .tiptap-toolbar .editor-tool-select {
    width: 100%;
    min-width: 100%;
  }

  .tiptap-editor,
  .tiptap-editor[contenteditable="true"] {
    min-height: 280px;
  }

  .tiptap-editor[contenteditable="true"] {
    padding: 17px;
  }

  .admin-button,
  .admin-link-button {
    width: 100%;
  }

  .admin-filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
  }

  .admin-filter-bar input,
  .admin-filter-bar select,
  .admin-filter-bar .invoice-search-picker {
    min-width: 100%;
    flex: 1 1 auto;
  }

  .admin-filter-bar .admin-link-button {
    width: 100%;
    min-width: 100%;
  }

  .invoice-history-search-form label,
  .invoice-history-search-field {
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
  }

  .invoice-history-search-form {
    display: grid;
    grid-template-columns: 1fr;
  }

  .invoice-date-forms {
    grid-template-columns: 1fr;
  }

  .invoice-filter-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .dashboard-filter-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-main-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .invoice-filter-tab {
    min-width: 0;
    padding: 0 8px;
    text-align: center;
    line-height: 1.2;
  }

  .invoice-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    padding: 6px;
    border-radius: 16px;
  }

  .invoice-tab-button {
    min-width: 0;
    min-height: 48px;
    padding: 0 10px;
    border-radius: 12px;
    text-align: center;
    line-height: 1.2;
  }

  .invoice-tab-label-full {
    display: none;
  }

  .invoice-tab-label-short {
    display: inline;
  }

  .settings-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    padding: 6px;
    border-radius: 16px;
  }

  .settings-tabs .admin-tab-button {
    min-width: 0;
    min-height: 48px;
    padding: 0 10px;
    border-radius: 12px;
    text-align: center;
    line-height: 1.2;
  }

  .demo-invoice-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    padding: 6px;
    border-radius: 16px;
  }

  .demo-invoice-tabs .admin-tab-button {
    min-width: 0;
    min-height: 48px;
    padding: 0 10px;
    border-radius: 12px;
    text-align: center;
    line-height: 1.2;
  }

  .company-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    padding: 6px;
    border-radius: 16px;
  }

  .company-tabs .admin-tab-button {
    min-width: 0;
    min-height: 48px;
    padding: 0 10px;
    border-radius: 12px;
    text-align: center;
    line-height: 1.2;
  }

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

  .product-tabs .admin-tab-button {
    min-width: 0;
    min-height: 48px;
    padding: 0 8px;
    border-radius: 12px;
    text-align: center;
    line-height: 1.2;
  }

  .dashboard-date-forms {
    grid-template-columns: 1fr;
  }

  .dashboard-quick-ranges a {
    flex: 1 1 100%;
  }

  .dashboard-sales-filter {
    overflow: hidden;
  }

  .dashboard-sales-filter .admin-card-header {
    margin-bottom: 16px;
  }

  .dashboard-sales-controls {
    gap: 12px;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .dashboard-quick-ranges {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .dashboard-date-forms {
    gap: 12px;
  }

  .dashboard-date-forms .admin-filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }

  .dashboard-date-forms .admin-filter-bar label {
    width: 100%;
    justify-items: stretch;
  }

  .dashboard-date-forms .admin-filter-bar label span {
    text-align: left;
  }

  .dashboard-sales-filter .admin-filter-bar input[type="date"] {
    width: 100%;
    min-width: 0;
    flex: none;
  }

  .dashboard-date-forms .admin-filter-bar .admin-link-button {
    min-height: 52px;
  }

  .admin-card-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-table {
    min-width: 480px;
  }

  .admin-company-table {
    min-width: 100%;
  }

  .admin-users-table {
    min-width: 680px;
  }

  .admin-role-form {
    flex-wrap: wrap;
  }

  .admin-blog-table-wrap {
    overflow-x: visible;
  }

  .admin-blog-table {
    min-width: 100%;
  }

  .admin-blog-table th:nth-child(1),
  .admin-blog-table td:nth-child(1),
  .admin-blog-table th:nth-child(2),
  .admin-blog-table td:nth-child(2),
  .admin-blog-table th:nth-child(3),
  .admin-blog-table td:nth-child(3),
  .admin-blog-table th:nth-child(4),
  .admin-blog-table td:nth-child(4),
  .admin-blog-table th:nth-child(5),
  .admin-blog-table td:nth-child(5) {
    width: 100%;
  }

  .admin-blog-table thead {
    display: none;
  }

  .admin-blog-table,
  .admin-blog-table tbody,
  .admin-blog-table tr,
  .admin-blog-table td {
    display: block;
    width: 100%;
  }

  .admin-blog-table tbody {
    display: grid;
    gap: 14px;
  }

  .admin-blog-table tr {
    padding: 14px;
    border: 1px solid var(--admin-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 10px 22px rgba(13, 27, 42, 0.05);
  }

  .admin-blog-table td {
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 9px 0;
    border-bottom: 1px solid rgba(20, 33, 61, 0.08);
  }

  .admin-blog-table td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .admin-blog-table td::before {
    content: attr(data-label);
    color: var(--admin-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.5;
    text-transform: uppercase;
  }

  .admin-blog-table .admin-table-clamp {
    line-clamp: 3;
    -webkit-line-clamp: 3;
  }

  .admin-blog-table .admin-actions-cell {
    display: grid;
    grid-template-columns: minmax(92px, 34%) minmax(0, 1fr);
    gap: 12px;
  }

  .admin-blog-table .admin-actions-cell::before {
    grid-row: 1 / span 2;
  }

  .admin-company-table thead {
    display: none;
  }

  .admin-company-table,
  .admin-company-table tbody,
  .admin-company-table tr,
  .admin-company-table td {
    display: block;
    width: 100%;
  }

  .admin-company-table tbody {
    display: grid;
    gap: 12px;
  }

  .admin-company-table tr {
    padding: 12px;
    border: 1px solid var(--admin-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 10px 22px rgba(13, 27, 42, 0.05);
  }

  .admin-company-table td {
    display: grid;
    grid-template-columns: minmax(76px, 32%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 9px 0;
    border-bottom: 1px solid rgba(20, 33, 61, 0.08);
    overflow-wrap: anywhere;
  }

  .admin-company-table td:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .admin-company-table td::before {
    content: attr(data-label);
    color: var(--admin-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.5;
    text-transform: uppercase;
  }

  .admin-company-table .admin-actions-cell {
    grid-template-columns: minmax(76px, 32%) minmax(0, 1fr);
  }

  .admin-company-table .admin-actions-cell::before {
    grid-row: 1 / span 2;
  }

  .admin-company-table .admin-empty-table {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    text-align: center !important;
  }

  .admin-company-table .admin-empty-table::before {
    content: none;
  }

  .invoice-items-table {
    min-width: 100%;
  }

  .invoice-items-table thead {
    display: none;
  }

  .invoice-items-table,
  .invoice-items-table tbody,
  .invoice-items-table tr,
  .invoice-items-table td {
    display: block;
    width: 100%;
  }

  .invoice-items-table tbody {
    display: grid;
    gap: 12px;
  }

  .invoice-items-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 10px;
    row-gap: 11px;
    border: 1px solid var(--admin-line);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 12px 26px rgba(13, 27, 42, 0.06);
  }

  .invoice-items-table tbody td {
    border-bottom: 0;
    padding: 0;
    margin-bottom: 0;
  }

  .invoice-items-table tbody td:nth-child(1),
  .invoice-items-table tbody td:nth-child(2) {
    grid-column: 1 / -1;
  }

  .invoice-items-table tbody td:last-child {
    margin-bottom: 0;
  }

  .invoice-items-table tbody td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--admin-muted);
  }

  .invoice-field,
  .invoice-line-total,
  .remove-invoice-row {
    width: 100%;
  }

  .invoice-field {
    height: 48px;
    min-height: 48px;
    border-radius: 14px;
  }

  .invoice-name-field,
  .invoice-code-field,
  .invoice-price,
  .invoice-gst,
  .invoice-qty,
  .invoice-product-select {
    min-width: 0;
  }

  .invoice-line-total {
    min-width: 0;
    min-height: 48px;
    border-radius: 14px;
    padding: 0 10px;
    font-size: 0.95rem;
  }

  .invoice-product-picker {
    min-width: 0;
  }

  .invoice-new-company-actions {
    display: grid;
    gap: 8px;
  }

  .invoice-new-company-actions .admin-link-button {
    width: 100%;
    min-width: 100%;
  }

  .invoice-new-company-actions .admin-field-hint {
    flex: none;
  }

  .remove-invoice-row {
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 10px;
    border: 1px solid rgba(247, 127, 0, 0.22);
    border-radius: 14px;
    background: rgba(247, 127, 0, 0.08);
  }

  .invoice-history-table-wrap,
  .invoice-preview-items-wrap {
    overflow-x: visible;
  }

  .invoice-history-table,
  .invoice-preview-items-table {
    min-width: 100%;
  }

  .invoice-history-table thead,
  .invoice-preview-items-table thead {
    display: none;
  }

  .invoice-history-table,
  .invoice-history-table tbody,
  .invoice-history-table tr,
  .invoice-history-table td,
  .invoice-preview-items-table,
  .invoice-preview-items-table tbody,
  .invoice-preview-items-table tr,
  .invoice-preview-items-table td {
    display: block;
    width: 100%;
  }

  .invoice-history-table tbody,
  .invoice-preview-items-table tbody {
    display: grid;
    gap: 12px;
  }

  .invoice-history-table tr,
  .invoice-preview-items-table tr {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--admin-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 10px 22px rgba(13, 27, 42, 0.05);
  }

  .invoice-history-table td,
  .invoice-preview-items-table td {
    display: grid;
    grid-template-columns: minmax(86px, 32%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 0;
    border-bottom: 0;
    overflow-wrap: anywhere;
  }

  .invoice-history-table .admin-empty-table {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    text-align: center !important;
  }

  .invoice-history-table .admin-empty-table::before {
    content: none;
  }

  .invoice-history-table td::before,
  .invoice-preview-items-table td::before {
    content: attr(data-label);
    color: var(--admin-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.5;
    text-transform: uppercase;
  }

  .invoice-history-table td[data-label="Action"] .admin-link-inline {
    width: fit-content;
  }

  .media-card {
    grid-template-columns: 1fr;
  }

  .bulk-preview-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bulk-preview-table {
    min-width: 680px;
  }

  .bulk-skip-table {
    min-width: 680px;
  }

  .admin-stats .admin-card strong {
    font-size: 1.45rem;
  }

  .admin-subgrid,
  .admin-settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .admin-login-page {
    padding: 14px;
  }

  .admin-main {
    padding: 86px 12px 18px;
  }

  .admin-mobile-toggle strong {
    display: none;
  }

  .admin-mobile-toggle {
    width: 44px;
    height: 44px;
    justify-content: center;
    padding: 0;
  }

  .admin-mobile-close {
    left: min(92vw, 320px);
    width: 52px;
    height: 52px;
  }

  .admin-card,
  .admin-login-card {
    padding: 16px;
  }

  .admin-topbar h1 {
    font-size: 1.7rem;
  }

  .admin-sidebar {
    width: min(92vw, 320px);
    padding-left: 16px;
    padding-right: 16px;
  }

  .admin-nav a {
    padding: 12px 14px;
  }

  .admin-table {
    min-width: 420px;
  }

  .product-tabs {
    grid-template-columns: 1fr;
  }

  .bulk-preview-summary {
    grid-template-columns: 1fr;
  }

  .bulk-preview-actions {
    justify-content: stretch;
  }

  .bulk-preview-actions form,
  .bulk-preview-actions .admin-button,
  .bulk-preview-actions .admin-link-button {
    width: 100%;
  }

  .admin-blog-table,
  .invoice-history-table,
  .invoice-preview-items-table {
    min-width: 100%;
  }

  .invoice-summary-box {
    padding: 14px 15px;
  }
}

@media print {
  .admin-mobile-toggle,
  .admin-sidebar-backdrop,
  .admin-sidebar,
  .admin-topbar,
  .admin-alert,
  .admin-form,
  .admin-card-header .admin-link-button,
  .admin-card:not(.invoice-preview-card) > :not(.invoice-preview) {
    display: none !important;
  }

  body {
    background: white;
  }

  .admin-main,
  .admin-card,
  .invoice-preview {
    padding: 0;
    box-shadow: none;
    border: 0;
    background: white;
  }
}
