@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #f8fafc;
  --sidebar-hover: #1e293b;
  --accent: #0ea5e9;
  --accent-hover: #0284c7;
  --content-bg: #f8fafc;
  --card-bg: #ffffff;
  --card-border: #dce7f4;
  --text: #16304f;
  --text-muted: #607891;
  --danger: #ef4444;
  --success: #16a34a;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--text);
  background: var(--content-bg);
}

body.theme-dark {
  --content-bg: #071b34;
  --card-bg: rgba(7, 28, 54, 0.88);
  --card-border: rgba(129, 198, 255, 0.18);
  --text: #f4fbff;
  --text-muted: rgba(214, 235, 255, 0.72);
  --sidebar-bg: rgba(5, 21, 41, 0.95);
  --sidebar-text: rgba(214, 235, 255, 0.72);
  --sidebar-active: #ffffff;
  --sidebar-hover: rgba(59, 148, 226, 0.14);
  --accent: #1ea1ff;
  --accent-hover: #0d6fd3;
  --danger: #ff7d93;
  --success: #62d89f;
  background:
    radial-gradient(circle at top left, rgba(72, 180, 255, 0.18), transparent 32%),
    radial-gradient(circle at 85% 12%, rgba(0, 118, 214, 0.20), transparent 30%),
    linear-gradient(180deg, #0a3f7a 0%, #072d56 38%, #061d38 100%);
  background-attachment: fixed;
}

body.theme-dark::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.06), transparent 30%),
    radial-gradient(circle at bottom center, rgba(56, 189, 248, 0.10), transparent 36%);
  z-index: 0;
}

body.theme-dark .admin-layout,
body.theme-dark .login-page {
  position: relative;
  z-index: 1;
}

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

.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  width: 252px;
  flex-shrink: 0;
  flex-direction: column;
  background: var(--sidebar-bg);
}

body.theme-dark .admin-sidebar {
  background: linear-gradient(180deg, rgba(7, 28, 54, 0.94), rgba(4, 16, 34, 0.98));
  border-right: 1px solid rgba(129, 198, 255, 0.14);
  box-shadow: 16px 0 36px rgba(0, 10, 24, 0.34);
  backdrop-filter: blur(16px);
}

.admin-sidebar-brand {
  padding: 1.35rem 1.45rem 1.2rem;
  color: #ffffff;
  text-decoration: none;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.theme-dark .admin-sidebar-brand {
  border-bottom-color: rgba(129, 198, 255, 0.12);
}

.admin-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.65rem;
}

.admin-sidebar-nav .nav-group {
  display: block;
  padding: 0.9rem 0.9rem 0.35rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.admin-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.35rem;
  padding: 0.82rem 0.95rem;
  border: 1px solid transparent;
  border-radius: 18px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  transition: 0.18s ease;
}

.admin-sidebar-nav a:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-active);
}

.admin-sidebar-nav a.active {
  background: rgba(14, 165, 233, 0.15);
  color: var(--accent);
}

body.theme-dark .admin-sidebar-nav a:hover {
  background: linear-gradient(180deg, rgba(40, 118, 191, 0.14), rgba(12, 40, 75, 0.24));
  border-color: rgba(114, 189, 255, 0.22);
  color: #f4fbff;
}

