html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

:root {
  --app-bg: #f6f1ea;
  --panel-bg: rgba(255, 255, 255, 0.96);
  --panel-border: rgba(31, 24, 20, 0.1);
  --text-main: #171412;
  --text-muted: #74695f;
  --brand-1: #f36f21;
  --brand-2: #ff9d42;
  --brand-3: #111111;
  --success-soft: #dcfce7;
  --success-text: #166534;
  --danger-soft: #fee2e2;
  --danger-text: #991b1b;
  --shadow-soft: 0 24px 60px rgba(58, 34, 9, 0.12);
  --shadow-card: 0 12px 30px rgba(36, 21, 6, 0.08);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

body.app-body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(243, 111, 33, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(255, 157, 66, 0.12), transparent 24%),
    linear-gradient(180deg, #fbf5ee 0%, #f7efe7 22%, #f4eee9 100%);
  color: var(--text-main);
  font-family: "Segoe UI", Arial, sans-serif;
}

a {
  text-decoration: none;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 290px;
  padding: 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  background: linear-gradient(180deg, rgba(17, 17, 17, 0.98), rgba(34, 29, 25, 0.96));
  backdrop-filter: blur(18px);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  position: sticky;
  top: 0;
  height: 100vh;
}

.app-brand-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #fff;
}

.app-brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  color: #111;
  box-shadow: 0 15px 30px rgba(243, 111, 33, 0.28);
}

.app-brand-title,
.app-brand-subtitle {
  display: block;
}

.app-brand-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.app-brand-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.62);
}

.app-nav {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.app-nav-link {
  padding: 0.95rem 1rem;
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
  transition: all 0.2s ease;
}

.app-nav-link:hover,
.app-nav-link.active {
  color: #111;
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  box-shadow: 0 10px 25px rgba(243, 111, 33, 0.24);
}

.app-sidebar-footer {
  margin-top: auto;
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.app-main-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  padding: 2rem 2.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  color: var(--text-main);
}

.app-topbar-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.app-topbar-subtitle {
  color: rgba(255, 255, 255, 0.7);
}

.app-user-panel {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.app-user-chip {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--panel-border);
}

.app-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(243, 111, 33, 0.14);
  color: var(--brand-1);
  font-weight: 700;
}

.app-user-name {
  font-weight: 700;
}

.app-user-role {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.85rem;
}

.app-content {
  flex: 1;
  padding: 1rem 2.5rem 2.5rem;
}

.app-footer {
  display: flex;
  padding: 0 2.5rem 2rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.status-banner,
.surface-card,
.stat-card {
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
}

.surface-card,
.stat-card,
.status-banner {
  border-radius: var(--radius-xl);
}

.surface-card-body,
.stat-card-body {
  padding: 1.6rem;
}

.status-banner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem 1.2rem;
  margin-bottom: 1.25rem;
  color: var(--success-text);
}

.status-banner-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.14);
}

.hero-panel,
.page-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 2rem;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 245, 238, 0.98));
  color: var(--text-main);
  border: 1px solid rgba(17, 17, 17, 0.08);
  border-top: 5px solid var(--brand-1);
  box-shadow: var(--shadow-soft);
}

.hero-badge,
.page-hero-kicker,
.section-kicker {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(243, 111, 33, 0.12);
  color: var(--brand-1);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 0.85rem;
}

.hero-title,
.page-hero-title {
  font-size: clamp(2rem, 2.4vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.hero-description,
.page-hero-text,
.section-description {
  max-width: 760px;
  color: var(--text-muted);
}

.hero-stats,
.hero-actions,
.page-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.hero-stat-card,
.metric-pill {
  min-width: 120px;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  background: rgba(17, 17, 17, 0.94);
  border: 1px solid rgba(17, 17, 17, 0.06);
}

.hero-stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.72);
}

.hero-stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.metric-pill {
  color: #fff;
  font-weight: 700;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem 1.5rem;
  color: rgba(255, 255, 255, 0.84);
}

.section-heading,
.form-section-heading {
  margin-bottom: 1.25rem;
}

.section-title,
.form-section-heading h2 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-main);
}

.section-description,
.form-section-heading p,
.table-subtitle {
  color: var(--text-muted);
}

