/* Windows-2000-inspired monochrome UI */
:root,
[data-theme="light"],
[data-theme="dark"] {
  --bg-page: #bdbdbd;
  --bg-panel: #d8d8d8;
  --bg-card: #dcdcdc;
  --bg-input: #ffffff;
  --bg-black: #101010;
  --bg-soft: #e7e7e7;

  --text-primary: #111111;
  --text-muted: #3f3f3f;
  --text-inverse: #f5f5f5;

  --border-dark: #767676;
  --border-mid: #9a9a9a;
  --border-light: #f8f8f8;
  --border-inset: #7b7b7b;

  --danger: #8e2d2d;
  --success: #2c7f3c;
  --warning: #997224;

  /* compatibility aliases used by existing templates */
  --bg-primary: #bdbdbd;
  --bg-secondary: #dcdcdc;
  --border-color: #9a9a9a;
  --text-secondary: #3f3f3f;
  --accent: #111111;
  --accent-hover: #000000;

  --shadow-outset: inset 1px 1px 0 var(--border-light), inset -1px -1px 0 var(--border-dark);
  --shadow-inset: inset 1px 1px 0 var(--border-dark), inset -1px -1px 0 var(--border-light);
}

@font-face {
  font-family: "TahomaXP8Bold";
  src: url('/static/fonts/tahoma-8pt-bold-windows-xp.otf') format('opentype');
  font-style: normal;
  font-weight: normal;
  font-display: swap;
}

body.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #8b8b8b;
  min-height: 100vh;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 8px;
}

body {
  font-family: "TahomaXP8Bold", Tahoma, Verdana, sans-serif;
  font-size: 1.5rem;
  color: var(--text-primary);
  background: var(--bg-page);
  min-height: 100vh;
  line-height: 1.35;
}

a {
  color: #000000;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Layout */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 230px;
  min-width: 230px;
  background: var(--bg-panel);
  border-right: 1px solid var(--border-dark);
  box-shadow: var(--shadow-outset);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
}

.logo-area {
  background: var(--bg-black);
  border-bottom: 1px solid #000;
  padding: 14px;
}

.asg-logo-sidebar {
  max-width: 130px;
  display: block;
  margin: 0 auto;
  filter: grayscale(100%);
}

.nav-links {
  list-style: none;
  padding: 8px;
}

.nav-links li {
  margin-bottom: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  box-shadow: var(--shadow-outset);
  font-size: 1.45rem;
}

.nav-link::before {
  content: "";
  width: 16px;
  height: 16px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px 16px;
  flex: 0 0 16px;
}

.nav-link[href="/admin/"]::before {
  background-image: url('/static/icons/w2k/w2k_my_computer.png');
}

.nav-link[href="/admin/companies"]::before {
  background-image: url('/static/icons/w2k/w2k_network_folders.png');
}

.nav-link[href="/admin/users"]::before {
  background-image: url('/static/icons/w2k/w2k_key.png');
}

.nav-link[href="/admin/files"]::before,
.nav-link[href="/cp/files"]::before {
  background-image: url('/static/icons/w2k/w2k_my_documents.png');
}

.nav-link[href="/admin/audit-log"]::before {
  background-image: url('/static/icons/w2k/w2k_notepad_2.png');
}

.nav-link[href="/cp/"]::before {
  background-image: url('/static/icons/w2k/w2k_computer.png');
}

.nav-link[href="/cp/roster"]::before {
  background-image: url('/static/icons/w2k/w2k_documents.png');
}

.nav-link[href="/cp/generate-pdf"]::before {
  background-image: url('/static/icons/w2k/w2k_internet_document.png');
}

.nav-link[href="/cp/qualifications/new"]::before {
  background-image: url('/static/icons/w2k/w2k_programs.png');
}

.nav-link[href="/settings/"]::before {
  background-image: url('/static/icons/w2k/w2k_settings.png');
}

.nav-link[href="/logout"]::before {
  background-image: url('/static/icons/w2k/w2k_shutdown.png');
}

.nav-link:hover {
  background: var(--bg-soft);
  text-decoration: none;
}

.nav-link.active {
  background: #111111;
  color: var(--text-inverse);
  border-color: #000000;
  box-shadow: none;
}

.sidebar-footer {
  padding: 8px;
  border-top: 1px solid var(--border-mid);
}

.logout-link {
  color: #7f1212;
}

