/* Shared page-specific styles extracted from HTML files */

/* admin.html */
.admin-grid {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.admin-filter-grid {
  display: grid;
  grid-template-columns: 1fr 120px 120px;
  gap: 10px;
  margin-bottom: 12px;
}
.admin-list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.admin-type-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.admin-type-tab {
  border: 1px solid var(--gray-200);
  background: rgba(255,255,255,.96);
  color: var(--gray-700);
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: .88rem;
  font-weight: 700;
}
.admin-type-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.admin-user-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 250px);
  overflow-y: auto;
}
.admin-user-item {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.admin-user-item:hover {
  border-color: #93c5fd;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.admin-user-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
}
.admin-user-name {
  font-weight: 700;
  color: var(--gray-800);
}
.admin-user-meta {
  color: var(--gray-500);
  font-size: .78rem;
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.admin-detail-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}
.admin-detail-name {
  font-size: 1.25rem;
  font-weight: 700;
}
.admin-detail-sub {
  margin-top: 6px;
  opacity: .88;
  font-size: .86rem;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.admin-badge {
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.16);
  color: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: .76rem;
  font-weight: 600;
}
.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.admin-tab {
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: .84rem;
  font-weight: 600;
}
.admin-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.admin-tab-panel {
  display: none;
}
.admin-tab-panel.active {
  display: block;
}
.admin-subtabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.admin-subtab {
  border: 1px solid var(--gray-200);
  background: rgba(255,255,255,.94);
  color: var(--gray-700);
  border-radius: 999px;
  padding: 9px 15px;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: .9rem;
  font-weight: 700;
}
.admin-subtab.active {
  background: linear-gradient(135deg, var(--primary) 0%, #7c8cf6 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(121, 131, 242, .18);
}
.admin-subpanel {
  display: none;
}
.admin-subpanel.active {
  display: block;
}
.admin-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.admin-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--gray-400);
}
.admin-inline-empty {
  text-align: center;
  color: var(--gray-400);
  padding: 24px 12px;
}
.admin-report-section {
  margin-top: 22px;
}
.admin-report-card {
  overflow: hidden;
}
.admin-report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.admin-report-note {
  color: var(--gray-500);
  font-size: .84rem;
  max-width: 720px;
}
.admin-report-frame-wrap {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  min-height: 520px;
}
.admin-report-frame {
  display: block;
  width: 100%;
  min-height: 520px;
  height: clamp(520px, 72vh, 920px);
  border: 0;
  background: #fff;
}

/* library-books.html */
.report-shell {
  display: grid;
  gap: 14px;
}
.report-hero {
  position: relative;
  overflow: hidden;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  background: var(--white);
  border: 1px solid var(--gray-200);
  box-shadow: 0 10px 24px rgba(111, 127, 150, .08), 0 2px 8px rgba(111, 127, 150, .06);
}
.report-hero-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gray-800);
}
.report-hero-title svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
}
.report-hero-note {
  margin-top: 4px;
  max-width: 820px;
  color: var(--gray-500);
  font-size: .85rem;
  line-height: 1.45;
}
.report-meta-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.report-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--primary);
  font-size: .76rem;
  font-weight: 700;
}
.report-frame-card {
  overflow: hidden;
}
.report-frame-wrap {
  min-height: 620px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  position: relative;
}
.report-frame-scale {
  position: relative;
  width: 1600px;
  transform-origin: top left;
  will-change: transform;
}
.report-frame {
  display: block;
  width: 1600px;
  height: 980px;
  border: 0;
  background: #fff;
}
.report-blocked {
  display: none;
  padding: 56px 24px;
  text-align: center;
  color: var(--gray-500);
}
.report-blocked strong {
  display: block;
  margin-bottom: 8px;
  color: var(--gray-700);
  font-size: 1rem;
}