.home-carousel {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.login-stage {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
}

.login-stage-background {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.login-stage-content,
.login-hero-panel {
  position: relative;
  z-index: 1;
}

.login-hero-panel {
  background: linear-gradient(135deg, rgba(17, 17, 17, 0.98), rgba(47, 35, 27, 0.96));
  color: #fff;
  border-top-color: var(--brand-1);
}

.login-showcase {
  backdrop-filter: blur(18px);
}

.login-orb,
.login-line {
  position: absolute;
  opacity: 0.55;
}

.login-orb {
  border-radius: 999px;
  filter: blur(8px);
  animation: loginFloat 14s ease-in-out infinite;
}

.login-orb-1 {
  top: 2rem;
  right: 10%;
  width: 13rem;
  height: 13rem;
  background: radial-gradient(circle, rgba(243, 111, 33, 0.7), rgba(243, 111, 33, 0));
}

.login-orb-2 {
  bottom: 8%;
  left: 6%;
  width: 18rem;
  height: 18rem;
  background: radial-gradient(circle, rgba(255, 157, 66, 0.58), rgba(255, 157, 66, 0));
  animation-duration: 18s;
}

.login-orb-3 {
  top: 34%;
  left: 45%;
  width: 10rem;
  height: 10rem;
  background: radial-gradient(circle, rgba(17, 17, 17, 0.42), rgba(17, 17, 17, 0));
  animation-duration: 12s;
}

.login-line {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(243, 111, 33, 0.5), transparent);
  animation: loginSweep 16s linear infinite;
}

.login-line-1 {
  top: 22%;
  left: -10%;
  width: 60%;
}

.login-line-2 {
  bottom: 16%;
  right: -8%;
  width: 50%;
  animation-duration: 20s;
  animation-direction: reverse;
}

.home-slide-image {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.feature-grid,
.quick-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.feature-card,
.quick-link-card {
  padding: 1.15rem 1.2rem;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(251, 245, 238, 0.94));
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.feature-card h3,
.quick-link-title {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.feature-card p,
.quick-link-text,
.profile-list dt {
  color: var(--text-muted);
}

.quick-link-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.quick-link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 26px rgba(15, 23, 42, 0.1);
}

.profile-list {
  display: grid;
  gap: 1rem;
}

.profile-list div {
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.profile-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.profile-list dt {
  font-size: 0.88rem;
  margin-bottom: 0.2rem;
}

.profile-list dd {
  margin: 0;
  font-weight: 600;
}

.stat-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 250, 252, 0.88));
}

.stat-card-label {
  color: var(--text-muted);
  font-size: 0.92rem;
}

.stat-card-value {
  font-size: clamp(2rem, 2vw, 2.8rem);
  font-weight: 700;
  line-height: 1;
}

.table-widget .surface-card-body {
  padding: 1.35rem;
}

.table-toolbar,
.table-footer {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
}

.table-toolbar {
  margin-bottom: 1rem;
}

.table-search-group {
  flex: 1 1 340px;
}

.table-toolbar-side {
  display: flex;
  align-items: end;
  gap: 1rem;
  flex-wrap: wrap;
}

.table-control-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.table-search-input,
.table-select,
.form-control,
.form-select {
  border-radius: 16px;
  border: 1px solid rgba(17, 17, 17, 0.14);
  padding: 0.8rem 1rem;
  box-shadow: none;
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(243, 111, 33, 0.58);
  box-shadow: 0 0 0 4px rgba(243, 111, 33, 0.12);
}

