/* ==========================================================================
   Minimalist & Simple Design System for Content Team Portal
   ========================================================================== */

:root {
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --bg-page: #ffffff;
  --bg-subtle: #f9fafb;
  --border-color: #e5e7eb;
  --text-color: #111827;
  --text-muted: #6b7280;
  --blue-primary: #1d4ed8;
  --blue-light: #eff6ff;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-color);
  line-height: 1.5;
  padding-bottom: 2rem;
}

/* Passcode Modal (7730) */
#lockScreen {
  position: fixed;
  inset: 0;
  background: #f3f4f6;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#lockScreen.hidden {
  display: none;
}

.lock-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 100%;
  max-width: 320px;
  padding: 1.75rem 1.25rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.lock-box h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.lock-box p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

.pin-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #9ca3af;
  background: #fff;
}

.pin-dot.filled {
  background: var(--blue-primary);
  border-color: var(--blue-primary);
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.key-btn {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.65rem 0;
  cursor: pointer;
}

.key-btn:hover {
  background: #f3f4f6;
}

.key-btn.action-btn {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.lock-feedback {
  font-size: 0.8rem;
  color: #dc2626;
  font-weight: 600;
  min-height: 1.2rem;
}

/* Header */
.top-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 1rem;
}

.top-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.main-tab-btns {
  display: flex;
  gap: 0.35rem;
}

.tab-btn {
  background: transparent;
  border: 1px solid transparent;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;
  border-radius: 6px;
  cursor: pointer;
}

.tab-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

.tab-btn.active {
  background: var(--blue-light);
  color: var(--blue-primary);
  border-color: #bfdbfe;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.btn-action {
  background: #ffffff;
  border: 1px solid #d1d5db;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
}

.btn-action:hover {
  background: #f3f4f6;
}

/* Layout Container */
.page-container {
  max-width: 1400px;
  margin: 1rem auto;
  padding: 0 1rem;
}

/* Simple Banner */
.simple-banner {
  background: #f9fafb;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.banner-left h3 {
  font-size: 0.95rem;
  font-weight: 700;
}

.banner-left p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.banner-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.simple-tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.tag-news { background: #ede9fe; color: #6d28d9; }
.tag-content { background: #dcfce7; color: #15803d; }
.tag-night { background: #fef3c7; color: #92400e; }

/* Night Schedule Card (Monday - Saturday | Sunday Deleted) */
.night-schedule-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.night-schedule-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.night-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.night-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

.sunday-off-badge {
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
  border: 1px solid #fecaca;
}

.night-days-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.55rem;
}

.night-day-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem 0.6rem;
  text-align: center;
  transition: all 0.15s ease;
}

.night-day-box:hover {
  border-color: #cbd5e1;
  background: #ffffff;
}

.night-day-box.is-lead {
  border-color: #f59e0b;
  background: #fffbeb;
}

.night-day-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.night-member-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-top: 0.25rem;
}

/* Team Matrix Layout */
.team-roster-section {
  margin-bottom: 2rem;
}

.team-roster-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.team-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.roster-table-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.roster-table-card::-webkit-scrollbar {
  height: 9px;
}

.roster-table-card::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 0 0 12px 12px;
}

.roster-table-card::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 6px;
}

.roster-table-card::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

.roster-matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1280px;
}

.roster-matrix-table th.col-writer {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 5;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  font-weight: 700;
  color: #374151;
  min-width: 135px;
  text-align: left;
  border-top-left-radius: 11px;
}

.roster-matrix-table th.col-week {
  text-align: center;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  border-right: 1px solid #f1f5f9;
  min-width: 105px;
}

.roster-matrix-table th.col-week .wk-name {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.82rem;
}

.roster-matrix-table th.col-week .wk-sub {
  font-size: 0.68rem;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, monospace;
  margin-top: 0.15rem;
  white-space: nowrap;
}

.roster-matrix-table td.cell-writer {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 4;
  padding: 0.8rem 1.15rem;
  font-weight: 700;
  color: #0f172a;
  font-size: 0.88rem;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #e5e7eb;
  white-space: nowrap;
}

.roster-matrix-table tr:last-child td.cell-writer {
  border-bottom-left-radius: 11px;
  border-bottom: none;
}