/* login.html */
.login-footer {
  text-align: center;
  margin-top: auto;
  padding: 18px 20px 26px;
  font-size: .82rem;
  color: rgba(255,255,255,.9);
  width: 100%;
  max-width: 100%;
  background: linear-gradient(160deg, #16345f 0%, #193b6b 48%, #1f4a82 100%);
  border-top: 1px solid rgba(255,255,255,.08);
}
.login-wrapper {
  flex: 1;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - 74px);
}
.login-right {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 20px 28px;
  background:
    linear-gradient(180deg, #ffffff 0%, #ffffff 60%, #f6f9ff 100%);
  animation: loginPanelEnter .8s cubic-bezier(.22,1,.36,1) both;
}
.login-brand {
  text-align: center;
  margin-bottom: 22px;
  animation: loginFadeUp .7s cubic-bezier(.22,1,.36,1) .12s both;
}
.login-brand-logo img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  display: block;
  margin: 0 auto 10px;
}
.login-brand h1 {
  font-size: 1.16rem;
  font-weight: 700;
  color: #173b7a;
  margin-bottom: 4px;
}
.login-brand p {
  color: #8a6a17;
  font-size: .9rem;
}
.login-left {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  background:
    linear-gradient(160deg, #16345f 0%, #193b6b 48%, #1f4a82 100%);
  animation: loginPanelReveal .9s cubic-bezier(.22,1,.36,1) both;
}
.login-left::before,
.login-left::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 1;
}
.login-left::before {
  background:
    linear-gradient(135deg, rgba(255,255,255,.08) 0%, rgba(255,255,255,0) 46%);
}
.login-left::after {
  background:
    radial-gradient(circle at 18% 82%, rgba(255,255,255,.08) 0%, transparent 22%);
}
.login-left-inner {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 58px 44px 48px;
  color: #fff;
}
.login-left-title {
  max-width: 420px;
  font-size: clamp(2rem, 3.8vw, 3.15rem);
  line-height: 1.08;
  line-height: 1.12;
  font-weight: 600;
  letter-spacing: -.03em;
}
.login-left-title span {
  display: block;
  white-space: nowrap;
}
.login-left-title span + span {
  margin-top: 14px;
}
.login-left-subtitle {
  margin-top: 8px;
  font-size: clamp(1.7rem, 3vw, 2.65rem);
  line-height: 1.15;
  font-weight: 600;
  color: #fde6a2;
}
.login-left-note {
  margin-top: 18px;
  max-width: 360px;
  color: rgba(237, 245, 255, .82);
  font-size: .92rem;
  font-weight: 500;
  letter-spacing: .02em;
  line-height: 1.65;
}
.login-left-lock {
  width: 118px;
  height: 118px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.86);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.96);
  background: rgba(255,214,102,.08);
  box-shadow: 0 0 0 10px rgba(255,214,102,.06);
  animation: loginFloatIn .9s cubic-bezier(.22,1,.36,1) .18s both;
}
.first-password-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #e8dcc0;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fffdfa 0%, #fff8ea 100%);
}
.first-password-card h3 {
  margin-bottom: 6px;
  font-size: 1rem;
  color: var(--gray-800);
}
.first-password-card p {
  margin-bottom: 14px;
  font-size: .86rem;
  line-height: 1.6;
  color: var(--gray-500);
}
.login-alt-action {
  margin-top: 12px;
}
.login-alt-action .btn {
  min-height: 46px;
  border-color: #d8e2f4;
  color: #20427f;
  background: #f9fbff;
}
.login-submit-btn {
  margin-top: 8px;
  min-height: 48px;
  background: linear-gradient(135deg, #18448c 0%, #2b63b6 100%);
  border-color: rgba(24,68,140,.2);
  box-shadow: 0 12px 24px rgba(24, 68, 140, .16);
}
.login-submit-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #143a77 0%, #2458a5 100%);
  box-shadow: 0 14px 26px rgba(24, 68, 140, .2);
}
.login-card {
  background: linear-gradient(180deg, rgba(255,255,255,.98) 0%, #fffdf7 100%);
  border-color: #e4e8f0;
  animation: loginFadeUp .8s cubic-bezier(.22,1,.36,1) .22s both;
}
.login-logo h2 {
  color: #173b7a;
}
.login-logo p {
  color: #8a6a17;
}
.login-card .form-control {
  border-color: #d8deea;
  background: rgba(255,255,255,.96);
}
.login-card .form-control:focus {
  border-color: #c8a84b;
  box-shadow: 0 0 0 4px rgba(200, 168, 75, .12);
}
.login-card .input-group {
  border-radius: 14px;
  overflow: hidden;
}
.login-card .form-label {
  color: #28405f;
  font-weight: 700;
}
.login-help {
  margin-top: 18px;
  text-align: center;
  color: #173b7a;
  font-size: 1.02rem;
  font-weight: 600;
  font-family: var(--font-family);
  background: transparent;
  border: 0;
  cursor: pointer;
  width: 100%;
}

@keyframes loginPanelReveal {
  from {
    opacity: 0;
    transform: translateX(-18px) scale(.985);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes loginPanelEnter {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes loginFadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes loginFloatIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* personal.html */
.personal-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .9fr);
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  margin-bottom: 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 24px rgba(111, 127, 150, .08), 0 2px 8px rgba(111, 127, 150, .05);
}
.personal-summary-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.personal-summary-avatar {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e1efff 0%, #d9f5ef 100%);
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 800;
  flex-shrink: 0;
}
.personal-summary-text {
  min-width: 0;
}
.personal-summary-name {
  font-size: 1.16rem;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1.35;
}
.personal-summary-role {
  margin-top: 4px;
  color: var(--gray-500);
  font-size: .88rem;
  line-height: 1.5;
}
.personal-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.personal-summary-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #f7faff;
  border: 1px solid #d9e5fb;
  color: var(--gray-700);
  font-size: .8rem;
  font-weight: 600;
}
.personal-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.personal-summary-stat {
  min-height: 84px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  background: #fbfdff;
}
.personal-summary-stat-label {
  display: block;
  color: var(--gray-500);
  font-size: .78rem;
  margin-bottom: 6px;
}
.personal-summary-stat-value {
  display: block;
  color: var(--gray-800);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}
.personal-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.personal-tab {
  border: 1px solid var(--gray-200);
  background: rgba(255,255,255,.92);
  color: var(--gray-700);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: .96rem;
  font-weight: 700;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.personal-tab:hover {
  border-color: #cfcaf8;
  color: var(--primary);
}
.personal-tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, #7c8cf6 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(121, 131, 242, .22);
}
.personal-panel {
  display: none;
}
.personal-panel.active {
  display: block;
}

@media (max-width: 900px) {
  .personal-summary-card {
    grid-template-columns: 1fr;
  }
  .personal-summary-stats {
    grid-template-columns: 1fr;
  }
}

/* research.html + training.html */
.research-title-cell {
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topic-cell {
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.research-report-section {
  margin-top: 22px;
}
.research-report-card {
  overflow: hidden;
}
.research-report-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.research-report-note {
  color: var(--gray-500);
  font-size: .84rem;
  max-width: 720px;
}
.research-report-frame-wrap {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
  min-height: 520px;
}
.research-report-frame {
  display: block;
  width: 100%;
  min-height: 520px;
  height: clamp(520px, 72vh, 920px);
  border: 0;
  background: #fff;
}
.mobile-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}
.mobile-card-title  { font-weight: 600; color: var(--gray-800); margin-bottom: 4px; font-size: .92rem; }
.mobile-card-meta   { font-size: .78rem; color: var(--gray-500); display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.mobile-card-actions{ display: flex; gap: 8px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* budget.html */
.budget-shell {
  width: min(1320px, 100%);
  margin: 0 auto;
}
.budget-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
  margin-bottom: 14px;
}
.budget-kicker {
  display: none;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  font-weight: 600;
}
.budget-hero-copy {
  padding-top: 6px;
}
.budget-hero .page-title {
  margin: 0;
  color: var(--gray-800);
}
.budget-hero .page-title svg {
  color: var(--gray-700);
}
.budget-hero p {
  margin: 3px 0 0;
  color: var(--gray-500);
  line-height: 1.55;
  font-size: 0.85rem;
}
.budget-hero-tools {
  display: grid;
  gap: 12px;
  align-content: start;
}
.budget-tool-card,
.budget-stat-card,
.budget-panel-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(87, 118, 167, 0.12);
}
.budget-tool-card {
  padding: 14px;
  color: var(--gray-700);
}
.budget-tool-card label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.95rem;
}
.budget-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.budget-btn-ghost {
  background: #eef2ff;
  color: var(--primary-dark);
  border: 1px solid #d7defe;
}
.budget-btn-ghost:hover:not(:disabled) {
  background: #e4eafe;
}
.budget-btn-light {
  background: #fff;
  color: var(--primary-dark);
  border: 1px solid #d7defe;
}
.budget-btn-light:hover:not(:disabled) {
  background: #eef2ff;
}
.budget-status {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  line-height: 1.5;
  font-size: 0.96rem;
}
.budget-status.show { display: block; }
.budget-status.info { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.budget-status.success { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.budget-status.error { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.budget-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.budget-stat-card { padding: 16px; }
.budget-stat-label { display: block; color: var(--gray-500); font-size: 0.82rem; }
.budget-stat-value { display: block; margin-top: 8px; font-size: clamp(1.7rem, 2.5vw, 2.2rem); line-height: 1.05; color: var(--gray-700); }
.budget-stat-hint { display: block; margin-top: 4px; color: var(--gray-500); font-size: 0.78rem; }
.budget-stat-value.positive { color: var(--success); }
.budget-stat-value.negative { color: var(--danger); }
.budget-stat-value.warning { color: var(--warning); }
.budget-insight-grid {
  margin-top: 14px;
}
.budget-insight-card {
  background:
    radial-gradient(circle at top right, rgba(79, 70, 229, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 41, 59, 0.96));
  color: #e2e8f0;
}
.budget-insight-body {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
}
.budget-focus-pill {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5f5;
  font-size: 0.74rem;
  font-weight: 600;
}
.budget-insight-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex: 1 1 320px;
  min-width: 0;
}
.budget-insight-value {
  font-size: 0.95rem;
  line-height: 1.2;
  color: #fff;
  white-space: nowrap;
}
.budget-insight-text {
  display: inline-block;
  color: rgba(226, 232, 240, 0.86);
  line-height: 1.35;
  font-size: 0.8rem;
  min-width: 0;
}
.budget-insight-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
  align-items: center;
}
.budget-insight-card .budget-btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
}
.budget-insight-actions .btn {
  padding: 7px 10px;
  font-size: 0.78rem;
  line-height: 1.1;
}
.budget-chart-panel canvas {
  cursor: pointer;
}
.budget-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
  align-items: stretch;
}
.budget-section-card {
  border: 1px solid #e6edf9;
}
.budget-section-body {
  display: grid;
  gap: 14px;
  align-items: stretch;
}
.budget-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}
.budget-table-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  border: 1px solid #edf2fb;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.85), #fff);
}
.budget-chart-group {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  border: 1px solid #edf2fb;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(238, 242, 255, 0.4), rgba(255, 255, 255, 0.98));
  overflow: hidden;
}
.budget-chart-head {
  padding: 14px 14px 0;
}
.budget-chart-head h3 {
  margin: 0;
  font-size: 0.96rem;
}
.budget-chart-head p {
  margin: 4px 0 0;
  color: var(--gray-500);
  font-size: 0.8rem;
}
.budget-panel-card {
  position: relative;
  min-height: 0;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.budget-panel-head {
  display: flex;
  justify-content: flex-start;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 14px 0;
  flex-direction: column;
}
.budget-panel-head h2 { margin: 0; font-size: 1rem; }
.budget-panel-head p { margin: 3px 0 0; color: var(--gray-500); font-size: 0.8rem; }
.budget-panel-body { padding: 14px; }
.budget-chart-panel {
  min-height: 280px;
  height: 280px;
  flex: 1;
}
.budget-chart-group:hover,
.budget-chart-group:focus-within {
  box-shadow: inset 0 0 0 1px rgba(79, 70, 229, 0.12);
}
.budget-table-body {
  max-height: 360px;
  overflow: hidden;
}
.budget-table-wrap {
  max-height: 330px;
  overflow: auto;
  min-height: 0;
}
.budget-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
.budget-table th,
.budget-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #edf2fb;
  vertical-align: top;
  text-align: left;
  font-size: 0.84rem;
}
.budget-table th {
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
  font-size: 0.76rem;
  color: var(--gray-500);
}
.budget-action-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.budget-action-buttons .btn { padding: 6px 9px; font-size: 0.72rem; border-radius: 9px; }
.budget-action-buttons .btn-edit { background: #eef2ff; color: var(--primary); }
.budget-action-buttons .btn-delete { background: #fef2f2; color: var(--danger); }
.budget-empty-row td { color: var(--gray-500); text-align: center; }
.budget-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.budget-modal.hidden { display: none; }
.budget-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(3px);
}
.budget-modal-card {
  position: relative;
  width: min(560px, calc(100% - 24px));
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}
.budget-modal-lg { width: min(680px, calc(100% - 24px)); }
.budget-modal-header,
.budget-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}
.budget-modal-header { border-bottom: 1px solid #edf2fb; }
.budget-modal-footer { border-top: 1px solid #edf2fb; justify-content: flex-end; }
.budget-modal-body {
  padding: 14px;
  max-height: min(72vh, 620px);
  overflow: auto;
}
.budget-icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: #f3f6fb;
  cursor: pointer;
  color: var(--gray-700);
}
.budget-form-grid,
.budget-clone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}
.budget-field { display: grid; gap: 5px; }
.budget-field-wide { grid-column: 1 / -1; }
.budget-guide-list { display: grid; gap: 14px; }
.budget-guide-item { display: flex; gap: 14px; align-items: flex-start; }
.budget-guide-item span {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--primary);
  font-weight: 700;
}
.budget-guide-item p { margin: 0; line-height: 1.65; }
.budget-modal-header h3 {
  margin: 0;
  font-size: 0.98rem;
}
.budget-field label {
  font-size: 0.84rem;
}
.budget-modal-body .form-control {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 0.92rem;
}
.budget-hero-tools .form-control,
.budget-tool-card .form-control {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 0.92rem;
}