.main-wrapper {
  margin-left: 230px;
  width: calc(100% - 230px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-header {
  background: var(--bg-black);
  color: var(--text-inverse);
  border-bottom: 1px solid #000;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.4px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-name {
  font-size: 1.4rem;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #4a4a4a;
  padding: 3px 6px;
  text-transform: uppercase;
  font-size: 1.1rem;
  letter-spacing: 0.4px;
  background: #222;
}

.role-badge::before {
  content: "";
  width: 12px;
  height: 12px;
  background: url('/static/icons/w2k/w2k_administrative_tools.png') center/12px 12px no-repeat;
}

.main-content {
  padding: 16px;
}

/* Panels */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  box-shadow: var(--shadow-outset);
  margin-bottom: 12px;
  padding: 12px;
}

.card-header {
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-mid);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 1.65rem;
  font-weight: 700;
}

.card-title::before {
  content: "";
  width: 16px;
  height: 16px;
  background: url('/static/icons/w2k/w2k_program_group.png') center/16px 16px no-repeat;
}

/* Tables */
.table-wrapper {
  border: 1px solid var(--border-mid);
  background: #fff;
  box-shadow: var(--shadow-inset);
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1.4rem;
}

thead th {
  background: #c9c9c9;
  border-bottom: 1px solid var(--border-mid);
  border-right: 1px solid #b2b2b2;
  font-weight: 700;
  text-align: left;
  padding: 8px;
}

tbody td {
  border-bottom: 1px solid #dfdfdf;
  padding: 7px 8px;
  vertical-align: middle;
}

tbody tr:hover {
  background: #efefef;
}

#users-table td.users-actions-cell {
  white-space: nowrap;
}

#users-table .users-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#users-table .users-action-form {
  margin: 0;
}

#users-table .users-action-btn {
  min-width: 78px;
  justify-content: center;
}

/* Buttons and form controls */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #8b8b8b;
  background: #d7d7d7;
  box-shadow: var(--shadow-outset);
  color: #111;
  padding: 6px 10px;
  font-size: 1.35rem;
  cursor: pointer;
  white-space: nowrap;
}

.btn::before {
  content: "";
  width: 14px;
  height: 14px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 14px 14px;
}

.btn:hover {
  background: #ececec;
  text-decoration: none;
}

.btn:active {
  box-shadow: var(--shadow-inset);
}

.btn-primary,
.btn-secondary,
.btn-success,
.btn-info {
  background: #d7d7d7;
  color: #111;
}

.btn-primary::before {
  background-image: url('/static/icons/w2k/w2k_network_drive_connected.png');
}

.btn-secondary::before {
  background-image: url('/static/icons/w2k/w2k_open_folder.png');
}

.btn-success::before {
  background-image: url('/static/icons/w2k/w2k_settings.png');
}

.btn-info::before {
  background-image: url('/static/icons/w2k/w2k_help.png');
}

.btn-danger {
  background: #c8b1b1;
  color: #2b0000;
  border-color: #875656;
}

.btn-danger::before {
  background-image: url('/static/icons/w2k/w2k_dustbin2.png');
}

.btn-warning {
  background: #d2cab7;
  color: #3a2a00;
}

.btn-warning::before {
  background-image: url('/static/icons/w2k/w2k_hourglass.png');
}

.btn-sm {
  padding: 4px 8px;
  font-size: 1.2rem;
}

.btn-full {
  width: 100%;
}

.btn-link {
  border: 0;
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
  padding: 0;
}

.btn-link::before {
  display: none;
}

.form-group {
  margin-bottom: 10px;
}

.form-label {
  display: block;
  margin-bottom: 4px;
  font-size: 1.35rem;
  font-weight: 700;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-inset);
  box-shadow: var(--shadow-inset);
  padding: 6px;
  font-size: 1.35rem;
  color: #101010;
  outline: none;
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-hint {
  color: var(--text-muted);
  font-size: 1.2rem;
}