.roster-matrix-table td.cell-task {
  padding: 0.45rem 0.35rem;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f8fafc;
  vertical-align: middle;
}

/* Cell task badges */
.grid-badge {
  border-radius: 6px;
  padding: 0.45rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  white-space: normal;
  transition: all 0.1s ease;
}

.grid-badge.badge-child {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.grid-badge.badge-intent {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.grid-badge.badge-seo {
  background: #fdf2f8;
  color: #be185d;
  border: 1px solid #fbcfe8;
}

.grid-badge.badge-event {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.grid-badge.badge-new-content {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Clean Tables */
.table-wrap {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.82rem;
  white-space: nowrap;
}

.data-table th, .data-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #f3f4f6;
  border-right: 1px solid #f3f4f6;
}

.data-table th {
  background: #f9fafb;
  color: #374151;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 2;
}

.data-table tr:hover td {
  background: #f8fafc;
}

.data-table td.col-sticky {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 1;
  font-weight: 600;
}

/* Simple Task Badges */
.task-pill {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.task-news { background: #ede9fe; color: #6d28d9; }
.task-seo { background: #e0f2fe; color: #0369a1; }
.task-intent { background: #ffedd5; color: #c2410c; }
.task-child { background: #dcfce7; color: #15803d; }
.task-upcoming { background: #fae8ff; color: #86198f; }

/* Subnav Controls */
.sub-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.sub-btns {
  display: flex;
  gap: 0.35rem;
}

.sub-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 4px;
  cursor: pointer;
}

.sub-btn.active {
  background: #111827;
  color: #ffffff;
  border-color: #111827;
}

.input-simple {
  border: 1px solid #d1d5db;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 4px;
  outline: none;
}

.select-simple {
  border: 1px solid #d1d5db;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
}

/* Numeric alignment & sticky column */
.data-table th.col-sticky,
.data-table td.col-sticky {
  position: sticky;
  left: 0;
  background: #ffffff;
  z-index: 3;
  font-weight: 600;
  box-shadow: 2px 0 3px rgba(0,0,0,0.03);
}

.data-table th.col-sticky {
  background: #f9fafb;
  z-index: 4;
}

.data-table .num-cell,
.data-table .col-center,
.data-table th.num-cell,
.data-table th.col-center {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.data-table .zero-val {
  color: #94a3b8;
  font-size: 0.8rem;
}

.data-table .pos-val {
  font-weight: 700;
  color: #0f172a;
}

.data-table tr.total-row td {
  background: #f1f5f9;
  font-weight: 700;
  color: #0f172a;
  border-top: 2px solid #cbd5e1;
  border-bottom: 2px solid #cbd5e1;
}

.data-table tr.subtotal-row td {
  background: #f8fafc;
  font-weight: 600;
  border-bottom: 1px solid #e2e8f0;
}

/* KPI Summary Cards */
.kpi-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.65rem 0.85rem;
  position: relative;
  overflow: hidden;
}

.kpi-card.kpi-planned { border-left: 4px solid #2563eb; }
.kpi-card.kpi-done { border-left: 4px solid #16a34a; }
.kpi-card.kpi-pending { border-left: 4px solid #ea580c; }
.kpi-card.kpi-rate { border-left: 4px solid #7c3aed; }

.kpi-card .kpi-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.kpi-card .kpi-val {
  font-size: 1.35rem;
  font-weight: 700;
  color: #111827;
  margin: 0.15rem 0;
}

.kpi-card .kpi-sub {
  font-size: 0.72rem;
  color: #6b7280;
}

/* Status Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-status.status-done {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-status.status-pending {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.badge-status.status-draft {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* Category Badge */
.badge-cat {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

/* Priority Badges */
.badge-p0 {
  display: inline-block;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fee2e2;
  color: #dc2626;
}

.badge-p1 {
  display: inline-block;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fef3c7;
  color: #d97706;
}

.btn-link-action {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  text-decoration: none;
}

.btn-link-action:hover {
  background: #dbeafe;
}

/* Workflow Table Enhancements */
.btn-doc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #1e40af;
  background: #dbeafe;
  border: 1px solid #93c5fd;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-doc-link:hover {
  background: #bfdbfe;
  color: #1e3a8a;
}

.btn-url-link {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #047857;
  background: #d1fae5;
  border: 1px solid #a7f3d0;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-url-link:hover {
  background: #a7f3d0;
  color: #065f46;
}

.badge-task-type {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #f3e8ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.badge-sub-type {
  display: inline-block;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.badge-page-type {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.writer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  font-size: 0.78rem;
  color: #1e293b;
}

.fk-text {
  font-size: 0.75rem;
  color: #475569;
  max-width: 220px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   Event Calendar Styles & Category Badges
   ========================================================================== */
.calendar-banner {
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.calendar-category-pills {
  background: #f8fafc;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.cat-pill-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.cat-pill-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.cat-pill-btn.active {
  background: #1e40af;
  border-color: #1e40af;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(30, 64, 175, 0.2);
}

.cat-pill-btn.active span {
  color: #bfdbfe;
}

/* Category Badges */
.badge-cal-category {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-cal-railway {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-cal-ssc {
  background: #faf5ff;
  color: #7e22ce;
  border: 1px solid #e9d5ff;
}

.badge-cal-engineering {
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}

.badge-cal-teaching {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-cal-state {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-cal-police {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.badge-cal-default {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* Event & Exam Typography */
.cal-exam-title {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.85rem;
  line-height: 1.3;
}

.cal-event-title {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.82rem;
  line-height: 1.35;
}

.badge-cal-date {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  background: #f8fafc;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
}

.badge-cal-date.highlight-soon {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.badge-cal-tam {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 700;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.badge-cal-metric {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
}

/* ==========================================================================
   News (N & U Daily) & Auto-Assignment Engine Styles
   ========================================================================== */
.writer-presence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.writer-presence-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: all 0.2s ease;
  position: relative;
}

.writer-presence-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.writer-presence-card.status-active {
  border-left: 4px solid #10b981;
}

.writer-presence-card.status-break {
  border-left: 4px solid #f59e0b;
  background: #fffdfa;
}

.writer-presence-card.status-leave {
  border-left: 4px solid #ef4444;
  background: #fafafa;
  opacity: 0.75;
}

.writer-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.writer-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.status-pill-group {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.status-pill-btn {
  border: none;
  background: transparent;
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  color: #64748b;
  transition: all 0.15s ease;
}

.status-pill-btn:hover {
  color: #0f172a;
  background: rgba(255,255,255,0.7);
}

.status-pill-btn.active.btn-active {
  background: #10b981;
  color: #ffffff;
}

.status-pill-btn.active.btn-break {
  background: #f59e0b;
  color: #ffffff;
}

.status-pill-btn.active.btn-leave {
  background: #ef4444;
  color: #ffffff;
}

.writer-current-task {
  font-size: 0.8rem;
  color: #334155;
  margin-bottom: 0.45rem;
  line-height: 1.3;
  min-height: 2.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.writer-bandwidth-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.35rem;
}

.writer-bandwidth-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.fill-light { background: #10b981; }
.fill-medium { background: #f59e0b; }
.fill-heavy { background: #ef4444; }

.writer-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: #64748b;
}

/* Task Type Badges */
.badge-task-20m {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-task-60m {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #fefce8;
  color: #a16207;
  border: 1px solid #fef08a;
}

.badge-task-90m {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  background: #fdf2f8;
  color: #be185d;
  border: 1px solid #fbcfe8;
}

.badge-status-done {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 600;
  background: #dcfce7;
  color: #15803d;
}

.badge-status-progress {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 600;
  background: #fef3c7;
  color: #b45309;
}

.badge-status-pending {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 600;
  background: #fee2e2;
  color: #b91c1c;
}

/* Modals & Layer Stacking */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  max-width: 500px;
  width: 100%;
  padding: 1.5rem;
}

#modalWriterKpiDrilldown {
  z-index: 1000;
}

#modalAiAudit {
  z-index: 2000 !important;
}

#modalAiAudit .modal-card {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  border: 1px solid #cbd5e1;
}

/* ==========================================================================
   Comprehensive Mobile & Touch Responsiveness (Zero Logic Change)
   ========================================================================== */

/* Touch optimization & fluid container constraints */
html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

/* Custom horizontal scroll bar helper */
.scrollable-touch-bar {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scrollable-touch-bar::-webkit-scrollbar {
  display: none;
}

/* Tablet & Mobile Breakpoint (<= 768px) */
@media (max-width: 768px) {
  body {
    padding-bottom: 3rem;
  }

  .page-container {
    padding: 0 0.65rem;
    margin: 0.65rem auto;
  }

  /* Header & Navigation */
  .top-nav {
    padding: 0.5rem 0.65rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }

  .top-nav-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .brand-title {
    font-size: 0.95rem;
  }

  .main-tab-btns {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    gap: 0.3rem;
    padding-bottom: 3px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
  }
  .main-tab-btns::-webkit-scrollbar {
    display: none;
  }

  .tab-btn {
    flex-shrink: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  /* Sub Bars & Sub Tabs */
  .sub-bar {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.5rem !important;
  }

  .sub-bar > div {
    width: 100%;
  }

  .sub-btns {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    gap: 0.3rem;
    padding-bottom: 3px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    width: 100%;
  }
  .sub-btns::-webkit-scrollbar {
    display: none;
  }

  .sub-btn {
    flex-shrink: 0;
    padding: 0.38rem 0.65rem;
    font-size: 0.76rem;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
  }

  .sub-bar input.input-simple,
  .sub-bar select.select-simple,
  #teamDashboardSearch,
  #kpiSearch,
  #filterSearch {
    width: 100% !important;
    min-height: 38px;
    font-size: 0.85rem;
    border-radius: 6px;
  }

  .btn-action {
    min-height: 36px;
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* KPI Metric Cards Grid */
  .kpi-cards {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  .kpi-card {
    padding: 0.65rem 0.5rem !important;
  }

  .kpi-card .kpi-num,
  .kpi-card .num {
    font-size: 1.25rem !important;
  }

  .kpi-card .kpi-lbl,
  .kpi-card .lbl {
    font-size: 0.68rem !important;
  }

  /* Tables & Horizontal Scrolling */
  .table-wrap {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: 8px !important;
    margin-bottom: 1rem !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
  }

  .data-table {
    min-width: 620px !important;
    font-size: 0.76rem !important;
  }

  .data-table th, 
  .data-table td {
    padding: 0.45rem 0.4rem !important;
  }

  /* Night Schedule & Presence Grids */
  .night-days-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.4rem !important;
  }

  .writer-presence-grid {
    grid-template-columns: 1fr !important;
    gap: 0.6rem !important;
  }

  .writer-presence-card {
    padding: 0.65rem !important;
  }

  .writer-presence-card .status-pill-group {
    scale: 0.95;
  }

  /* Modals on Mobile */
  .modal-overlay {
    padding: 0.5rem !important;
    align-items: flex-end !important;
  }

  .modal-card,
  #modalWriterDrilldown .modal-card,
  #modalBulkStatus .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    border-radius: 14px 14px 0 0 !important;
    padding: 1rem !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
  }

  #drilldownContentBody {
    overflow-y: auto !important;
    flex: 1 !important;
    max-height: 65vh !important;
  }

  /* Simple Banner */
  .simple-banner {
    padding: 0.65rem 0.75rem !important;
    gap: 0.5rem !important;
  }

  .banner-tags {
    gap: 0.35rem !important;
  }

  .simple-tag {
    font-size: 0.7rem !important;
    padding: 0.2rem 0.4rem !important;
  }
}

/* Small Smartphone Screen Breakpoint (<= 480px) */
@media (max-width: 480px) {
  .brand-title {
    font-size: 0.88rem;
  }

  .tab-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.76rem;
    min-height: 34px;
  }

  .sub-btn {
    padding: 0.3rem 0.55rem;
    font-size: 0.72rem;
  }

  .kpi-cards {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.4rem !important;
  }

  .kpi-card .kpi-num,
  .kpi-card .num {
    font-size: 1.15rem !important;
  }

  .night-days-grid {
    grid-template-columns: 1fr !important;
  }

  .lock-box {
    padding: 1.25rem 1rem;
  }

  .key-btn {
    padding: 0.55rem 0;
    font-size: 1.05rem;
  }
}





