/* ============================================================
   Command Center (指令中枢) — Style Sheet
   Desktop context (cockpit/webadmin) — 九方智汇皮肤
   ============================================================ */

/* ── Reset & Base ── */

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

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Manrope", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0d1118;
  color: #f0f4f8;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
  line-height: 1.3;
  color: #f0f4f8;
}

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

a:hover {
  opacity: 0.85;
}

img {
  max-width: 100%;
  display: block;
}

ul, ol {
  list-style: none;
}

/* ── Scrollbar ── */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0d1118;
}

::-webkit-scrollbar-thumb {
  background: rgba(201, 169, 98, 0.3);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(201, 169, 98, 0.5);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 169, 98, 0.3) #0d1118;
}


/* ── Focus Management ── */

:focus-visible {
  outline: 2px solid #c9a962;
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}


/* ============================================================
   LAYOUT — Sidebar + Topbar + Main
   ============================================================ */

/* ── Sidebar ── */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 200px;
  height: 100vh;
  background: #151b25;
  border-right: 1px solid rgba(255, 255, 255, 0.13);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.sidebar-logo-img {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
}

.sidebar-logo-text {
  font-family: "Noto Serif SC", serif;
  font-weight: 700;
  font-size: 15px;
  color: #c9a962;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: #a5afbf;
  font-size: 13px;
  font-weight: 600;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
  cursor: pointer;
}

.sidebar-item:hover {
  color: #f0f4f8;
  background: rgba(201, 169, 98, 0.06);
}

.sidebar-item.active {
  color: #c9a962;
  border-left-color: #c9a962;
  background: rgba(201, 169, 98, 0.08);
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}


/* ── Topbar ── */

