[hidden] { display: none !important; }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 20px;
  margin-bottom: 20px;
}

.recent-panel { margin-top: 0; }
.compact-list, .activity-list { display: grid; }

.compact-domain {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  cursor: pointer;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 17px 0;
  text-align: left;
  width: 100%;
}

.compact-domain:first-child { padding-top: 4px; }
.compact-domain:last-child { border-bottom: 0; padding-bottom: 4px; }
.compact-domain:hover strong { color: var(--blue); }
.compact-domain strong, .compact-domain small { display: block; }
.compact-domain small { color: var(--muted); margin-top: 4px; }

.domain-icon {
  align-items: center;
  background: #eef4ff;
  border: 1px solid #dbe7ff;
  border-radius: 12px;
  color: var(--blue);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.domain-icon.large { border-radius: 15px; font-size: 22px; height: 50px; width: 50px; }
.domain-storage { color: var(--muted); font-size: 13px; white-space: nowrap; }

.quick-actions { display: grid; gap: 10px; }
.quick-action {
  align-items: center;
  appearance: none;
  background: #f8faff;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: inherit;
  cursor: pointer;
  display: flex;
  gap: 12px;
  padding: 13px;
  text-align: left;
  transition: border-color .15s, transform .15s, background .15s;
}
.quick-action:hover { background: #f2f6ff; border-color: #b9ccf3; transform: translateY(-1px); }
.quick-action > span { color: var(--blue); font-size: 23px; line-height: 1; width: 28px; }
.quick-action strong, .quick-action small { display: block; }
.quick-action small { color: var(--muted); margin-top: 3px; }

.activity-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 13px 0;
}
.activity-item:first-child { padding-top: 2px; }
.activity-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.activity-item strong, .activity-item small { display: block; }
.activity-item small { color: var(--muted); margin-top: 3px; }
.activity-icon { align-items: center; border-radius: 50%; display: inline-flex; font-weight: 800; height: 32px; justify-content: center; width: 32px; }
.activity-icon.ok { background: #e9f8ef; color: #118348; }
.activity-icon.fail { background: #fff0f0; color: #bf3030; }
.activity-actor { color: var(--muted); font-size: 12px; }
.small-empty { padding: 22px 0; }

.page-intro { margin: 0 0 18px; }
.domains-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.domain-card { background: var(--white); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 22px; }
.domain-card-head, .domain-card-foot { align-items: center; display: flex; justify-content: space-between; }
.domain-card h2 { font-size: 18px; margin: 18px 0; overflow-wrap: anywhere; }
.domain-stats { display: grid; gap: 10px; grid-template-columns: repeat(4, 1fr); }
.domain-stats > div { background: #f8faff; border-radius: 11px; padding: 12px; }
.domain-stats small, .domain-stats strong { display: block; }
.domain-stats small { color: var(--muted); font-size: 10px; letter-spacing: .05em; }
.domain-stats strong { font-size: 17px; margin-top: 5px; }
.domain-card-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; margin-top: 18px; padding-top: 17px; }

.status-banner {
  align-items: flex-start;
  background: #edfbf3;
  border: 1px solid #bfe9d0;
  border-radius: 14px;
  color: #175c37;
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  padding: 17px 19px;
}
.status-banner p { color: #357552; margin: 4px 0 0; }
.status-dot { background: #23a55a; border: 4px solid #c9f0d8; border-radius: 50%; flex: 0 0 auto; height: 14px; margin-top: 3px; width: 14px; }
.system-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.system-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.system-card small, .system-card strong, .system-card span { display: block; }
.system-card small { color: var(--muted); font-size: 10px; letter-spacing: .06em; }
.system-card strong { font-size: 15px; margin: 10px 0 5px; }
.system-card span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.system-details { margin-top: 18px; }
.config-list { display: grid; }
.config-list > div { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 24px; justify-content: space-between; padding: 14px 0; }
.config-list > div:first-child { padding-top: 0; }
.config-list > div:last-child { border: 0; padding-bottom: 0; }
.config-list span { color: var(--muted); }
.config-list strong { font-size: 13px; text-align: right; }

.quota-composer { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr) 92px; }
.last-action { display: grid; gap: 3px; min-width: 120px; }
.last-action small { color: var(--muted); font-weight: 400; }

@media (max-width: 1100px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .system-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .domain-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { height: auto; min-height: 0; padding: 12px 14px; position: sticky; top: 0; width: 100%; z-index: 20; }
  .sidebar .brand { margin-bottom: 10px; }
  .sidebar nav { display: flex; gap: 6px; margin: 0; overflow-x: auto; padding-bottom: 2px; }
  .sidebar nav .nav-item { flex: 0 0 auto; padding: 9px 11px; }
  .sidebar-foot { align-items: center; display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
  .sidebar-foot .nav-item { flex: 0 0 auto; padding: 8px 11px; }
  .sidebar-foot small { display: none; }
  .workspace { margin-left: 0; min-height: auto; }
  .topbar { padding: 15px 16px; }
  .topbar .eyebrow, .admin-pill div { display: none; }
  .topbar h1 { font-size: 19px; }
  .page { padding: 16px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .domains-grid, .system-grid { grid-template-columns: 1fr; }
  .responsive-head { align-items: stretch; flex-direction: column; }
  .responsive-head .btn { width: 100%; }
  .toolbar { align-items: stretch; display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar .search { grid-column: 1 / -1; max-width: none; }
  .table-wrap { overflow: visible; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody { display: grid; gap: 12px; padding: 0 14px 14px; }
  tbody tr { background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 4px 14px rgba(29, 52, 92, .04); padding: 8px 13px; }
  tbody td { align-items: flex-start; border: 0; display: flex; gap: 12px; justify-content: space-between; padding: 9px 0; text-align: right; }
  tbody td::before { color: var(--muted); content: attr(data-label); flex: 0 0 auto; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding-top: 4px; text-align: left; text-transform: uppercase; }
  tbody td:first-child { border-bottom: 1px solid var(--line); }
  tbody td:first-child::before { display: none; }
  .account-cell { text-align: left; }
  .usage-cell { max-width: 180px; width: 55%; }
  .actions { justify-content: flex-end; }
  .action-btn { min-height: 34px; }
  .panel-foot { align-items: flex-start; flex-direction: column; gap: 5px; }
}

@media (max-width: 510px) {
  .metrics { grid-template-columns: 1fr; }
  .page { padding: 12px; }
  .panel { border-radius: 14px; padding-left: 14px; padding-right: 14px; }
  .compact-domain { grid-template-columns: auto minmax(0, 1fr); }
  .domain-storage, .activity-actor { display: none; }
  .activity-item { grid-template-columns: auto minmax(0, 1fr); }
  .page-intro { align-items: stretch; flex-direction: column; }
  .domain-stats { grid-template-columns: repeat(2, 1fr); }
  .domain-card-foot { align-items: stretch; flex-direction: column; gap: 12px; }
  .toolbar { grid-template-columns: 1fr; }
  .toolbar .search { grid-column: auto; }
  .config-list > div { align-items: flex-start; flex-direction: column; gap: 5px; }
  .config-list strong { text-align: left; }
  dialog { max-width: calc(100vw - 20px); }
  .dialog-card { padding: 18px; }
}