/* Alerts and badges */
.alert {
  border: 1px solid #8e8e8e;
  box-shadow: var(--shadow-outset);
  background: #ececec;
  padding: 8px 10px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.alert::before {
  content: "";
  width: 16px;
  height: 16px;
  background: url('/static/icons/w2k/w2k_help.png') center/16px 16px no-repeat;
  flex: 0 0 16px;
}

.alert-error {
  background: #ead8d8;
  color: #4e1717;
}

.alert-error::before {
  background-image: url('/static/icons/w2k/w2k_unknown_23.png');
}

.alert-success {
  background: #d9e8db;
  color: #1f4f29;
}

.alert-success::before {
  background-image: url('/static/icons/w2k/w2k_programs_2.png');
}

.alert-warning {
  background: #ece6d6;
  color: #5a420e;
}

.alert-warning::before {
  background-image: url('/static/icons/w2k/w2k_hourglass.png');
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #909090;
  padding: 2px 6px;
  font-size: 1.15rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #dedede;
}

.badge-active {
  background: #d7ebd9;
  color: #1d5b29;
}

.badge-expiring_soon {
  background: #ece4ca;
  color: #6b500e;
}

.badge-expiring_critical,
.badge-expired {
  background: #ebd0d0;
  color: #6d1f1f;
}

.badge-once_only,
.badge-missing_report,
.badge-missing_certificate,
.badge-pending_review {
  background: #dfdfdf;
  color: #3b3b3b;
}

.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 5px;
  border: 1px solid #4a4a4a;
}

.status-dot-active {
  background: #2e833a;
}

.status-dot-expiring_soon {
  background: #ccad2a;
}

.status-dot-expiring_critical,
.status-dot-expired {
  background: #b43a3a;
}

/* App utility sections */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  box-shadow: var(--shadow-outset);
  padding: 10px;
  text-align: center;
}

.stat-card::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  margin: 0 auto 4px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  background-image: url('/static/icons/w2k/w2k_system_2.png');
}

.stat-card:nth-child(2)::before {
  background-image: url('/static/icons/w2k/w2k_network_computer.png');
}

.stat-card:nth-child(3)::before {
  background-image: url('/static/icons/w2k/w2k_documents.png');
}

.stat-card:nth-child(4)::before {
  background-image: url('/static/icons/w2k/w2k_search.png');
}

.stat-card:nth-child(5)::before {
  background-image: url('/static/icons/w2k/w2k_windows_update.png');
}

.stat-card:nth-child(6)::before {
  background-image: url('/static/icons/w2k/w2k_settings.png');
}

.stat-value {
  font-size: 2.3rem;
  font-weight: 700;
}

