:root {
  --orange: #f57c00;
  --orange-dark: #ef6c00;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #dbe1ea;
  --bg: #f6efe7;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Times New Roman", Times, serif;
  color: var(--text);
  background: #f5f7fb;
}

body.login-page {
  background: radial-gradient(
      1200px 600px at 20% 10%,
      #fff2e6 0%,
      rgba(255, 242, 230, 0) 60%
    ),
    radial-gradient(
      900px 500px at 80% 50%,
      #ffe9d6 0%,
      rgba(255, 233, 214, 0) 58%
    ),
    linear-gradient(180deg, #fbf7f2 0%, var(--bg) 100%);
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

body.login-page .card {
  width: min(1020px, 100%);
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.18);
  display: grid;
  grid-template-columns: 420px 1fr;
  min-height: 520px;
}

body.login-page .left {
  background: var(--orange);
  color: #fff;
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 54px 42px 34px;
}

body.login-page .brand h1 {
  font-size: 44px;
  line-height: 1.06;
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.5px;
}

body.login-page .brand p {
  margin: 0;
  font-size: 18px;
  opacity: 0.92;
}

body.login-page .illustration {
  margin-top: 18px;
  display: grid;
  place-items: center;
}

body.login-page .illustration svg,
body.login-page .illustration img {
  width: min(280px, 100%);
  height: auto;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.2));
}

body.login-page .right {
  padding: 56px 60px 34px;
  display: grid;
  align-content: start;
  gap: 18px;
}

body.login-page .right h2 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

body.login-page .field {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

body.login-page label {
  font-size: 13px;
  color: #374151;
}

body.login-page input[type="text"],
body.login-page input[type="password"] {
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  padding: 0 14px;
  font-size: 15px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

body.login-page input[type="text"]::placeholder,
body.login-page input[type="password"]::placeholder {
  color: #9ca3af;
}

body.login-page input[type="text"]:focus,
body.login-page input[type="password"]:focus {
  border-color: rgba(245, 124, 0, 0.65);
  box-shadow: 0 0 0 4px rgba(245, 124, 0, 0.14);
}

body.login-page .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

body.login-page .remember {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  user-select: none;
}

body.login-page .remember input {
  width: 14px;
  height: 14px;
  accent-color: var(--orange);
}

body.login-page .forgot {
  font-size: 14px;
  color: var(--orange);
  text-decoration: none;
}

body.login-page .forgot:hover {
  text-decoration: underline;
}

body.login-page .btn {
  margin-top: 14px;
  height: 46px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: background 140ms ease, transform 80ms ease;
}

body.login-page .btn:hover {
  background: var(--orange-dark);
}

body.login-page .btn:active {
  transform: translateY(1px);
}

body.login-page .footer {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 900px) {
  body.login-page .card {
    grid-template-columns: 1fr;
  }
  body.login-page .left {
    padding: 38px 28px 18px;
  }
  body.login-page .brand h1 {
    font-size: 38px;
  }
  body.login-page .right {
    padding: 34px 28px 26px;
  }
  body.login-page .illustration {
    margin-top: 8px;
  }
}

body.home-page {
  background: radial-gradient(
      900px 500px at 12% 10%,
      #e9f1ff 0%,
      rgba(233, 241, 255, 0) 60%
    ),
    radial-gradient(
      900px 520px at 84% 20%,
      #f2f6ff 0%,
      rgba(242, 246, 255, 0) 62%
    ),
    #f6f8fc;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.topbar-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  min-width: 0;
  flex: 0 1 auto;
}

.site-brand svg,
.site-brand img {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, 0.14));
  object-fit: contain;
}

.brand-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-weight: 900;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.brand-title .name {
  color: var(--orange);
  font-size: 14px;
}

.brand-title .sub {
  color: #111827;
  font-size: 12px;
  font-weight: 800;
  opacity: 0.7;
}

.brand-slogan {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: #6b7280;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
  white-space: nowrap;
  transition: background 140ms ease, color 140ms ease;
}

.nav a:hover {
  color: #111827;
  background: rgba(15, 23, 42, 0.05);
}

.nav a.has-caret::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #9ca3af;
  transform: translateY(1px);
}