.topbar {
  position: sticky;
  top: 0;
  left: 200px;
  right: 0;
  height: 56px;
  background: rgba(13, 17, 24, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 100;
  margin-left: 200px;
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: #a5afbf;
  cursor: pointer;
  padding: 4px;
}

.sidebar-toggle:hover {
  color: #f0f4f8;
}

.topbar-title {
  font-family: "Noto Serif SC", serif;
  font-size: 16px;
  font-weight: 700;
  color: #f0f4f8;
}

.topbar-spacer {
  flex: 1;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(201, 169, 98, 0.18);
  border: 1px solid rgba(201, 169, 98, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #c9a962;
  overflow: hidden;
}

.topbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topbar-username {
  font-size: 13px;
  color: #a5afbf;
  font-weight: 600;
}


/* ── Main Content ── */

.main-content {
  margin-left: 200px;
  padding: clamp(18px, 2.6vw, 40px);
  min-height: calc(100vh - 56px);
  max-width: 1360px;
}

.page-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
}


/* ============================================================
   COMPONENTS
   ============================================================ */

/* ── Cards (gradient style — desktop context) ── */

.stat-card {
  background: linear-gradient(180deg, rgba(21, 27, 37, 0.92), rgba(21, 27, 37, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 18px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.15s ease;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(201, 169, 98, 0.4);
  border-radius: 18px 18px 0 0;
}

.stat-card[data-filter]:hover {
  border-color: rgba(201, 169, 98, 0.3);
  transform: translateY(-2px);
}

.stat-card:nth-child(1)::before { background: #facc15; }
.stat-card:nth-child(2)::before { background: #60a5fa; }
.stat-card:nth-child(3)::before { background: #4ade80; }
.stat-card:nth-child(4)::before { background: #f87171; }
.stat-card:nth-child(5)::before { background: #fb923c; }

.stat-card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card-label {
  font-size: 12px;
  color: #a5afbf;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.stat-card-value {
  font-family: "Manrope", sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: #f0f4f8;
  line-height: 1.1;
}

.stat-card:nth-child(1) .stat-card-value { color: #facc15; }
.stat-card:nth-child(4) .stat-card-value { color: #f87171; }

.stat-card-value.gold {
  color: #c9a962;
}

.stat-card-footer {
  font-size: 12px;
  color: #a5afbf;
  margin-top: 4px;
}


/* ── Card (generic panel) ── */

.card {
  background: linear-gradient(180deg, rgba(21, 27, 37, 0.95), rgba(21, 27, 37, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  padding: 24px;
  overflow-x: auto;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-family: "Noto Serif SC", serif;
  font-size: 15px;
  font-weight: 700;
  color: #f0f4f8;
}

.card-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 16px;
  background: #c9a962;
  border-radius: 2px;
  margin-right: 10px;
  vertical-align: middle;
}


/* ── Data Table ── */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: auto;
}

.data-table thead th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: #a5afbf;
  font-size: 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  white-space: nowrap;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.data-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #f0f4f8;
  vertical-align: middle;
  white-space: nowrap;
}

.data-table tbody td:nth-child(1) {
  font-size: 12px;
  color: #a5afbf;
  font-family: "Manrope", monospace;
  letter-spacing: -0.02em;
}

.data-table tbody td:nth-child(2) {
  white-space: normal;
  max-width: 180px;
}

.data-table tbody tr {
  background: transparent;
  transition: background 0.12s ease;
}

.data-table tbody tr:hover {
  background: rgba(201, 169, 98, 0.04);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(21, 27, 37, 0.4);
}

.data-table tbody tr:nth-child(even):hover {
  background: rgba(201, 169, 98, 0.06);
}


/* ── Timeline ── */

.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: rgba(255, 255, 255, 0.13);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #c9a962;
  border: 2px solid #0d1118;
}

.timeline-item.success::before { background: #4ade80; }
.timeline-item.danger::before  { background: #f87171; }
.timeline-item.warning::before { background: #fb923c; }
.timeline-item.info::before    { background: #60a5fa; }

.timeline-time {
  font-size: 11px;
  color: #a5afbf;
  margin-bottom: 2px;
}

.timeline-title {
  font-size: 13px;
  font-weight: 600;
  color: #f0f4f8;
}

.timeline-desc {
  font-size: 12px;
  color: #a5afbf;
  margin-top: 2px;
}


/* ── Drawer ── */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 90vw;
  height: 100vh;
  background: #151b25;
  border-left: 1px solid rgba(255, 255, 255, 0.13);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  flex-shrink: 0;
}

.drawer-title {
  font-family: "Noto Serif SC", serif;
  font-size: 16px;
  font-weight: 700;
  color: #f0f4f8;
}

.drawer-close {
  background: none;
  border: none;
  color: #a5afbf;
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
}

.drawer-close:hover {
  color: #f0f4f8;
}

.drawer-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.drawer-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}


/* ── Modal ── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1009;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #151b25;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  z-index: 1010;
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  flex-shrink: 0;
}

.modal-title {
  font-family: "Noto Serif SC", serif;
  font-size: 16px;
  font-weight: 700;
  color: #f0f4f8;
}

.modal-close {
  background: none;
  border: none;
  color: #a5afbf;
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
}

.modal-close:hover {
  color: #f0f4f8;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-shrink: 0;
}


/* ── Toast ── */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #151b25;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 13px;
  color: #f0f4f8;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  pointer-events: auto;
  transform: translateX(110%);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-success {
  border-left: 3px solid #4ade80;
}

.toast-error {
  border-left: 3px solid #f87171;
}

.toast-warning {
  border-left: 3px solid #fb923c;
}

.toast-info {
  border-left: 3px solid #60a5fa;
}

.toast-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}


/* ── Buttons ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.06);
  color: #f0f4f8;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  background: #c9a962;
  color: #0d1118;
  border-color: #c9a962;
}

.btn-primary:hover {
  background: rgba(201, 169, 98, 0.85);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.25);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: #a5afbf;
}

.btn-ghost:hover {
  color: #f0f4f8;
  background: rgba(255, 255, 255, 0.06);
}

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn.loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

.btn.loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 999px;
  animation: spin 0.6s linear infinite;
  margin-left: 4px;
}


/* ── Form Elements ── */

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #a5afbf;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 9px 14px;
  font-family: inherit;
  font-size: 13px;
  color: #f0f4f8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 12px;
  transition: border-color 0.15s ease;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #c9a962;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(165, 175, 191, 0.5);
}

.form-hint {
  font-size: 12px;
  color: #a5afbf;
  margin-top: 4px;
  line-height: 1.4;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23a5afbf' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select option {
  background: #151b25;
  color: #f0f4f8;
}

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

.form-value {
  font-size: 13px;
  color: #f0f4f8;
  line-height: 1.5;
  word-break: break-word;
}

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


/* ── Status Badges ── */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge-success {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
}

.status-badge-danger {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
}

.status-badge-warning {
  background: rgba(251, 146, 60, 0.12);
  color: #fb923c;
}

.status-badge-pending {
  background: rgba(250, 204, 21, 0.12);
  color: #facc15;
}

.status-badge-info {
  background: rgba(96, 165, 250, 0.12);
  color: #60a5fa;
}

.status-badge-disabled {
  background: rgba(127, 137, 152, 0.12);
  color: #7f8998;
}


/* ── Priority Labels ── */

.priority-urgent {
  background: rgba(248, 113, 113, 0.12);
  color: #f87171;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.priority-today {
  background: rgba(250, 204, 21, 0.12);
  color: #facc15;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.priority-week {
  background: rgba(96, 165, 250, 0.12);
  color: #60a5fa;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}


/* ── Empty State ── */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  color: #a5afbf;
  text-align: center;
}

.empty-state-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state-text {
  font-size: 15px;
  font-weight: 600;
  color: #a5afbf;
  margin-bottom: 6px;
}

.empty-state-hint {
  font-size: 12px;
  color: rgba(165, 175, 191, 0.6);
}


/* ── Skeleton / Shimmer ── */

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
}

.skeleton-line {
  height: 14px;
  margin-bottom: 12px;
  border-radius: 6px;
}

.skeleton-line:nth-child(odd) {
  width: 80%;
}

.skeleton-line:nth-child(even) {
  width: 60%;
}

.skeleton-line:last-child {
  margin-bottom: 0;
}

.skeleton-card {
  height: 80px;
  margin-bottom: 12px;
}

/* After 5 seconds, show fallback text for skeleton */
.skeleton-fallback {
  display: none;
  font-size: 12px;
  color: #a5afbf;
  text-align: center;
  margin-top: 12px;
}

.skeleton-container.timed-out .skeleton-fallback {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
  }
}


/* ── Spinner ── */

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #c9a962;
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
    border-top-color: #c9a962;
    opacity: 0.5;
  }
}


/* ── Pagination ── */

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  margin-top: 20px;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #a5afbf;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.pagination-btn:hover {
  color: #f0f4f8;
  background: rgba(255, 255, 255, 0.06);
}

.pagination-btn.active {
  background: #c9a962;
  color: #0d1118;
  border-color: #c9a962;
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 12px;
  color: #a5afbf;
  margin: 0 8px;
}


/* ── Filter Bar ── */

.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.filter-bar .form-input,
.filter-bar .form-select {
  width: auto;
  min-width: 140px;
}


/* ── Tab Bar ── */

.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  margin-bottom: 20px;
}

.tab-item {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #a5afbf;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.tab-item:hover {
  color: #f0f4f8;
}

.tab-item.active {
  color: #c9a962;
  border-bottom-color: #c9a962;
}


/* ── Bar Chart (pure CSS) ── */

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding: 0 4px;
}

.bar {
  flex: 1;
  min-width: 20px;
  background: rgba(201, 169, 98, 0.3);
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: height 0.4s ease, background 0.2s ease;
}

.bar:hover {
  background: rgba(201, 169, 98, 0.6);
}

.bar-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: #a5afbf;
  white-space: nowrap;
}

