:root {
  color-scheme: light;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --text: #0F172A;
  --muted: #64748B;
  --line: #E2E8F0;
  
  --brand-from: #4F46E5;
  --brand-to: #7C3AED;
  --brand-gradient: linear-gradient(135deg, var(--brand-from) 0%, var(--brand-to) 100%);
  
  --green-from: #059669;
  --green-to: #10B981;
  --green: #10B981;
  --orange: #F59E0B;
  --red: #EF4444;
  --blue: #3B82F6;

  --shadow-sm: 0 4px 6px -1px rgba(15, 23, 42, 0.05), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, 0.12);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(79, 70, 229, 0.06), transparent 25vw),
    radial-gradient(circle at 85% 30%, rgba(124, 58, 237, 0.06), transparent 25vw);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body.modal-open { overflow: hidden; }

h1, h2, h3, .month-title, .day-number, .action-chooser-name {
  font-family: 'Outfit', 'Inter', sans-serif;
}

button, input, select {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover {
  border-color: #CBD5E1;
  background: #F8FAFC;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

button.primary {
  border: none;
  background: var(--brand-gradient);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

button.primary:hover {
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
  filter: brightness(1.1);
}

button.danger {
  border-color: #FCA5A5;
  color: var(--red);
  background: #FEF2F2;
}
button.danger:hover {
  background: #FEE2E2;
}

input, select {
  width: 100%;
  min-height: 40px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  padding: 8px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--brand-from);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

input:disabled {
  background: #F1F5F9 !important;
  color: var(--muted);
  cursor: not-allowed;
}

main {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 24px;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px max(24px, calc((100vw - 1280px) / 2 + 24px));
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  color: var(--text);
}

.app-header h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.app-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.connection-status {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.status-pill {
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  background: #D1FAE5;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.status-pill::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-note {
  max-width: 240px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

/* Layout Elements */
.toolbar, .panel, .detail-panel, .people-modal-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.toolbar {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 24px;
}

.month-switcher,
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.toolbar-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.month-title {
  min-width: 160px;
  text-align: center;
  font-weight: 800;
  font-size: 22px;
  color: var(--text);
}

/* Calendar */
.calendar-shell {
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  border: none;
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.weekday-row span {
  text-align: center;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 12px 0;
}

.mobile-weekday {
  display: none;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  min-height: 520px;
}

.day-cell {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  min-height: 130px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.day-cell:not(.empty):hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #CBD5E1;
}

.day-cell.empty {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.day-number {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.holiday-tag {
  color: #D97706;
  font-size: 12px;
  font-weight: 600;
  background: #FEF3C7;
  padding: 2px 8px;
  border-radius: 999px;
}

.holiday-tag:empty {
  display: none;
}

/* Duty items */
.duty {
  --duty-accent: #16A34A;
  --duty-bg: #DCFCE7;
  --duty-hover: #BBF7D0;
  --duty-person: #14532D;
  --duty-group: #15803D;
  display: block;
  width: 100%;
  margin: 4px 0;
  padding: 8px 10px;
  border: none;
  border-left: 3px solid var(--duty-accent);
  border-radius: 6px;
  background: var(--duty-bg);
  text-align: left;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  min-height: auto;
}

.duty:hover {
  transform: translateX(2px) translateY(-1px);
  background: var(--duty-hover);
  box-shadow: var(--shadow-sm);
}

.duty strong.duty-person {
  font-size: 14px;
  font-weight: 600;
  color: var(--duty-person);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.duty-phone {
  font-weight: 500;
}

.duty span.duty-group {
  font-size: 11px;
  color: var(--duty-group);
  margin-top: 2px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 上德：绿色 */
.duty[data-group="上德"] {
  --duty-accent: #16A34A;
  --duty-bg: #DCFCE7;
  --duty-hover: #BBF7D0;
  --duty-person: #14532D;
  --duty-group: #15803D;
}

/* 总部：蓝色 */
.duty[data-group="总部"] {
  --duty-accent: #2563EB;
  --duty-bg: #DBEAFE;
  --duty-hover: #BFDBFE;
  --duty-person: #1E3A8A;
  --duty-group: #1D4ED8;
}

/* 众创园：橙色 */
.duty[data-group="众创园"] {
  --duty-accent: #EA580C;
  --duty-bg: #FFEDD5;
  --duty-hover: #FED7AA;
  --duty-person: #7C2D12;
  --duty-group: #C2410C;
}

.duty.draft {
  outline: 1px dashed #F59E0B;
  outline-offset: -1px;
}

.duty.swapped {
  box-shadow: inset 0 0 0 1px #60A5FA;
}


/* Panels & Forms */
.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 32px;
}

.panel {
  padding: 20px 24px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  text-align: left;
}

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

th {
  background: #F8FAFC;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #F8FAFC;
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; backdrop-filter: blur(0); }
  to { opacity: 1; backdrop-filter: blur(6px); }
}

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

.detail-panel, .people-modal-panel {
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 28px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: none;
  animation: slide-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.people-modal-panel {
  width: min(1080px, 100%);
}

.detail-grid, .holiday-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 16px;
  align-items: end;
  margin-top: 16px;
}

.people-add-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 160px auto;
  gap: 12px;
  align-items: end;
  padding-bottom: 24px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.admin-action-panel {
  margin-top: 24px;
}

.holiday-admin-section {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.holiday-admin-section:first-of-type {
  padding-top: 0;
  margin-top: 0;
  border-top: none;
}

.holiday-admin-section h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.holiday-admin-section p {
  margin: 0;
}

label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

/* Toasts */
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2000;
  max-width: min(420px, calc(100vw - 48px));
  border-radius: var(--radius-sm);
  background: #0F172A;
  color: #FFFFFF;
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  font-weight: 500;
  font-size: 14px;
  animation: slide-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slide-left {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Action Chooser */
.action-chooser-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 32px 28px 24px;
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  animation: chooser-pop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chooser-pop {
  from { transform: scale(0.92); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.action-chooser-header {
  text-align: center;
  margin-bottom: 28px;
}

.action-chooser-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  display: block;
}

.action-chooser-sub {
  font-size: 14px;
  color: var(--muted);
}

.action-chooser-btns {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.action-btn-call {
  background: linear-gradient(135deg, var(--green-from) 0%, var(--green-to) 100%);
  color: #ffffff;
}

.action-btn-swap {
  background: linear-gradient(135deg, var(--brand-from) 0%, var(--brand-to) 100%);
  color: #ffffff;
}

.action-btn-label {
  font-size: 16px;
  font-weight: 700;
  flex: 1;
  text-align: left;
}

.action-btn-meta {
  font-size: 13px;
  opacity: 0.9;
  font-weight: 500;
}

.action-chooser-close {
  width: 100%;
  background: #F1F5F9;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  box-shadow: none;
}
.action-chooser-close:hover {
  background: #E2E8F0;
  color: var(--text);
  box-shadow: none;
  transform: none;
}

/* Footer */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px max(24px, calc((100vw - 1280px) / 2 + 24px));
  margin-top: 48px;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
  background: transparent;
}

.footer-admin-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 16px;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.6);
}
.footer-admin-link:hover {
  color: var(--brand-from);
  border-color: var(--brand-from);
  background: #EEF2FF;
  box-shadow: 0 2px 8px rgba(79,70,229,0.1);
}

.footer-note {
  font-size: 13px;
  color: var(--muted);
}

/* Admin Login Overrides */
.login-backdrop {
  position: fixed;
  inset: 0;
  background: var(--bg);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(79, 70, 229, 0.08), transparent 25vw),
    radial-gradient(circle at 85% 30%, rgba(124, 58, 237, 0.08), transparent 25vw);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.login-backdrop[hidden] { display: none; }

.login-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 48px 40px 40px;
  width: min(420px, calc(100vw - 32px));
  border: 1px solid rgba(255,255,255,0.8);
}
.login-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
}
.login-card .login-sub {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 32px;
}
.login-card label {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}
.login-card input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 15px;
}
.login-card .btn-login {
  width: 100%;
  min-height: 48px;
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 12px;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}
.login-card .btn-login:hover { 
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
  filter: brightness(1.1);
}
.login-error {
  color: var(--red);
  font-size: 13px;
  text-align: center;
  margin-top: 12px;
  min-height: 20px;
  font-weight: 500;
}

/* Admin Header Overrides */
.admin-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px max(24px, calc((100vw - 1280px) / 2 + 24px));
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #ffffff;
}
.admin-header-left h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
}
.admin-header-left p {
  margin: 4px 0 0;
  color: #94A3B8;
  font-size: 13px;
}
.admin-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-identity {
  font-size: 13px;
  color: #CBD5E1;
  font-weight: 500;
}
.btn-logout {
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: #E2E8F0;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  min-height: 34px;
  box-shadow: none;
}
.btn-logout:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
}
.btn-back-home {
  border: 1px solid rgba(255,255,255,0.2);
  background: transparent;
  color: #93C5FD;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  transition: all 0.2s;
}
.btn-back-home:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.3);
}
.admin-content {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 24px;
}

@media (max-width: 860px) {
  body {
    background-image: none;
  }

  main, .admin-content { padding: 10px; }

  .app-header, .admin-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
  }

  .app-header h1, .admin-header-left h1 {
    font-size: 20px;
  }

  .status-note {
    display: none;
  }

  .app-header p {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
  }

  .connection-status, .admin-header-right {
    justify-items: start;
    justify-content: flex-start;
  }

  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
    margin-bottom: 12px;
    border-radius: var(--radius-md);
  }

  .month-switcher {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 58px;
    gap: 6px;
    align-items: center;
  }

  .toolbar-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .month-title {
    min-width: 0;
    font-size: 19px;
    line-height: 1;
  }

  .toolbar button {
    width: 100%;
    min-height: 36px;
    margin-left: 0 !important;
    padding: 5px 8px;
    font-size: 12px;
    box-shadow: none;
  }

  .toolbar-actions button {
    border-radius: 9px;
  }

  .weekday-row {
    display: grid;
    width: 1120px;
    min-width: 1120px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
  }

  .weekday-row span {
    padding: 10px 0;
    border-radius: 7px;
    box-shadow: none;
    font-size: 13px;
    line-height: 1;
    letter-spacing: 0;
  }

  .calendar-shell {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 10px;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .calendar-grid {
    width: 1120px;
    min-width: 1120px;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    min-height: 0;
  }

  .day-cell {
    min-height: 150px;
    padding: 8px;
    border-radius: 8px;
    box-shadow: none;
    overflow: hidden;
  }

  .day-cell.empty {
    display: flex;
    background: rgba(255, 255, 255, 0.45);
    border-color: rgba(226, 232, 240, 0.6);
  }

  .day-cell:not(.empty):hover,
  .duty:hover {
    transform: none;
  }

  .day-head {
    align-items: flex-start;
    min-height: 18px;
    margin-bottom: 7px;
  }

  .day-number {
    font-size: 15px;
    line-height: 1;
  }

  .holiday-tag {
    max-width: 72px;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 10px;
    line-height: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .duty {
    margin: 4px 0 0;
    min-height: 42px;
    padding: 6px 8px;
    border-left-width: 3px;
    border-radius: 6px;
    box-shadow: none;
    line-height: 1.25;
  }

  .duty strong.duty-person {
    font-size: 13px;
    line-height: 1.25;
  }

  .duty span.duty-group {
    margin-top: 2px;
    font-size: 10px;
    line-height: 1.2;
  }

  .duty-phone,
  .mobile-weekday {
    display: none !important;
  }
  
  .people-add-form {
    grid-template-columns: 1fr;
  }

  .holiday-admin-section {
    gap: 10px;
    padding-top: 14px;
    margin-top: 14px;
  }

  .detail-grid, .holiday-form {
    grid-template-columns: 1fr !important;
  }

  .detail-grid label { width: 100%; margin-bottom: 4px; }

  .content-grid {
    gap: 14px;
    margin-top: 18px;
  }

  .content-grid > .panel {
    min-width: 0;
  }

  .panel {
    padding: 14px;
    border-radius: var(--radius-md);
  }

  .section-title {
    margin-bottom: 12px;
  }

  .section-title h2 {
    font-size: 16px;
  }
  
  .content-grid .table-wrap {
    max-width: 100%;
    overflow: hidden;
    border: none;
    border-radius: 0;
    margin: 0;
  }

  .content-grid table {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .content-grid thead {
    display: none;
  }

  .content-grid tbody {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding: 2px 2px 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .content-grid tr {
    display: block;
    flex: 0 0 auto;
    width: fit-content;
    min-width: 0;
    max-width: calc(100vw - 64px);
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    scroll-snap-align: start;
  }

  .content-grid tr:hover td {
    background: transparent;
  }

  .content-grid tr.empty-state {
    flex-basis: 100%;
    width: 100%;
    box-shadow: none;
  }

  .content-grid td {
    display: grid;
    grid-template-columns: max-content max-content;
    gap: 8px;
    align-items: center;
    width: fit-content;
    max-width: calc(100vw - 86px);
    padding: 4px 0;
    border-bottom: none;
    font-size: 12px;
    white-space: normal;
    word-break: break-word;
  }

  .content-grid td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
  }

  .content-grid td[colspan] {
    display: block;
    padding: 14px;
    color: var(--muted);
    text-align: center;
  }

  .content-grid td[colspan]::before {
    content: none;
  }

  .content-grid .actions button {
    width: 100%;
    min-height: 32px;
    padding: 5px 10px;
    font-size: 12px;
    box-shadow: none;
  }

  .detail-panel, .people-modal-panel, .action-chooser-card {
    border-radius: var(--radius-lg);
  }

  .detail-panel, .people-modal-panel {
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .app-footer {
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
    padding: 18px 12px;
  }
}