.nav a.has-caret:hover::after {
  border-top-color: #6b7280;
}

.nav a::before {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 4px;
  height: 2px;
  border-radius: 999px;
  background: transparent;
  transition: background 140ms ease;
}

.nav a:hover::before {
  background: rgba(245, 124, 0, 0.7);
}

.nav-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.6px;
  text-decoration: none;
}

.nav-btn:hover {
  background: var(--orange-dark);
}

.mobile-nav {
  display: none;
  margin-left: auto;
  position: relative;
}

.mobile-nav summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(255, 255, 255, 0.8);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}

.mobile-nav summary::-webkit-details-marker {
  display: none;
}

.mobile-nav summary::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #6b7280;
  transform: translateY(1px);
}

.mobile-nav[open] summary {
  background: rgba(15, 23, 42, 0.06);
}

.mobile-nav-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 240px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 14px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
  padding: 10px;
  display: grid;
  gap: 6px;
}

.mobile-nav-menu a {
  text-decoration: none;
  color: #111827;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 10px;
  border-radius: 12px;
}

.mobile-nav-menu a:hover {
  background: rgba(15, 23, 42, 0.06);
}

.page {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 18px 28px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.06);
}

.page-head h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.2px;
}

.page-head p {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 13px;
}

.quick-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.panel {
  grid-column: span 4;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 16px;
  padding: 16px 16px;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.06);
  text-decoration: none;
  color: inherit;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.panel:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 124, 0, 0.35);
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.09);
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-title strong {
  font-size: 14px;
  font-weight: 900;
}

.panel-desc {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 980px) {
  .topbar-inner {
    flex-wrap: wrap;
    gap: 12px;
  }
  .nav-btn {
    margin-left: auto;
  }
}

@media (max-width: 860px) {
  .topbar-inner {
    padding: 12px 14px;
  }
  .brand-slogan {
    display: none;
  }
  .nav {
    display: none;
  }
  .mobile-nav {
    display: inline-flex;
  }
  .page {
    padding: 14px 14px 22px;
  }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .quick-grid {
    grid-template-columns: 1fr;
  }
  .panel {
    grid-column: auto;
  }
}

body.dashboard-page {
  background: #eef2f7;
}

.dashboard {
  min-height: 100vh;
  display: flex;
}

.sidebar {
  width: 270px;
  background: #1f2a37;
  color: #e5e7eb;
  padding: 18px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  padding: 8px 10px;
  border-radius: 12px;
}

.sidebar-brand:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-brand img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  flex: 0 0 auto;
}

.sidebar-brand-title {
  font-weight: 900;
  letter-spacing: 0.6px;
  font-size: 14px;
  white-space: nowrap;
}

.sidebar-nav {
  display: grid;
  gap: 10px;
  margin-top: 6px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  align-content: start;
  grid-auto-rows: max-content;
}

.sidebar-nav::-webkit-scrollbar {
  width: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  border: 2px solid rgba(31, 42, 55, 1);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: #dbeafe;
  font-weight: 700;
  font-size: 14px;
  background: transparent;
  transition: background 140ms ease, color 140ms ease;
}

.sidebar-link.has-submenu {
  justify-content: space-between;
}

.sidebar-link-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.sidebar-caret {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid rgba(219, 234, 254, 0.75);
  transition: transform 120ms ease, border-top-color 120ms ease;
}

.sidebar-link.has-submenu.is-open .sidebar-caret {
  transform: rotate(180deg);
  border-top-color: rgba(255, 255, 255, 0.9);
}

.sidebar-submenu {
  display: none;
  gap: 6px;
  margin-left: 28px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-submenu.is-open {
  display: grid;
}

.sidebar-sublink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: rgba(219, 234, 254, 0.92);
  font-size: 13px;
  font-weight: 700;
  background: transparent;
}

.sidebar-sublink:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.sidebar-sublink.active {
  background: rgba(245, 124, 0, 0.18);
  color: #ffffff;
}

.sidebar-sublink .sidebar-caret {
  margin-left: 8px;
  opacity: 0.5;
  transition: transform 0.2s, opacity 0.2s;
}

.sidebar-sublink.is-open .sidebar-caret {
  transform: rotate(180deg);
  opacity: 1;
}