body.theme-dark .admin-sidebar-nav a.active {
  background: linear-gradient(135deg, rgba(32, 123, 209, 0.34), rgba(10, 53, 101, 0.56));
  border-color: rgba(98, 194, 255, 0.32);
  color: #ffffff;
  box-shadow:
    0 12px 26px rgba(0, 10, 24, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.admin-sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body.theme-dark .admin-sidebar-footer {
  border-top-color: rgba(129, 198, 255, 0.12);
}

.admin-sidebar-footer a {
  display: block;
  padding: 0.5rem 0;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.9rem;
}

.admin-sidebar-footer a:hover {
  color: var(--accent);
}

.theme-toggle {
  width: 100%;
  margin: 0 0 0.8rem;
  padding: 0.82rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(129, 198, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: #d9ebff;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: 0.18s ease;
}

.theme-toggle:hover {
  background: rgba(58, 142, 219, 0.18);
  color: #ffffff;
}

.admin-main {
  position: relative;
  flex: 1;
  min-height: 100vh;
  margin-left: 252px;
  padding: 1.5rem 1.6rem;
}

.admin-main > * {
  position: relative;
  z-index: 1;
}

.page-header {
  display: block;
  margin-bottom: 1rem;
  padding: 1.3rem 1.4rem 0;
}

.page-title {
  margin: 0;
  color: var(--text);
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.theme-dark .page-title {
  color: #f4fbff;
}

.page-subtitle {
  margin-top: 0.45rem;
  color: var(--text-muted);
  font-size: 0.96rem;
  max-width: 720px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  padding: 0 1.4rem 1.4rem;
}

.stats-status {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.stats-page-header,
.stats-grid-dashboard {
  max-width: 1520px;
  margin-left: auto;
  margin-right: auto;
}

.stats-grid-dashboard {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stats-grid-dashboard .admin-card {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stats-grid-dashboard .admin-card .card-value {
  font-size: clamp(2.1rem, 3vw, 2.8rem);
  line-height: 1;
}

.stats-subsection-header {
  padding-top: 0.4rem;
}

.stats-subsection-header .page-title,
.stats-section-title {
  font-size: 1.15rem !important;
  letter-spacing: 0.08em;
}

.admin-card,
.chats-sidebar,
.chats-main,
.login-card,
.table-wrapper {
  border-radius: 26px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  box-shadow:
    0 20px 40px rgba(15, 23, 42, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

body.theme-dark .admin-card,
body.theme-dark .chats-sidebar,
body.theme-dark .chats-main,
body.theme-dark .login-card,
body.theme-dark .table-wrapper {
  background: linear-gradient(180deg, rgba(7, 28, 54, 0.88), rgba(4, 16, 34, 0.94));
  box-shadow:
    0 20px 40px rgba(0, 10, 24, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
}

.admin-card {
  padding: 1.25rem 1.35rem;
}

.admin-card h5 {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-card .card-value {
  margin: 0;
  color: var(--text);
  font-size: 2rem;
  font-weight: 800;
}

.admin-card-status .card-value {
  font-size: 1.55rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table th {
  padding: 1rem 1.05rem;
  color: var(--text-muted);
  text-align: left;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(19, 59, 108, 0.10);
}

.admin-table td {
  padding: 0.95rem 1.05rem;
  color: var(--text);
  border-bottom: 1px solid rgba(19, 59, 108, 0.08);
}

.admin-table tbody tr:hover {
  background: rgba(14, 165, 233, 0.05);
}

body.theme-dark .admin-table th {
  color: rgba(210, 228, 246, 0.70);
  border-bottom-color: rgba(126, 186, 243, 0.12);
}

body.theme-dark .admin-table td {
  color: #f4fbff;
  border-bottom-color: rgba(126, 186, 243, 0.10);
}

body.theme-dark .admin-table tbody tr:hover {
  background: rgba(40, 118, 191, 0.14);
}

.admin-table code,
.ref-tag {
  display: inline-block;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.10);
  color: var(--text);
  font-size: 0.82rem;
}

body.theme-dark .admin-table code,
body.theme-dark .ref-tag {
  background: rgba(255, 255, 255, 0.08);
  color: #eaf4ff;
}

.form-label {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
}

.form-control,
.form-select {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 1rem;
  border-radius: 18px;
  border: 1px solid rgba(19, 59, 108, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
  outline: none;
}

.form-select {
  padding-right: 3rem;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.form-select option {
  background: #ffffff;
  color: #16304f;
}

.form-control::placeholder {
  color: rgba(96, 120, 145, 0.75);
}

.form-control:focus,
.form-select:focus {
  border-color: rgba(14, 165, 233, 0.36);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

body.theme-dark .form-label {
  color: #eaf4ff;
}

body.theme-dark .form-control,
body.theme-dark .form-select {
  border-color: rgba(131, 188, 243, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #f5fbff;
}

body.theme-dark .form-select option,
body.theme-dark .form-select optgroup {
  background: #0b2342;
  color: #f5fbff;
}

body.theme-dark .form-control::placeholder {
  color: rgba(211, 228, 244, 0.42);
}

body.theme-dark .form-control:focus,
body.theme-dark .form-select:focus {
  border-color: rgba(103, 192, 255, 0.36);
  box-shadow: 0 0 0 4px rgba(46, 156, 246, 0.12);
}

.admin-form .form-control,
.admin-form .form-select {
  display: block;
  width: 100%;
}

.btn-admin,
.btn-outline-admin,
.chat-filter-btn,
.btn-archive,
.chat-input-row .btn-attach,
.sql-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.72rem 1.15rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: 0.18s ease;
}

.btn-admin {
  border: none;
  background: linear-gradient(135deg, #1ea1ff 0%, #0d6fd3 100%);
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(12, 104, 197, 0.24);
}

.btn-admin:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #38b7ff 0%, #0c82eb 100%);
  box-shadow: 0 16px 32px rgba(11, 114, 216, 0.28);
}

.btn-admin:disabled {
  opacity: 0.45;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-outline-admin,
.chat-filter-btn,
.btn-archive,
.chat-input-row .btn-attach,
.sql-toggle {
  border: 1px solid rgba(129, 198, 255, 0.18);
  background: rgba(255, 255, 255, 0.03);
  color: #d9ebff;
}

.btn-outline-admin:hover,
.chat-filter-btn:hover,
.btn-archive:hover,
.chat-input-row .btn-attach:hover,
.sql-toggle:hover {
  background: rgba(58, 142, 219, 0.18);
  color: #ffffff;
}

.chat-filter-btn.active {
  border-color: transparent;
  background: linear-gradient(135deg, #1ea1ff 0%, #0d6fd3 100%);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(16, 116, 212, 0.34);
}

.btn-sm {
  min-height: 38px;
  padding: 0.5rem 0.85rem;
  font-size: 0.8rem;
}

.alert-admin {
  margin-bottom: 1rem;
  padding: 1rem 1.15rem;
  border-radius: 18px;
  border: 1px solid transparent;
}

.alert-success {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}

.alert-danger {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}

body.theme-dark .alert-success {
  background: rgba(21, 128, 61, 0.18);
  color: #ccfbe3;
  border-color: rgba(98, 216, 159, 0.24);
}

body.theme-dark .alert-danger {
  background: rgba(161, 29, 53, 0.22);
  color: #ffd5da;
  border-color: rgba(255, 125, 147, 0.24);
}

body.theme-dark .alert-warning {
  background: rgba(180, 83, 9, 0.20);
  color: #ffe4aa;
  border-color: rgba(255, 204, 112, 0.24);
}

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

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 2rem;
}

.login-card h1 {
  margin: 0 0 1.5rem;
  color: var(--text);
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-card .btn-admin {
  width: 100%;
  margin-top: 0.5rem;
}

.db-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.db-page-header,
.db-page-card {
  max-width: 1520px;
  margin-left: auto;
  margin-right: auto;
}

.db-page-card {
  padding: 1.2rem 1.35rem 1.35rem;
}

.db-toolbar {
  justify-content: space-between;
}

.db-toolbar-select {
  min-width: 260px;
  max-width: 300px;
}

.db-toolbar .form-select {
  max-width: 100%;
}

.db-toolbar .btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.table-wrapper {
  overflow: auto;
  max-height: 70vh;
  padding: 0;
}

.table-wrapper thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 1px 0 rgba(19, 59, 108, 0.10);
}

body.theme-dark .table-wrapper thead th {
  background: rgba(7, 28, 54, 0.96) !important;
  box-shadow: 0 1px 0 rgba(126, 186, 243, 0.12);
}

.table-wrapper .admin-table th,
.table-wrapper .admin-table td {
  min-width: 80px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-wrapper td.editable {
  cursor: pointer;
}

.table-wrapper td.editable:hover {
  background: rgba(14, 165, 233, 0.10);
}

body.theme-dark .table-wrapper td.editable:hover {
  background: rgba(40, 118, 191, 0.14);
}

.sql-panel {
  margin-top: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(19, 59, 108, 0.10);
}

body.theme-dark .sql-panel {
  border-top-color: rgba(126, 186, 243, 0.12);
}

.sql-panel textarea {
  min-height: 140px;
  padding: 0.85rem 1rem;
  font-family: ui-monospace, monospace;
  font-size: 0.9rem;
}

.hidden {
  display: none !important;
}

.mb-3 {
  margin-bottom: 1rem;
}

.mb-4 {
  margin-bottom: 1.5rem;
}

.ref-row {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(19, 59, 108, 0.08);
  font-size: 0.92rem;
}

.ref-row:last-child {
  border-bottom: none;
}

.ref-price {
  color: var(--accent);
  font-weight: 700;
}

.ref-row small {
  color: var(--text-muted);
}

body.theme-dark .ref-row {
  border-bottom-color: rgba(126, 186, 243, 0.10);
  color: #f4fbff;
}

.chats-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  min-height: 74vh;
  padding: 0 1.4rem 1.4rem;
}

.chats-sidebar,
.chats-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
}

.chat-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 1rem;
  border-bottom: 1px solid rgba(19, 59, 108, 0.10);
}

body.theme-dark .chat-filters,
body.theme-dark .chat-header-row,
body.theme-dark .chat-header,
body.theme-dark .chat-input-row,
body.theme-dark .chat-item {
  border-color: rgba(126, 186, 243, 0.12);
}

.chats-list {
  overflow: auto;
  padding: 0 0.65rem 0.75rem;
}

.chat-item {
  margin-bottom: 0.55rem;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(19, 59, 108, 0.08);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.04), rgba(255, 255, 255, 0.02));
  cursor: pointer;
  transition: 0.18s ease;
}

.chat-item:hover {
  transform: translateY(-1px);
  border-color: rgba(14, 165, 233, 0.20);
}

.chat-item.active {
  border-color: rgba(98, 194, 255, 0.42);
  background: linear-gradient(180deg, rgba(32, 123, 209, 0.32), rgba(10, 53, 101, 0.52));
  color: #ffffff;
  box-shadow:
    0 18px 36px rgba(0, 12, 27, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.theme-dark .chat-item {
  border-color: rgba(130, 187, 241, 0.10);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
}

body.theme-dark .chat-item:hover {
  border-color: rgba(114, 189, 255, 0.28);
  background: linear-gradient(180deg, rgba(40, 118, 191, 0.14), rgba(12, 40, 75, 0.24));
  box-shadow: 0 14px 28px rgba(0, 8, 20, 0.22);
}

.chat-item-title {
  color: inherit;
  font-size: 0.95rem;
  font-weight: 700;
}

.chat-item-meta {
  margin-top: 0.55rem;
  color: var(--text-muted);
  font-size: 0.79rem;
  line-height: 1.45;
}

.chat-empty {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-muted);
  text-align: center;
}

.chat-header-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 1.1rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(19, 59, 108, 0.10);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
}

.chat-header {
  min-width: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.status-select {
  max-width: 190px;
}

.chat-messages {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 0.9rem;
  overflow: auto;
  padding: 1.15rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0)),
    radial-gradient(circle at top, rgba(64, 163, 255, 0.08), transparent 32%);
}

.chat-msg {
  max-width: min(78%, 720px);
  padding: 0.9rem 1rem 0.75rem;
  border-radius: 22px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14);
  font-size: 0.92rem;
}

.chat-msg.client {
  align-self: flex-start;
  border-top-left-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(136, 185, 230, 0.14);
  color: #eef7ff;
}

.chat-msg.admin {
  align-self: flex-end;
  border-top-right-radius: 10px;
  background: linear-gradient(180deg, #1688eb 0%, #0b5fbe 100%);
  color: #ffffff;
}

.chat-msg .msg-author {
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
}

.chat-msg .msg-time {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  opacity: 0.72;
}

.chat-input-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 1rem 1.15rem 1.15rem;
  border-top: 1px solid rgba(19, 59, 108, 0.10);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
}

.chat-input-row input.form-control {
  margin: 0;
}

.chat-input-row .btn-attach {
  min-width: 52px;
  padding-inline: 0.8rem;
}

.chat-msg .msg-img {
  display: block;
  max-width: min(320px, 100%);
  max-height: 220px;
  margin-top: 0.7rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.20);
}

.chat-msg .msg-img:hover {
  opacity: 0.9;
}

.msg-img-wrap {
  display: inline-block;
}

.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
}

.media-lightbox.hidden {
  display: none !important;
}

.media-lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  border-radius: 16px;
  object-fit: contain;
}

@media (max-width: 980px) {
  .chats-layout {
    grid-template-columns: 1fr;
  }

  .chats-sidebar {
    min-height: 280px;
  }

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

@media (max-width: 768px) {
  .admin-sidebar {
    width: 70px;
    padding-top: 0.25rem;
  }

  .admin-sidebar-brand .brand-text,
  .admin-sidebar-nav .nav-text,
  .admin-sidebar-nav .nav-group {
    display: none;
  }

  .admin-sidebar-nav a {
    justify-content: center;
    padding: 0.8rem;
  }

  .admin-main {
    margin-left: 70px;
    padding: 1rem 0.8rem;
  }

  .page-header,
  .stats-grid,
  .chats-layout {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .page-title {
    font-size: 1.55rem;
  }

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

  .db-toolbar-select {
    min-width: 100%;
    max-width: none;
  }

  .chat-header-row,
  .chat-input-row {
    grid-template-columns: 1fr;
  }

  .chat-input-row {
    display: flex;
    flex-wrap: wrap;
  }

  .chat-msg {
    max-width: 92%;
  }
}