@media (min-width: 768px) {
  .login-wrapper {
    display: grid;
    grid-template-columns: minmax(240px, .62fr) minmax(420px, 1.38fr);
    gap: 0;
    width: 100%;
    align-items: stretch;
    min-height: calc(100dvh - 74px);
  }
  .login-left { display: block !important; }
}

@media (max-width: 767px) {
  .login-wrapper {
    min-height: auto;
  }
  .login-right {
    padding: 24px 16px 18px;
  }
  .login-brand {
    margin-bottom: 18px;
  }
  .login-brand-logo img {
    width: 78px;
    height: 78px;
  }
  .login-brand h1 {
    font-size: 1.04rem;
  }
  .login-brand p {
    font-size: .82rem;
  }
  .login-help {
    margin-top: 16px;
    font-size: .96rem;
  }
}

@media (max-width: 1180px) {
  .budget-workspace { grid-template-columns: 1fr; }
  .budget-chart-grid { grid-template-columns: 1fr; }
  .budget-chart-panel {
    min-height: 260px;
    height: 260px;
  }
}

@media (max-width: 900px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .admin-user-list {
    max-height: none;
  }
  .admin-report-frame-wrap,
  .admin-report-frame {
    min-height: 480px;
  }
  .research-report-frame-wrap,
  .research-report-frame {
    min-height: 480px;
  }
  .budget-hero,
  .budget-stats-grid,
  .budget-form-grid,
  .budget-clone-grid {
    grid-template-columns: 1fr;
  }
  .budget-hero {
    gap: 14px;
  }
  .budget-hero-actions .btn {
    flex: 1 1 calc(50% - 10px);
  }
}

@media (max-width: 640px) {
  .admin-filter-grid {
    grid-template-columns: 1fr;
  }
  .admin-report-frame-wrap,
  .admin-report-frame {
    min-height: 420px;
    height: 78vh;
  }
  .report-hero {
    padding: 12px 14px;
  }
  .report-frame-wrap,
  .report-frame {
    min-height: 520px;
  }
  .research-report-frame-wrap,
  .research-report-frame {
    min-height: 420px;
    height: 78vh;
  }
  .budget-shell { width: 100%; }
  .budget-hero { gap: 12px; }
  .budget-hero-actions .btn { flex: 1 1 100%; }
  .budget-panel-head,
  .budget-panel-body,
  .budget-modal-header,
  .budget-modal-body,
  .budget-modal-footer {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (min-width: 641px) {
  #mobile-cards { display: none !important; }
}

@media (max-width: 640px)  {
  #desktop-view { display: none !important; }
}