.sidebar-child-menu {
  display: none;
  margin-left: 15px;
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 2px;
  margin-bottom: 5px;
}

.sidebar-child-menu.is-open {
  display: grid;
  gap: 2px;
}

.sidebar-child-link {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(219, 234, 254, 0.75);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}

.sidebar-child-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.sidebar-child-link.active {
  color: var(--orange);
  background: rgba(245, 124, 0, 0.1);
}

/* File list grouping */
.file-group-container {
  margin-bottom: 20px;
}

.file-group-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--orange);
  padding: 8px 12px;
  background: rgba(245, 124, 0, 0.05);
  border-radius: 8px;
  margin-bottom: 8px;
  border-left: 3px solid var(--orange);
}

.file-list-group .hoso-file-item {
  margin-left: 5px;
}


.sidebar-subempty {
  padding: 8px 10px;
  color: rgba(219, 234, 254, 0.7);
  font-size: 13px;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.sidebar-link.active {
  background: var(--orange);
  color: #ffffff;
}

.sidebar-link.is-disabled {
  opacity: 0.55;
}

.sidebar-link.is-disabled:hover {
  background: transparent;
  color: #dbeafe;
}

.sidebar-ico {
  width: 18px;
  display: inline-flex;
  justify-content: center;
}

.dashboard-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dashboard-header {
  height: 66px;
  background: #ffffff;
  border-bottom: 3px solid var(--orange);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  gap: 14px;
}

.dashboard-header h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.3px;
  color: #111827;
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: var(--orange);
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  font-size: 13px;
}

.logout-btn:hover {
  background: var(--orange-dark);
}

.dashboard-content {
  padding: 18px 22px 28px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 18px;
  align-items: start;
}

.feature-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 18px 18px;
  border: 1px solid rgba(17, 24, 39, 0.06);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.06);
  text-decoration: none;
  color: inherit;
  min-height: 110px;
  display: grid;
  align-content: start;
  gap: 10px;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.feature-card strong {
  font-size: 18px;
  font-weight: 900;
}

.feature-card span {
  color: #6b7280;
  font-size: 14px;
}

.feature-card:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 124, 0, 0.35);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.09);
}

.catalog {
  margin-top: 18px;
  background: #ffffff;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 16px;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.catalog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.catalog-title {
  display: grid;
  gap: 4px;
}

.catalog-title strong {
  font-size: 16px;
  font-weight: 900;
}

.catalog-title span {
  font-size: 13px;
  color: #6b7280;
}

.catalog-close {
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(15, 23, 42, 0.04);
  font-weight: 800;
  cursor: pointer;
}

.catalog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.catalog-tabs .tab {
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(15, 23, 42, 0.03);
  font-weight: 800;
  cursor: pointer;
}

.catalog-tabs .tab.active {
  background: rgba(245, 124, 0, 0.16);
  border-color: rgba(245, 124, 0, 0.35);
  color: #111827;
}

.catalog-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.catalog-search {
  flex: 1 1 auto;
  min-width: 180px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  padding: 0 12px;
  outline: none;
}

.catalog-add {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 0;
  background: var(--orange);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.catalog-add:hover {
  background: var(--orange-dark);
}

.catalog-body {
  padding: 14px 16px 16px;
}

.catalog-table {
  width: 100%;
  overflow: auto;
}

.settings {
  margin-top: 18px;
  background: #ffffff;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 16px;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.settings-title {
  display: grid;
  gap: 4px;
}

.settings-title strong {
  font-size: 16px;
  font-weight: 900;
}

.settings-title span {
  font-size: 13px;
  color: #6b7280;
}

.settings-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.settings-controls .form-row {
  margin: 0;
  width: 240px;
}

.settings-controls .form-row select {
  width: 100%;
}

.settings-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.settings-add select {
  flex: 1 1 320px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  padding: 0 12px;
  outline: none;
}

.file-upload {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.file-upload input[type='file'] {
  max-width: 260px;
}

.file-list {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.file-name-input {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 13px;
  width: 180px;
  outline: none;
}

.file-name-input:focus {
  border-color: var(--orange);
}

.file-item a {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #2563eb;
  text-decoration: none;
}

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

.data-table th,
.data-table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.data-table th {
  color: #111827;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.03);
}

.cell-actions {
  white-space: nowrap;
  text-align: right;
}

.row-btn {
  height: 30px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(15, 23, 42, 0.03);
  font-weight: 800;
  cursor: pointer;
  margin-left: 8px;
}

.row-btn.danger {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.25);
  color: #991b1b;
}

.row-btn.warn {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.26);
  color: #92400e;
}

[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(2px);
}

.modal-dialog {
  position: relative;
  width: min(520px, 100%);
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.25);
  overflow: hidden;
}

