.dashboard-page {
  min-height: 100vh;
}

.dashboard-header,
.dashboard-main,
.dashboard-footer {
  width: min(1180px, calc(100% - 48px));
  margin-inline: auto;
}

.dashboard-header {
  border-bottom: 1px solid var(--line);
}

.account-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-dashboard-button {
  padding: 8px 11px;
  border: 1px solid #cfd7e2;
  border-radius: 8px;
  color: #334155;
  background: white;
  font-size: 11px;
  font-weight: 650;
  text-decoration: none;
}

.admin-dashboard-button:hover {
  border-color: #9eabba;
  color: var(--navy);
  background: #f7f9fc;
}

.account-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.account-profile > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-profile:hover strong {
  color: var(--navy);
}

.account-menu strong {
  font-size: 12px;
}

.account-profile div span {
  max-width: 190px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: #60718d;
  font-size: 12px;
  font-weight: 700;
}

.dashboard-main {
  display: flex;
  min-height: auto;
  align-items: stretch;
  flex-direction: column;
  padding: 48px 0 80px;
}

.dashboard-welcome {
  display: flex;
  width: 100%;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 28px;
}

.dashboard-welcome > div {
  min-width: 0;
}

.section-label {
  margin: 0 0 7px;
  color: #6b7f9e;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dashboard-welcome h1 {
  margin: 0;
  font-size: 36px;
}

.dashboard-welcome #dashboard-email {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.new-upload-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 10px;
  color: white;
  background: var(--navy);
  box-shadow: 0 5px 14px rgba(23, 43, 77, 0.18);
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.new-upload-button svg {
  width: 17px;
}

.summary-grid {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px;
  border: 1px solid #dfe4eb;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 7px 20px rgba(15, 31, 55, 0.04);
}

.summary-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 11px;
  color: var(--navy);
  background: #edf2f7;
}

.summary-icon svg {
  width: 20px;
}

.summary-card div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.summary-card strong {
  font-size: 17px;
}

.summary-card div span {
  color: var(--muted);
  font-size: 11px;
}

.welcome-card strong {
  font-size: 22px;
}

.welcome-card div span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-panel {
  width: 100%;
  margin-bottom: 18px;
  border: 1px solid #dfe4eb;
  border-radius: 16px;
  background: white;
  box-shadow: 0 12px 36px rgba(15, 31, 55, 0.055);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid #e5e9ef;
}

.panel-header h2 {
  margin: 0;
  font-size: 20px;
}

.file-view-tabs {
  display: flex;
  align-items: center;
  gap: 22px;
}

.file-view-tabs a {
  position: relative;
  padding: 3px 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
}

.file-view-tabs a:hover,
.file-view-tabs a.active {
  color: var(--navy);
}

.file-view-tabs a.active::after {
  position: absolute;
  right: 0;
  bottom: -21px;
  left: 0;
  height: 2px;
  background: var(--navy);
  content: "";
}

.bulk-toolbar {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 9px 18px;
  border-bottom: 1px solid #d9e0e9;
  background: #f6f8fb;
}

.bulk-toolbar[hidden] {
  display: none;
}

.bulk-toolbar > strong {
  color: var(--navy);
  font-size: 12px;
  white-space: nowrap;
}