.modern-table-wrap {
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.modern-table {
  margin-bottom: 0;
  background: #fff;
}

.modern-table thead th {
  white-space: nowrap;
  padding: 1rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: #fbf5ee;
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.modern-table tbody td {
  padding: 1rem;
  vertical-align: middle;
  white-space: nowrap;
  border-color: rgba(148, 163, 184, 0.12);
}

.news-table {
  table-layout: fixed;
}

.news-table th:nth-child(1),
.news-table td:nth-child(1) {
  width: 10rem;
}

.news-table th:nth-child(2),
.news-table td:nth-child(2) {
  width: 34%;
}

.news-table-title-cell,
.news-table-owner-cell {
  white-space: normal;
  word-break: break-word;
}

.news-table-title-cell .table-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.modern-table tbody tr:hover {
  background: rgba(243, 111, 33, 0.05);
}

.table-id {
  display: inline-flex;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(243, 111, 33, 0.12);
  color: var(--brand-1);
  font-weight: 700;
}

.table-link {
  color: inherit;
  text-decoration: none;
}

.table-link:hover .table-title,
.table-link:hover .table-id {
  opacity: 0.85;
}

.table-title {
  font-weight: 700;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
}

.status-pill.active {
  background: var(--success-soft);
  color: var(--success-text);
}

.status-pill.inactive {
  background: var(--danger-soft);
  color: var(--danger-text);
}

.status-toggle-form {
  margin: 0;
}

.status-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.status-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.status-switch-slider {
  position: relative;
  width: 3.25rem;
  height: 1.8rem;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s ease;
}

.status-switch-slider::after {
  content: "";
  position: absolute;
  top: 0.2rem;
  left: 0.22rem;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
  transition: transform 0.2s ease;
}

.status-switch input:checked + .status-switch-slider {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
}

.status-switch input:checked + .status-switch-slider::after {
  transform: translateX(1.4rem);
}

.status-switch-label {
  min-width: 4.75rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.table-actions {
  display: inline-flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.table-results-text,
.table-page-indicator {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.table-empty-cell {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.editor-form .text-danger.mb-3 {
  width: 100%;
}

.editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-card);
  position: sticky;
  bottom: 1rem;
}

.preview-image {
  max-width: 320px;
  max-height: 200px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 18px;
  padding: 0.35rem;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.multi-select-list {
  min-height: 12rem;
}

.html-editor {
  display: grid;
  gap: 0.9rem;
}

.html-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.html-editor-input {
  min-height: 20rem;
  font-family: Consolas, "Courier New", monospace;
}

.html-editor-preview-wrap {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  overflow: hidden;
}

.html-editor-preview-title {
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(248, 250, 252, 0.92);
}

.html-editor-preview {
  min-height: 14rem;
  padding: 1rem;
  color: var(--text-main);
}

.html-editor-preview p:last-child {
  margin-bottom: 0;
}

.html-editor-empty {
  margin: 0;
  color: var(--text-muted);
  font-style: italic;
}

@keyframes loginFloat {
  0%, 100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -16px, 0) scale(1.08);
  }
}

@keyframes loginSweep {
  0% {
    transform: translateX(0);
    opacity: 0.1;
  }
  50% {
    opacity: 0.55;
  }
  100% {
    transform: translateX(18%);
    opacity: 0.1;
  }
}

textarea.form-control {
  white-space: pre-wrap;
}

.btn {
  border-radius: 14px;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand-1), var(--brand-2));
  border: 0;
  color: #111;
  box-shadow: 0 14px 28px rgba(243, 111, 33, 0.22);
}

.btn-primary:hover,
.btn-primary:focus {
  background: linear-gradient(135deg, #dd641a, #f58c2a);
  color: #111;
}

.btn-outline-primary {
  border-color: rgba(243, 111, 33, 0.45);
  color: var(--brand-1);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
  background: rgba(243, 111, 33, 0.08);
  border-color: var(--brand-1);
  color: #bb5416;
}

.btn-outline-light {
  border-color: rgba(17, 17, 17, 0.16);
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.9);
}

.btn-outline-light:hover,
.btn-outline-light:focus {
  border-color: var(--brand-1);
  color: var(--brand-1);
  background: #fff7f1;
}

@media (max-width: 1199.98px) {
  .app-sidebar {
    position: static;
    width: 100%;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  }

  .app-shell {
    flex-direction: column;
  }
}

@media (max-width: 767.98px) {
  .app-topbar,
  .app-content,
  .app-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero-panel,
  .page-hero,
  .table-toolbar,
  .table-footer,
  .app-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .app-user-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .editor-actions {
    position: static;
    flex-direction: column;
  }

  .news-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .news-table,
  .news-table thead,
  .news-table tbody,
  .news-table th,
  .news-table td,
  .news-table tr {
    display: block;
    width: 100%;
  }

  .news-table thead {
    display: none;
  }

  .news-table tbody {
    display: grid;
    gap: 1rem;
  }

  .news-table tbody tr {
    border: 1px solid rgba(17, 17, 17, 0.08);
    border-radius: 20px;
    background: #fff;
    box-shadow: var(--shadow-card);
    overflow: hidden;
  }

  .news-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    white-space: normal;
    text-align: left;
  }

  .news-table tbody td::before {
    content: attr(data-label);
    flex: 0 0 6.5rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }

  .news-table-title-cell,
  .news-table-owner-cell,
  .news-table-actions-cell {
    align-items: flex-start;
  }

  .news-table-title-cell .table-link,
  .news-table-owner-cell,
  .news-table-actions-cell .table-actions,
  .news-table tbody td form {
    flex: 1 1 auto;
    min-width: 0;
  }

  .news-table-actions-cell .table-actions {
    justify-content: flex-start;
  }

  .status-switch {
    flex-wrap: wrap;
  }
}
