/* ProjectHub – lớp giao diện 6.0.
 * Chỉ đổi màu, bo góc, đổ bóng, chữ và trạng thái focus/hover trên MÀN HÌNH.
 * Không đổi bố cục, không ẩn/hiện phần tử, không đụng bản in/PDF,
 * không ghi đè màu do Quản trị cấu hình trong CSDL (banner, nút đang chọn, menu Cấu hình).
 * Muốn trở về giao diện cũ: xóa dòng nạp theme.css trong index.html.
 */
@media screen {
  :root {
    --green: #00796b;
    --dark: #005a50;
    --gold: #f2b81f;
    --ink: #14302c;
    --muted: #566d69;
    --line: #dce8e5;
    --t-soft: #f3f8f7;
    --t-tint: #e7f3f0;
    --t-shadow-sm: 0 1px 2px rgba(11, 58, 50, 0.06), 0 1px 4px rgba(11, 58, 50, 0.06);
    --t-shadow: 0 10px 28px -16px rgba(11, 58, 50, 0.3), 0 2px 6px rgba(11, 58, 50, 0.05);
    --t-ring: 0 0 0 3px rgba(0, 121, 107, 0.2);
    font-family: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
  }
  :root body {
    background:
      radial-gradient(1200px 420px at 50% 0, #e4f2ee 0%, rgba(228, 242, 238, 0) 70%) fixed,
      #f4f7f6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  /* Đầu trang và thanh phân hệ */
  :root body #fixedHeader31 {
    box-shadow: 0 6px 18px -10px rgba(0, 50, 44, 0.45);
  }
  :root body #fixedHeader31 > .topbar {
    background-image: linear-gradient(100deg, rgba(0, 35, 40, 0.28), rgba(0, 150, 130, 0.12));
    border-bottom: 3px solid var(--gold);
  }
  :root body #fixedHeader31 > .module-grid {
    border-color: #d3e4e0;
    box-shadow: var(--t-shadow-sm);
  }
  :root body .module-grid > .module-button {
    background: #fff;
    color: var(--dark);
    border: 1px solid #cbdfda;
    box-shadow: var(--t-shadow-sm);
    transition:
      background-color 0.15s,
      border-color 0.15s,
      box-shadow 0.15s;
  }
  :root body .module-grid > .module-button .module-number {
    color: #8a6500;
  }
  :root body .module-grid > .module-button:hover {
    background: var(--t-tint);
    border-color: var(--green);
    filter: none;
  }
  :root body .module-grid > .module-button[aria-pressed='true'] {
    border-color: var(--gold);
    box-shadow:
      0 0 0 2px rgba(242, 184, 31, 0.35),
      0 6px 14px -8px rgba(0, 60, 50, 0.55);
  }
  :root body .module-grid > .module-button[aria-pressed='true'] .module-number {
    color: #ffd66b;
  }

  /* Khung nội dung */
  :root body .welcome {
    border-radius: 14px;
    box-shadow: var(--t-shadow-sm);
  }
  :root body .work-area {
    background: rgba(255, 255, 255, 0.78);
    border-color: var(--line);
    border-radius: 18px;
    box-shadow: var(--t-shadow);
  }
  :root body .card {
    border-color: var(--line);
    border-radius: 14px;
    box-shadow: var(--t-shadow-sm);
  }
  :root body .card h2,
  :root body .panel-heading h2 {
    color: var(--ink);
    letter-spacing: -0.01em;
  }
  :root body .panel-heading {
    border-bottom: 1px solid var(--line);
  }
  :root body .panel-kicker {
    color: var(--green);
  }
  :root body .metric {
    background: linear-gradient(160deg, #fff 40%, #eef8f5);
    border-color: var(--line);
    border-left: 4px solid var(--green);
    border-radius: 14px;
    box-shadow: var(--t-shadow-sm);
  }
  :root body .metric strong {
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
  }

  /* Bảng: dùng :where() để màu cảnh báo (quá hạn, tạm dừng...) của phân hệ luôn được ưu tiên */
  :root body table {
    font-variant-numeric: tabular-nums;
  }
  :where(tbody tr:nth-child(even)) {
    background-color: #fafcfc;
  }
  :where(tbody tr:hover) {
    background-color: #eef7f5;
  }
  :where(th) {
    background: #eef6f4;
  }
  :root body th {
    color: #1d564d;
    border-bottom-color: #c9ddd8;
  }

  /* Nút bấm: giữ nguyên kích thước của từng phân hệ */
  :root body button {
    transition:
      filter 0.15s,
      box-shadow 0.15s,
      border-color 0.15s;
  }
  :root body button:not(:disabled):hover {
    box-shadow: 0 3px 10px -4px rgba(0, 70, 60, 0.4);
  }
  :root body button:disabled {
    cursor: not-allowed;
    box-shadow: none;
  }
  :where(.secondary) {
    border-color: #c6ddd7;
  }
  :root body button:focus-visible,
  :root body a:focus-visible {
    outline: 3px solid #d79b00;
    outline-offset: 2px;
  }

  /* Nhập liệu */
  :root body input:not([type='checkbox'], [type='radio'], [type='color'], [type='file'], [type='range']),
  :root body select,
  :root body textarea {
    border-color: #c4d9d4;
    transition:
      border-color 0.15s,
      box-shadow 0.15s;
  }
  :root body input:not([type='checkbox'], [type='radio'], [type='color'], [type='range']):focus-visible,
  :root body select:focus-visible,
  :root body textarea:focus-visible {
    outline: 2px solid transparent;
    border-color: var(--green);
    box-shadow: var(--t-ring);
  }
  :root body input[type='checkbox'],
  :root body input[type='radio'] {
    accent-color: var(--green);
  }

  /* Hộp thoại */
  :root body dialog {
    border-radius: 16px;
    box-shadow: 0 30px 80px -20px rgba(4, 38, 33, 0.55);
  }
  :root body dialog::backdrop {
    background: rgba(6, 40, 35, 0.52);
    backdrop-filter: blur(2px);
  }

  /* Đăng nhập / đổi mật khẩu */
  :root body #loginSection,
  :root body #changeSection {
    max-width: 440px;
    margin-top: 36px;
    padding: 30px 32px 32px;
    border-top: 4px solid var(--gold);
    border-radius: 18px;
    box-shadow: 0 24px 60px -28px rgba(5, 60, 52, 0.45);
  }
  :root body #loginSection h2,
  :root body #changeSection h2 {
    text-align: center;
    font-size: 21px;
    margin-bottom: 20px;
  }
  :root body #loginSection form,
  :root body #changeSection form {
    gap: 16px;
  }

  :root body .tableArea {
    scrollbar-width: thin;
    scrollbar-color: #a9c8c0 transparent;
  }
}
@media screen and (prefers-reduced-motion: reduce) {
  :root body * {
    transition: none !important;
  }
}

/* Phones: let panel header buttons wrap below the title instead of covering it. */
@media screen and (max-width: 600px) {
  :root body #panel-tasks .r3-workspace > .card > .r3-row:first-child,
  :root body #panel-materials #v59ProjectMaterials > .v59-heading {
    flex-wrap: wrap !important;
    justify-content: flex-start;
    overflow-x: visible;
  }
  :root body #panel-tasks .r3-workspace > .card > .r3-row:first-child > h2,
  :root body #panel-materials #v59ProjectMaterials > .v59-heading > h2 {
    flex: 0 0 auto;
  }
  :root body #panel-tasks .r3-workspace > .card > .r3-row:first-child > .r3-row,
  :root body #panel-materials #v59ProjectMaterials > .v59-heading > .v59-toolbar {
    flex: 1 1 100%;
    flex-wrap: wrap !important;
    justify-content: flex-start;
  }
}