.modal-dialog.large {
  width: min(860px, 100%);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.modal-head strong {
  font-size: 16px;
  font-weight: 900;
}

.modal-x {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(15, 23, 42, 0.03);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.modal-body {
  padding: 16px 16px 14px;
  display: grid;
  gap: 14px;
}

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

.form-row {
  display: grid;
  gap: 8px;
}

.form-row label {
  font-weight: 900;
  font-size: 14px;
  color: #111827;
}

.form-row input {
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  padding: 0 12px;
  outline: none;
}

.form-row select {
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  padding: 0 10px;
  outline: none;
  background: #ffffff;
}

.form-row input:focus {
  border-color: rgba(245, 124, 0, 0.55);
  box-shadow: 0 0 0 4px rgba(245, 124, 0, 0.14);
}

.form-row select:focus {
  border-color: rgba(245, 124, 0, 0.55);
  box-shadow: 0 0 0 4px rgba(245, 124, 0, 0.14);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

.btn-secondary {
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: rgba(15, 23, 42, 0.03);
  font-weight: 900;
  cursor: pointer;
}

.btn-primary {
  height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  border: 0;
  background: var(--orange);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--orange-dark);
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

.hoso-filters {
  padding: 12px;
  background: #fdfdfd;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-row-compact label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  white-space: nowrap;
}

.form-row-compact select {
  flex: 1;
  padding: 4px 8px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: #fff;
  max-width: 180px;
}

.hoso-main {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  height: calc(100vh - 140px);
  min-height: 600px;
}

.hoso-sidebar {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hoso-section-title {
  padding: 14px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-weight: 800;
  color: var(--text);
  font-size: 15px;
}

.file-list-group {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.hoso-view {
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.preview-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
}

.preview-ico {
  font-size: 64px;
  margin-bottom: 16px;
}

.file-iframe {
  flex: 1;
  border: 0;
  width: 100%;
  height: 100%;
}

.hoso-file-item {
  display: block;
  padding: 12px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: #475569;
  font-size: 14px;
  margin-bottom: 6px;
  border: 1px solid transparent;
  transition: all 140ms ease;
  word-break: break-word;
}

.hoso-file-item:hover {
  background: #f1f5f9;
  color: var(--orange);
}

.hoso-file-item.active {
  background: #fff7ed;
  border-color: #fdba74;
  color: var(--orange-dark);
  font-weight: 700;
}

@media (max-width: 1024px) {
  .hoso-main {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* ===== PHÂN TRANG ===== */
.pagination {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  font-weight: 700;
  color: #374151;
  padding: 8px 0 4px;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.pagination button {
  height: 34px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.14);
  background: var(--orange);
  color: #ffffff;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: background 140ms ease;
}

.pagination button:hover:not(:disabled) {
  background: var(--orange-dark);
}

.pagination button:disabled {
  background: #d1d5db;
  border-color: transparent;
  color: #9ca3af;
  cursor: not-allowed;
}

.pagination span {
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
}
/* ====================== */

@media (max-width: 860px) {
  .dashboard {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .sidebar-nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    flex-wrap: wrap;
    overflow-y: visible;
    padding-right: 0;
  }

  .sidebar-link {
    white-space: nowrap;
    padding: 10px 12px;
    font-size: 13px;
  }

  .sidebar-submenu {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    flex-basis: 100%;
  }

  .dashboard-header {
    height: auto;
    padding: 14px 14px;
  }

  .dashboard-header h1 {
    font-size: 20px;
  }

  .dashboard-content {
    padding: 14px 14px 20px;
  }

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

  .pagination {
    flex-wrap: wrap;
    gap: 10px;
  }
}