.bulk-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.bulk-action,
.bulk-clear {
  padding: 8px 10px;
  border: 1px solid #cfd7e2;
  border-radius: 8px;
  color: #334155;
  background: white;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.bulk-action:hover,
.bulk-clear:hover {
  border-color: #9eabba;
  color: var(--navy);
}

.bulk-action.danger {
  border-color: #e8c4c1;
  color: #a12820;
}

.bulk-action.danger:hover {
  background: #fff5f5;
}

.bulk-action:disabled {
  opacity: 0.6;
  cursor: wait;
}

.bulk-clear {
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.file-toolbar,
.subscription-actions {
  display: flex;
  gap: 8px;
}

.toolbar-button,
.secondary-action,
.cancel-action {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  border: 1px solid #d6dce5;
  border-radius: 8px;
  color: #334155;
  background: #fff;
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.toolbar-button:hover,
.secondary-action:hover {
  border-color: #aeb9c8;
  background: #f7f9fc;
}

.toolbar-button svg {
  width: 16px;
}

.table-wrap {
  width: 100%;
  max-height: 630px;
  overflow: auto;
  scrollbar-gutter: stable;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 14px;
  color: #7b8798;
  background: #f8fafc;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

td {
  padding: 12px 14px;
  border-top: 1px solid #edf0f4;
  color: #5e6b7c;
  font-size: 11px;
  white-space: nowrap;
}

tbody tr:hover {
  background: #fafbfd;
}

.select-cell {
  width: 42px;
  padding-right: 4px;
  text-align: center;
}

.select-cell input {
  width: 14px;
  height: 14px;
  accent-color: var(--navy);
}

.file-name {
  display: flex;
  min-width: 190px;
  align-items: center;
  gap: 10px;
}

.file-name strong {
  max-width: 250px;
  overflow: hidden;
  color: #263244;
  font-size: 12px;
  text-overflow: ellipsis;
}

.type-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: #556987;
  background: #edf2f7;
}

.type-icon svg {
  width: 18px;
}

.type-icon.pdf {
  color: #b42318;
  background: #fff1f0;
}

.type-icon.video {
  color: #6941c6;
  background: #f3efff;
}

.type-icon.archive {
  color: #9a6700;
  background: #fff8dd;
}

.type-icon.folder {
  color: #175cd3;
  background: #eff6ff;
}

.expiry {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 999px;
  color: #344054;
  background: #f1f4f7;
  font-size: 10px;
  font-weight: 650;
}

.expiry.warning {
  color: #8a5b00;
  background: #fff6d8;
}

.expiry.danger {
  color: #a12820;
  background: #fff0ef;
}

.actions-cell {
  width: 160px;
  text-align: right;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
}

.icon-action {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #667085;
  background: transparent;
  cursor: pointer;
}

.icon-action:hover {
  border-color: #dfe4eb;
  color: var(--navy);
  background: white;
}

.icon-action.delete:hover {
  color: #b42318;
  background: #fff5f5;
}

.icon-action.preview-unavailable {
  color: #a8b0bc;
  cursor: help;
}

.icon-action.preview-unavailable:hover {
  border-color: transparent;
  color: #8a94a3;
  background: transparent;
}

.icon-action svg {
  width: 15px;
}

.preview-modal {
  position: fixed;
  z-index: 50;
  display: grid;
  inset: 0;
  padding: 24px;
  place-items: center;
  background: rgba(15, 31, 55, 0.55);
}

.preview-modal[hidden] {
  display: none;
}

.preview-dialog {
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid #dfe4eb;
  border-radius: 16px;
  background: white;
  box-shadow: 0 24px 70px rgba(15, 31, 55, 0.3);
}

.preview-header {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid #e5e9ef;
}

.preview-header h2 {
  margin: 0;
  overflow: hidden;
  color: #263244;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-close {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  color: #667085;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.preview-close:hover {
  color: var(--navy);
  background: #edf2f7;
}

.preview-content {
  display: grid;
  min-height: 180px;
  max-height: min(62vh, 480px);
  padding: 16px;
  place-items: center;
  color: var(--muted);
  background: #f6f8fb;
  font-size: 12px;
}

.preview-content img {
  display: block;
  max-width: 100%;
  max-height: min(55vh, 430px);
  border-radius: 9px;
  object-fit: contain;
}

.empty-state {
  padding: 60px 20px;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 5px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.plan-badge {
  padding: 6px 10px;
  border-radius: 999px;
  color: #1e4b35;
  background: #e7f6ed;
  font-size: 10px;
  font-weight: 700;
}

.subscription-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 30px;
  padding: 22px;
}

.plan-details strong {
  font-size: 14px;
}

.plan-details p {
  margin: 5px 0 14px;
  color: var(--muted);
  font-size: 11px;
}

.storage-meter {
  width: min(390px, 100%);
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ecf1;
}

.storage-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--navy);
}

.plan-details small {
  display: block;
  margin-top: 7px;
  color: #7b8798;
  font-size: 10px;
}

.cancel-action {
  border-color: #f0c8c5;
  color: #a12820;
}

.cancel-action:hover {
  background: #fff5f5;
}

.dashboard-footer {
  margin-top: 0;
}

.demo-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: 320px;
  padding: 12px 15px;
  border: 1px solid #c9d2df;
  border-radius: 10px;
  color: white;
  background: #172b4d;
  box-shadow: 0 12px 28px rgba(15, 31, 55, 0.22);
  font-size: 11px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@media (max-width: 900px) {
  .dashboard-welcome {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }

}

@media (max-width: 760px) {
  .dashboard-header,
  .dashboard-main,
  .dashboard-footer {
    width: min(100% - 28px, 1180px);
  }

  .account-profile > div,
  .dashboard-logout {
    display: none;
  }

  .dashboard-main {
    padding-top: 32px;
  }

  .panel-header,
  .subscription-grid {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .panel-header {
    align-items: center;
    flex-direction: row;
    gap: 14px;
  }

  .file-toolbar,
  .subscription-actions {
    width: 100%;
    flex-wrap: wrap;
  }

  .bulk-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .bulk-actions {
    justify-content: flex-start;
  }

}