.stat-label {
  font-size: 1.15rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.company-card {
  background: var(--bg-card);
  border: 1px solid var(--border-mid);
  box-shadow: var(--shadow-outset);
  padding: 12px;
}

.company-card h3 {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.company-card .company-desc {
  color: var(--text-muted);
  margin-bottom: 8px;
}

.company-meta {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.company-meta-item {
  background: #ececec;
  border: 1px solid #b2b2b2;
  padding: 5px;
  text-align: center;
}

.company-meta-value {
  font-size: 1.7rem;
  font-weight: 700;
}

.company-meta-label {
  font-size: 1.05rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.qualification-mini-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.page-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.page-actions-left,
.page-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box {
  position: relative;
}

.search-box input {
  padding-left: 22px;
  width: 220px;
}

.search-icon {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: url('/static/icons/w2k/w2k_find.png') center/14px 14px no-repeat;
  color: transparent;
  font-size: 0;
}

.pilot-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.info-item label {
  display: block;
  font-size: 1.1rem;
  text-transform: uppercase;
  color: var(--text-muted);
}

.info-item span {
  font-size: 1.45rem;
}

.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  padding: 4px 7px;
  border: 1px solid #8e8e8e;
  box-shadow: var(--shadow-outset);
  background: #dedede;
}

.page-btn::before {
  content: "";
  width: 12px;
  height: 12px;
  margin-right: 4px;
  background: url('/static/icons/w2k/w2k_globe.png') center/12px 12px no-repeat;
}

.page-btn.active,
.page-btn:hover {
  background: #111;
  color: #f4f4f4;
  text-decoration: none;
  box-shadow: none;
}

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 18px 10px;
}

.empty-state-icon {
  font-size: 2.8rem;
}

.error-container {
  max-width: 460px;
  background: #d8d8d8;
  border: 1px solid #8e8e8e;
  box-shadow: var(--shadow-outset);
  padding: 22px;
}

.error-code {
  font-size: 5rem;
}

.error-title {
  font-size: 2rem;
}

.error-message {
  font-size: 1.5rem;
}

/* Login page keeps artwork but matches monochrome shell */
body.login-page {
  background-color: #1a1a1a;
  background-image: url('/static/uploads/static_images/MainBG.jpg');
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.login-container {
  width: 100%;
  max-width: 420px;
  padding: 14px;
  position: relative;
  z-index: 1;
}

.login-card {
  background: #d7d7d7;
  border: 1px solid #808080;
  box-shadow: var(--shadow-outset);
  padding: 16px;
}

.login-logo {
  text-align: center;
  margin-bottom: 12px;
}

.asg-logo-image {
  max-width: 120px;
  display: block;
  margin: 0 auto 8px;
  filter: grayscale(100%);
}

.logo-text-large {
  display: block;
  font-size: 3.2rem;
  font-weight: 700;
  color: #111;
  letter-spacing: 2px;
}

.login-title {
  font-size: 1.7rem;
  margin-top: 6px;
}

.login-subtitle {
  color: var(--text-muted);
}

.password-reset-copy {
  display: block;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.password-reset-copy a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.login-footer {
  margin-top: 10px;
  text-align: center;
}

body.login-page .btn-primary::before {
  display: none;
}

/* File library workspace */
.file-grid {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 10px;
}

.file-sidebar {
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

.folder-tree-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 10px;
}

.folder-tree-list > li {
  margin: 3px 0;
}

.folder-tree-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 4px;
  border: 1px solid transparent;
}

.folder-tree-link::before {
  content: "";
  width: 14px;
  height: 14px;
  background: url('/static/icons/w2k/w2k_folder_closed.png') center/14px 14px no-repeat;
  display: inline-block;
}

.folder-tree-link:hover {
  border-color: #8a8a8a;
  text-decoration: none;
  background: #ededed;
}

.crumb-link {
  border-bottom: 1px dotted #595959;
}

.file-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.file-inline-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.inline-details {
  display: inline-block;
}

.inline-details summary {
  list-style: none;
}

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

.inline-details-form {
  margin-top: 5px;
  border: 1px solid #9f9f9f;
  background: #ececec;
  box-shadow: var(--shadow-outset);
  padding: 6px;
  display: flex;
  gap: 6px;
  align-items: center;
}

/* New drive-like shell */
.drive-shell {
  border: 1px solid var(--border-mid);
  background: var(--bg-card);
  box-shadow: var(--shadow-outset);
  padding: 8px;
}

.drive-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid #a3a3a3;
  box-shadow: var(--shadow-outset);
  background: #e2e2e2;
  padding: 6px;
  margin-bottom: 8px;
}

.drive-path {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #8f8f8f;
  background: #fff;
  box-shadow: var(--shadow-inset);
  padding: 5px 7px;
  min-width: 230px;
}

.drive-canvas {
  border: 1px solid #8f8f8f;
  background: #f5f5f5;
  box-shadow: var(--shadow-inset);
  min-height: 390px;
  padding: 10px;
}

.drive-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.drive-item {
  border: 1px solid #a0a0a0;
  background: #ececec;
  box-shadow: var(--shadow-outset);
  padding: 8px;
  min-height: 82px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}

.drive-item-top {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.item-icon {
  width: 16px;
  height: 16px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  flex: 0 0 auto;
}

.item-icon.folder {
  background-image: url('/static/icons/w2k/w2k_folder_open.png');
}

.item-icon.file {
  background-image: url('/static/icons/w2k/w2k_internet_document.png');
}

.item-icon.pdf {
  background-image: url('/static/icons/w2k/w2k_notepad_2.png');
}

.drive-item-name {
  font-size: 1.3rem;
  word-break: break-word;
}

.drive-item-meta {
  color: var(--text-muted);
  font-size: 1.15rem;
}

.drive-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.drive-empty {
  min-height: 300px;
  border: 1px dashed #9f9f9f;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #4d4d4d;
  background: #f0f0f0;
  padding: 14px;
}

.roster-overview-grid {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  gap: 12px;
  align-items: stretch;
}

.overview-left {
  border: 1px solid #8e8e8e;
  box-shadow: var(--shadow-outset);
  background: #e3e3e3;
  padding: 10px;
  display: grid;
  gap: 10px;
}

.overview-left-inline {
  display: flex;
  align-items: center;
  gap: 14px;
}

.overview-right {
  display: grid;
  grid-template-rows: 1fr;
}

.overview-right-empty {
  border: 1px dashed #9c9c9c;
  background: linear-gradient(180deg, #ececec 0%, #dfdfdf 100%);
  min-height: 180px;
}

.pixel-pie-wrap {
  display: flex;
  justify-content: flex-start;
  flex: 0 0 auto;
}

.pixel-pie {
  width: 176px;
  height: 176px;
  border-radius: 50%;
  border: 2px solid #666;
  box-shadow: var(--shadow-outset);
  background: var(--pie-bg);
  image-rendering: pixelated;
  position: relative;
}

.pixel-pie::after {
  display: none;
}

.roster-legend {
  display: grid;
  gap: 6px;
  font-size: 1.42rem;
}

.timeline-panel {
  border: 1px solid #8e8e8e;
  box-shadow: var(--shadow-outset);
  background: linear-gradient(180deg, #f0f0f0 0%, #d9d9d9 100%);
  padding: 7px;
  display: grid;
  gap: 6px;
}

.roster-calendar-top {
  width: 100%;
  margin: 0 0 10px;
}

.timeline-title {
  font-size: 1.35rem;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #1b1b1b;
}

.expiry-month-wrap {
  overflow-x: auto;
  border: 1px solid #7d7d7d;
  box-shadow: var(--shadow-inset);
  background: #f7f7f7;
}

.expiry-month-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 1.1rem;
}

.expiry-month-table th,
.expiry-month-table td {
  border: 1px solid #9e9e9e;
  text-align: center;
  padding: 1px 2px;
  white-space: nowrap;
}

.expiry-month-table th {
  background: linear-gradient(180deg, #2b2b2b 0%, #161616 100%);
  color: #f1f1f1;
  font-size: 1rem;
  font-weight: 700;
}

.month-cell {
  min-width: 48px;
  background: #3a9147;
}

.month-cell-hot {
  background: #d98888;
}

.month-cell-hot-2 {
  background: #bf5757;
}

.month-cell-hot-3 {
  background: #9f3232;
}

.month-cell-hot-4 {
  background: #6f1616;
}

.month-pill {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.35);
  box-shadow: var(--shadow-outset);
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  color: #f6f6f6;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.1;
  min-height: 30px;
  padding: 6px 0 5px;
}

.month-cell-hot .month-pill,
.month-cell-hot-2 .month-pill,
.month-cell-hot-3 .month-pill,
.month-cell-hot-4 .month-pill {
  background: rgba(0, 0, 0, 0.22);
}

.month-cell:not(.month-cell-hot) .month-pill {
  color: #f3fff5;
  background: rgba(255, 255, 255, 0.16);
}

.month-data-store {
  display: none;
}

.month-entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.month-entry-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 1.2rem;
}

.month-entry-sep {
  color: #717171;
}

.month-empty {
  margin: 0;
  padding: 4px 0;
  color: var(--text-muted);
  font-size: 1.2rem;
}

.month-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1200;
}

.month-modal.open {
  display: flex;
}

.month-modal-dialog {
  width: min(640px, 100%);
  max-height: 80vh;
  background: linear-gradient(180deg, #f1f1f1 0%, #dddddd 100%);
  border: 1px solid #8b8b8b;
  box-shadow: var(--shadow-outset);
  display: grid;
  grid-template-rows: auto 1fr;
}

.month-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #9a9a9a;
  background: linear-gradient(180deg, #2a2a2a 0%, #191919 100%);
}

.month-modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  color: #f4f4f4;
}

.month-modal-close {
  min-width: 24px;
  height: 22px;
  border: 1px solid #7f7f7f;
  box-shadow: var(--shadow-outset);
  background: #e8e8e8;
  cursor: pointer;
  font-size: 1.2rem;
}

@media (min-width: 1200px) {
  .expiry-month-table th,
  .expiry-month-table td {
    padding-top: 0;
    padding-bottom: 0;
    height: 30px;
  }

  .month-pill {
    min-height: 32px;
    padding-top: 7px;
    padding-bottom: 6px;
  }
}

.month-modal-body {
  overflow: auto;
  padding: 10px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: inherit;
}

.legend-dot {
  width: 13px;
  height: 13px;
  border: 1px solid #434343;
  display: inline-block;
}

.legend-up { background: #2e833a; }
.legend-exp { background: #ccad2a; }
.legend-bad { background: #b43a3a; }

/* Responsive */
@media (max-width: 980px) {
  .file-grid {
    grid-template-columns: 1fr;
  }

  .main-wrapper {
    width: 100%;
    margin-left: 0;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    min-width: 0;
  }

  .app-layout {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .main-content {
    padding: 10px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

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

  .drive-items-grid {
    grid-template-columns: 1fr;
  }

  .roster-overview-grid {
    grid-template-columns: 1fr;
  }

  .overview-left-inline {
    flex-direction: column;
    align-items: flex-start;
  }

  .month-cell {
    min-width: 44px;
  }
}