.bar-value {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: #f0f4f8;
  white-space: nowrap;
}


/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}


/* ============================================================
   UTILITIES
   ============================================================ */

.text-muted   { color: #a5afbf; }
.text-gold    { color: #c9a962; }
.text-success { color: #4ade80; }
.text-danger  { color: #f87171; }
.text-warning { color: #fb923c; }
.text-caution { color: #facc15; }
.text-info    { color: #60a5fa; }

.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.flex       { display: flex; }
.flex-col   { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.grid-2.equal {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.hidden { display: none !important; }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ── Clickable table rows ── */

.data-table tbody tr[data-idx] {
  cursor: pointer;
}

.data-table tbody tr[data-idx]:hover {
  background: rgba(201, 169, 98, 0.08);
}


/* ── Drawer actions row ── */

.drawer-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}


/* ============================================================
   RESPONSIVE — collapse sidebar at 768px
   ============================================================ */

/* ── Overview page helpers ── */

.stat-card-grid + div > .btn-primary {
  border-radius: 12px;
  font-size: 13px;
  padding: 9px 22px;
  box-shadow: 0 4px 16px rgba(201, 169, 98, 0.2);
}

/* Compact tables inside overview cards */
.grid-2 .data-table tbody td {
  padding: 8px 10px;
  font-size: 12px;
}

.grid-2 .data-table thead th {
  padding: 8px 10px;
  font-size: 10px;
}


@media (max-width: 1024px) {
  .stat-card-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar.open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }

  .topbar {
    margin-left: 0;
    left: 0;
  }

  .sidebar-toggle {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .stat-card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-bar .form-input,
  .filter-bar .form-select {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .stat-card-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Settings Page ── */
.settings-desc { font-size: 13px; color: #a5afbf; margin-top: 4px; }
.settings-tab-content { display: none; padding: 20px 0 0; }
.settings-tab-content.active { display: block; }
.settings-section-hint { font-size: 12px; color: #a5afbf; margin-bottom: 16px; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 768px) {
  .settings-grid { grid-template-columns: 1fr; }
}

.settings-column {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 16px;
}
.settings-column-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.settings-column-title.priority-urgent { color: #f87171; }
.settings-column-title.priority-today  { color: #facc15; }
.settings-column-title.priority-week   { color: #60a5fa; }

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
}
.settings-row-label { font-size: 12px; color: #a5afbf; }
.settings-row .form-input { width: 80px; text-align: center; }

.settings-time-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.settings-time-group .form-input { width: 140px; }
.settings-time-separator { color: #a5afbf; font-size: 14px; }

.settings-save-area { margin-top: 24px; }

/* ── Admin Auth ── */
.admin-auth-search { max-width: 300px; margin-bottom: 16px; }
.admin-auth-list { max-height: 400px; overflow-y: auto; }
.admin-auth-dept {
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: 12px;
  color: #a5afbf;
  font-weight: 600;
}
.admin-auth-item label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  cursor: pointer;
}
.admin-auth-item-title { font-size: 12px; color: #a5afbf; }
.admin-auth-ceo { opacity: 0.6; }
.admin-auth-actions { margin-top: 16px; }
