:root {
    --color-background: #f3f4f6;
    --color-surface: #ffffff;
    --color-surface-alt: #f9fafb;
    --color-border: #e5e7eb;
    --color-text: #1f2937;
    --color-text-muted: #6b7280;
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-danger: #dc2626;
    --color-danger-dark: #b91c1c;
    --color-sidebar: #0f172a;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.12);
    --radius-md: 12px;
    --radius-lg: 18px;
}

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

body {
    font-family: "Sarabun", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(180deg, #e0e7ff 0%, var(--color-background) 18%);
    color: var(--color-text);
    margin: 0;
    min-height: 100vh;
}

body.app-body {
    background: var(--color-background);
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-primary-dark);
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--color-primary);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.button:hover,
button:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
}

.button.outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    box-shadow: none;
}

.button.outline:hover {
    background-color: rgba(37, 99, 235, 0.08);
}

.button.danger,
button.danger {
    background-color: var(--color-danger);
}

.button.danger:hover,
button.danger:hover {
    background-color: var(--color-danger-dark);
}

.app-shell {
    min-height: 100vh;
    display: flex;
    background-color: var(--color-background);
}

.app-sidebar {
    width: 260px;
    background: radial-gradient(circle at top, #1e293b 0%, var(--color-sidebar) 65%);
    color: #e2e8f0;
    padding: 2.5rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.brand-accent {
    color: #60a5fa;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(148, 163, 184, 0.08);
    border-radius: var(--radius-md);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.15);
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 1.1rem;
}

.user-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.user-name {
    font-weight: 600;
    color: #fff;
}

.user-role {
    font-size: 0.85rem;
    color: rgba(226, 232, 240, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex: 1;
    overflow-y: auto;
}

.nav-section {
    background: rgba(15, 23, 42, 0.35);
    border-radius: 12px;
    padding: 0.35rem;
}
.nav-section__toggle {
    width: 100%;
    border: none;
    background: transparent;
    color: rgba(226, 232, 240, 0.95);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.6rem;
    cursor: pointer;
}
.nav-section__items {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.3rem;
}
.nav-section.collapsed .nav-section__items {
    display: none;
}
.nav-link {
    padding: 0.7rem 1rem;
    border-radius: 10px;
    color: rgba(226, 232, 240, 0.9);
    font-weight: 500;
    transition: background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
    background: rgba(59, 130, 246, 0.18);
    transform: translateX(4px);
}

.nav-link.is-active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.35), rgba(59, 130, 246, 0.55));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.35);
}

.sidebar-footer {
    margin-top: auto;
}

.sidebar-footer .logout {
    background: rgba(148, 163, 184, 0.12);
    display: inline-flex;
}

.app-main {
    flex: 1;
    padding: 3rem;
    max-width: calc(100% - 260px);
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.page-subtitle {
    margin: 0.4rem 0 0;
    color: var(--color-text-muted);
}

.page-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.page-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.card h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.data-table thead {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.05));
}

.data-table th,
.data-table td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    text-align: left;
    font-size: 0.95rem;
}

.data-table th {
    font-weight: 600;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
}

.data-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    background: rgba(37, 99, 235, 0.12);
    color: var(--color-primary);
    font-weight: 600;
    margin-right: 0.4rem;
    margin-bottom: 0.4rem;
}

.tag.neutral {
    background: rgba(107, 114, 128, 0.15);
    color: var(--color-text-muted);
}

.tag.status-planned {
    background-color: #e0e7ff;
    color: #1d4ed8;
    border: 1px solid #c7d2fe;
}

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

.tag.status-completed {
    background-color: #e5e7eb;
    color: #111827;
    border: 1px solid #cbd5f5;
}

.tag.status-cancelled {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.tag.danger {
    background: rgba(220, 38, 38, 0.15);
    color: #b91c1c;
}

.tag.team-central {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

.tag.team-onsite {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

.tag.location-assigned {
    background-color: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.tag.location-unassigned {
    background-color: #f3f4f6;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}

.tag.group-primary {
    background-color: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.tag.group-secondary {
    background-color: #fdf2f8;
    color: #9d174d;
    border: 1px solid #fbcfe8;
}

.tag.group-tertiary {
    background-color: #ecfccb;
    color: #3f6212;
    border: 1px solid #bef264;
}

.tag.group-quaternary {
    background-color: #ede9fe;
    color: #5b21b6;
    border: 1px solid #ddd6fe;
}

.tag.group-quinary {
    background-color: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.current-summary {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
}
.current-summary strong {
    margin-right: 0.4rem;
    color: var(--color-text-muted);
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem 1.5rem;
}

label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
}

input[type="text"],
input[type="password"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--color-surface-alt);
    color: var(--color-text);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.6);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.checkbox-group {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: var(--color-surface-alt);
    transition: border-color 0.2s ease, background 0.2s ease;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--color-primary);
}

.checkbox-item:hover {
    border-color: rgba(37, 99, 235, 0.5);
    background: rgba(37, 99, 235, 0.08);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.calendar-column {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface-alt);
    display: flex;
    flex-direction: column;
    min-height: 260px;
}

.calendar-column__header {
    padding: 0.85rem;
    font-weight: 600;
    border-bottom: 1px solid var(--color-border);
    background: rgba(37, 99, 235, 0.07);
}

.calendar-column__body {
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 360px;
    overflow-y: auto;
}

.calendar-pill {
    border-radius: var(--radius-md);
    padding: 0.75rem;
    background: #fff;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.calendar-pill--empty {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    background: var(--color-surface);
    border: 1px dashed var(--color-border);
    color: var(--color-text-muted);
    text-align: center;
}

.pill-title {
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pill-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    display: flex;
    justify-content: space-between;
}

.pill-tag {
    margin-top: 0.35rem;
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--color-primary);
    font-size: 0.75rem;
}

.pill-status {
    margin-top: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: right;
}

.pill-status-planned {
    color: #0284c7;
}

.pill-status-confirmed {
    color: #16a34a;
}

.pill-status-completed {
    color: #0f172a;
}

.pill-status-cancelled {
    color: #dc2626;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.alert {
    padding: 0.9rem 1.2rem;
    border-radius: 10px;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.alert.success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.24);
    color: #166534;
}

.alert.error {
    background: rgba(248, 113, 113, 0.12);
    border-color: rgba(248, 113, 113, 0.24);
    color: #b91c1c;
}

.alert.warning {
    background: rgba(251, 191, 36, 0.18);
    border-color: rgba(251, 191, 36, 0.35);
    color: #92400e;
}

.alert.danger {
    background: rgba(248, 113, 113, 0.18);
    border-color: rgba(239, 68, 68, 0.35);
    color: #991b1b;
    font-weight: 600;
}

.muted-link {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.muted-link:hover {
    color: var(--color-primary);
}

.actions-inline {
    display: inline-flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.section-heading {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.assignment-form .form-section {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.3rem;
    margin-bottom: 1.2rem;
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
}

.section-title span {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--color-primary);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.form-grid.two-column {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.plan-tip {
    background: rgba(14, 165, 233, 0.12);
    border: 1px dashed rgba(14, 165, 233, 0.45);
    padding: 0.85rem 1rem;
    border-radius: 10px;
    color: #0f172a;
    margin-bottom: 1.4rem;
    font-size: 0.92rem;
}

.divider {
    height: 1px;
    width: 100%;
    background: var(--color-border);
}

.container {
    max-width: 960px;
    margin: 4rem auto;
    background: var(--color-surface);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.container h1 {
    margin-top: 0;
}

.link-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem 1.5rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(37, 99, 235, 0.06));
}

.auth-card {
    width: min(420px, 100%);
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.auth-card h1 {
    margin: 0 0 0.75rem;
    text-align: center;
    font-size: 1.9rem;
}

.auth-intro {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.auth-card form {
    margin-top: 1.5rem;
}

.auth-card .form-grid {
    grid-template-columns: 1fr;
}

.auth-card .form-actions {
    justify-content: center;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
}

.link-tile {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.4rem;
    border-radius: var(--radius-md);
    background: var(--color-surface-alt);
    border: 1px solid rgba(148, 163, 184, 0.26);
    transition: border 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.link-tile strong {
    font-size: 1rem;
    color: var(--color-text);
}

.link-tile span {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.link-tile:hover,
.link-tile.is-active {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: var(--shadow-sm);
    background: #fff;
}

.form-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.form-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-column .form-section {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    flex: 1; /* Make sections in a column equal height */
}

.form-column .section-title {
    font-size: 1rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 0.5rem;
}

.dashboard-filter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    align-items: flex-end;
}

.dashboard-filter-panel {
    margin-bottom: 0;
}

.filter-field label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.2rem;
    display: block;
}

.filter-actions {
    justify-content: flex-end;
}

.form-control {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    background: var(--color-surface-alt);
    color: var(--color-text);
    transition: border 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.hero-panel {
    padding-bottom: 1.5rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.hero-card {
    background: var(--color-surface-alt);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.2rem 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.hero-card__meta span {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.hero-card__value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-text);
}

.hero-card__trend-value {
    font-size: 0.85rem;
    font-weight: 600;
}

.hero-card__trend-value.positive {
    color: #16a34a;
}

.hero-card__trend-value.negative {
    color: var(--color-danger);
}

.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.panel__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.panel__header h2 {
    margin: 0;
    font-size: 1.3rem;
}

.panel__body {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.workforce-chart {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.workforce-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr auto;
    align-items: center;
    gap: 0.75rem;
}

.workforce-row__label {
    font-size: 0.9rem;
}

.workforce-row__bar {
    height: 10px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    overflow: hidden;
}

.workforce-row__bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #a855f7);
}

.workforce-row__value {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.workforce-gaps {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.gap-chip {
    padding: 0.65rem 0.85rem;
    background: rgba(249, 250, 251, 0.7);
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    font-size: 0.9rem;
}

.ot-summary__meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.9rem;
}

.ot-thermometer {
    height: 8px;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    overflow: hidden;
    margin: 0.35rem 0 0.6rem;
}

.ot-thermometer span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #fb923c, #f97316);
}

.ot-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.ot-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.3);
}

.ot-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ot-list__time {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.ot-list__meta strong {
    font-size: 0.95rem;
}

.ot-list__meta span {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.readiness-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.readiness-card {
    border: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.readiness-card header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.readiness-card__body {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.readiness-card.is-alert {
    border-color: var(--color-danger);
    background: rgba(255, 244, 244, 0.7);
}

.insights-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: #f8fafc;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.insight-item {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.insight-item.success {
    background: rgba(16, 185, 129, 0.08);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

.insight-item.warning {
    background: rgba(251, 191, 36, 0.1);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

.insight-item.danger {
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

.insight-item.info {
    background: rgba(37, 99, 235, 0.08);
    border-radius: var(--radius-md);
    padding: 0.75rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-grid-modern .form-actions {
    margin-top: auto; /* Pushes button to the bottom */
    padding-top: 1rem;
}

.assignments-table .employee-cell,
.assignments-table .location-cell,
.assignments-table .details-cell,
.assignments-table .date-range {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    line-height: 1.3;
}
.assignments-table .employee-code {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--color-text);
}
.assignments-table .employee-name {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}
.assignments-table .location-name {
    font-weight: 600;
    font-size: 0.85rem;
}
.assignments-table .group-name {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}
.assignments-table .details-cell {
    gap: 0.35rem;
    align-items: flex-start;
}
.tag-mini {
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
}
.tag-assignment-type {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
}
.assignments-table .date-range {
    font-size: 0.85rem;
    flex-direction: row;
    align-items: center;
    gap: 0.3rem;
    color: var(--color-text-muted);
}
.assignments-table .date-range .date-start,
.assignments-table .date-range .date-end {
    font-weight: 600;
    color: var(--color-text);
}
.assignments-table .icon-arrow-right {
    font-size: 0.7rem;
}
.checkbox-label-inline {
    font-weight: normal;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
}

.assignments-layout {
    display: grid;
    grid-template-columns: 4fr 7fr;
    gap: 2rem;
    align-items: start;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.filter-bar > div {
    flex: 1 1 160px;
}
.filter-bar .form-actions {
    flex-basis: auto;
    align-self: flex-end;
    padding-bottom: 0.1rem;
}

@media (max-width: 1200px) {
    .assignments-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .app-shell {
        flex-direction: column;
    }

    .app-sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

    .app-main {
        max-width: 100%;
        padding: 2.5rem 1.5rem 3rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .card {
        padding: 1.5rem;
    }

    .page-header h1 {
        font-size: 1.6rem;
    }

.checkbox-group {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
}

.impersonation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-left: 4px solid var(--color-primary);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.impersonation-banner__user {
    color: var(--color-primary);
    font-weight: 600;
}

/* Modal styles */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    max-width: 600px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

#modalBody ul {
    list-style-type: none;
    padding: 0;
}

#modalBody li {
    background-color: #f9f9f9;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 5px;
}

/* --- Gemini Redesign Additions --- */

/* Use Bootstrap's container-fluid but remove its padding, as app-main handles it */
.app-main .container-fluid {
    padding-left: 0;
    padding-right: 0;
}

/* Override Bootstrap's default card to use the theme's style */
/* The existing .card style is good, but we need to ensure it has priority */
.card {
    background: var(--color-surface) !important;
    border-radius: var(--radius-lg) !important; /* Use important to override BS */
    padding: 2rem;
    box-shadow: var(--shadow-md) !important;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    margin-bottom: 1.5rem; /* Add default margin for spacing */
}

/* Bootstrap card-header styling */
.card-header {
    background-color: var(--color-surface-alt) !important;
    border-bottom: 1px solid var(--color-border) !important;
    font-weight: 600;
    padding: 1rem 2rem;
}

/* Bootstrap card-body styling */
.card-body {
    padding: 1.5rem 2rem;
}

/* Adjust button styles to better match the theme */
.btn-primary {
    background-color: var(--color-primary) !important;
    border-color: var(--color-primary) !important;
    border-radius: 999px !important;
    padding: 0.6rem 1.2rem;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--color-primary-dark) !important;
    border-color: var(--color-primary-dark) !important;
}

/* Make alerts use theme colors */
.alert-warning {
    background-color: rgba(251, 191, 36, 0.1) !important;
    border-color: rgba(251, 191, 36, 0.2) !important;
    color: #92400e !important;
}
.alert-danger {
    background-color: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
    color: #991b1b !important;
}
.alert-info {
    background-color: rgba(59, 130, 246, 0.1) !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
    color: #1d4ed8 !important;
}
.alert-success {
    background-color: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
    color: #065f46 !important;
}

/* Ensure chart canvas is responsive */
#locationReadinessChart, #otUtilizationChart, #workforceChart {
    max-height: 320px;
}

/* Adjust padding on smaller screens */
@media (max-width: 768px) {
    .card {
        padding: 1.5rem !important;
    }
    .card-header, .card-body {
        padding: 1rem 1.5rem;
    }
    .app-main {
        padding: 1.5rem;
    }
}

/* --- Outsourced Staff Dashboard Styles --- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
}

.stat-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

.stat-card p {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-text);
}

.stat-card .icon {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2.5rem;
    color: rgba(148, 163, 184, 0.15);
}

.filter-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.status-tag {
    padding: 5px 10px;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    font-size: 0.9em;
}

.status-active {
    background-color: #5cb85c;
}

.status-expiring-soon {
    background-color: #f0ad4e;
}

.status-expired {
    background-color: #d9534f;
}

/* --- Calendar Specific Styles (Moved from assignment_calendar.php) --- */

.calendar-summary {
    background: var(--color-surface-alt); /* Use existing variable */
    border-radius: var(--radius-md); /* Use existing variable */
    padding: 0.5rem 0.75rem; /* Reduced padding */
    margin-bottom: 0.75rem; /* Reduced margin */
    font-size: 0.8rem; /* Reduced font size */
    box-shadow: var(--shadow-sm); /* Use existing variable */
    border: 1px solid var(--color-border);
}
.calendar-summary__row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 0.2rem; /* Reduced margin */
}
.calendar-summary__row:last-child {
    margin-bottom: 0;
}
.calendar-summary__tag {
    margin-left: 0.4rem; /* Reduced margin */
}

.calendar-pill--absent .pill-name {
    text-decoration: line-through;
    color: var(--color-danger); /* Indicate absence with danger color */
}
.calendar-pill--replacement {
    border-left: 4px solid var(--color-primary); /* Use primary color for replacement indicator */
}

.calendar-grid {
    font-size: 0.8rem; /* Reduced font size */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* Reduced min-width */
    gap: 0.75rem; /* Reduced gap */
}
.filter-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem; /* Reduced gap */
}
.filter-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem; /* Reduced gap */
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 0.4rem; /* Reduced gap */
}
.filter-group label {
    white-space: nowrap;
    font-weight: 500;
    color: var(--color-text-muted);
    font-size: 0.85rem; /* Reduced font size */
}
.filter-actions {
    display: flex;
    gap: 0.5rem; /* Reduced gap */
}
.calendar-group-section {
    gap: 0.5rem; /* Reduced gap for better spacing */
    margin-bottom: 0.75rem; /* Reduced margin */
}
.calendar-type-section.compact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); /* Reduced min-width */
    gap: 0.4rem; /* Reduced gap */
}
.calendar-pill {
    background: var(--color-surface); /* White background for pills */
    border: 1px solid var(--color-border); /* Lighter border */
    border-radius: var(--radius-md); /* More rounded corners */
    padding: 0.3rem 0.5rem; /* Reduced padding for narrower pills */
    font-size: 0.7rem; /* Reduced font size */
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-height: 40px; /* Reduced min-height */
    justify-content: center;
    box-shadow: var(--shadow-sm); /* Subtle shadow for pills */
    transition: all 0.2s ease-in-out; /* Smooth transition for hover */
    cursor: pointer; /* Indicate interactivity */
}
.calendar-pill:hover {
    transform: translateY(-1px); /* Less pronounced hover effect */
    box-shadow: var(--shadow-md); /* More prominent shadow on hover */
}
.calendar-pill--compact {
    font-size: 0.65rem; /* Reduced font size for compact pills */
    padding: 0.2rem 0.3rem; /* Reduced padding for compact pills */
}
.calendar-pill--replacement {
    border-color: #a5b4fc; /* Lighter replacement border */
    background: #e0e7ff; /* Lighter replacement background */
}
.calendar-pill--absent {
    border-color: #fda4af; /* Lighter absent border */
    background: #ffe4e6; /* Lighter absent background */
}
.pill-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-text); /* Darker text for better contrast */
    font-size: 0.7rem; /* Reduced font size */
}
.pill-time {
    color: var(--color-text-muted); /* Slightly lighter time text */
    font-size: 0.6rem; /* Reduced font size */
}
.calendar-column__header {
    background-color: var(--color-surface-alt); /* Lighter header background */
    padding: 0.6rem; /* Reduced padding */
    border-radius: var(--radius-md) var(--radius-md) 0 0; /* Rounded top corners */
    margin-bottom: 0; /* Remove margin, let gap handle spacing */
    font-weight: 700; /* Bolder font */
    color: var(--color-text);
    text-align: center;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.9rem; /* Reduced font size */
}
.calendar-column {
    background-color: var(--color-surface); /* White background for each day column */
    border: 1px solid var(--color-border); /* Light border */
    border-radius: var(--radius-lg); /* More rounded corners */
    padding: 0.6rem; /* Reduced padding */
    box-shadow: var(--shadow-md); /* Subtle shadow */
    display: flex;
    flex-direction: column;
    gap: 0.6rem; /* Reduced gap */
}
.calendar-column__body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 0.6rem; /* Reduced gap */
    padding: 0.2rem; /* Reduced padding inside the body */
}
.card {
    /* Existing card styles are good, ensure consistency */
    margin-bottom: 1rem; /* Consistent margin */
}
.button {
    border-radius: 999px; /* Fully rounded buttons */
    padding: 0.6rem 1.2rem; /* Reduced padding */
    font-size: 0.9rem; /* Reduced font size */
}
.button.outline {
    background-color: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
}
.button.outline:hover {
    background-color: var(--color-surface-alt);
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.tag {
    border-radius: 999px; /* Fully rounded tags */
    padding: 0.2rem 0.6rem; /* Reduced padding */
    font-size: 0.7rem; /* Reduced font size */
    font-weight: 600;
}
.tag.danger {
    background-color: #fee2e2;
    color: #ef4444;
}
.tag.status-confirmed {
    background-color: #dcfce7;
    color: #22c55e;
}
.checkbox-item input[type="checkbox"] {
    margin-right: 0.4rem; /* Reduced margin */
    accent-color: var(--color-primary); /* Use primary color for checkboxes */
}
h4 {
    font-size: 1rem; /* Reduced font size */
    font-weight: 700;
    margin-bottom: 0.4rem; /* Reduced margin */
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.4rem; /* Reduced padding */
    color: var(--color-text);
}
.calendar-pill--empty {
    color: var(--color-text-muted);
    text-align: center;
    padding: 0.6rem; /* Reduced padding */
    border: 1px dashed var(--color-border);
    background: var(--color-surface-alt);
    border-radius: var(--radius-md);
    font-size: 0.75rem; /* Reduced font size */
}

.calendar-group-title {
    font-size: 0.95rem; /* Reduced font size */
    font-weight: bold;
    margin-bottom: 0.2rem; /* Reduced margin */
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.3rem; /* Reduced padding */
    color: var(--color-text);
}

/* Weekend styling */
.calendar-column--weekend {
    background-color: #fefce8; /* Light yellow background for weekends */
    border-color: #fde68a; /* Yellow border */
}
.calendar-column--weekend .calendar-column__header {
    background-color: #fef9c3; /* Lighter yellow header */
    color: #a16207; /* Darker yellow text */
}

/* Group border colors */
.calendar-group-section.group-border-color-0 { border: 1px solid #3b82f6; background-color: rgba(59, 130, 246, 0.05); } /* Blue */
.calendar-group-section.group-border-color-1 { border: 1px solid #22c55e; background-color: rgba(34, 197, 94, 0.05); } /* Green */
.calendar-group-section.group-border-color-2 { border: 1px solid #f59e0b; background-color: rgba(245, 158, 11, 0.05); } /* Amber */
.calendar-group-section.group-border-color-3 { border: 1px solid #ef4444; background-color: rgba(239, 68, 68, 0.05); } /* Red */
.calendar-group-section.group-border-color-4 { border: 1px solid #a855f7; background-color: rgba(168, 85, 247, 0.05); } /* Purple */
.calendar-group-section {
    padding: 0.5rem;
    border-radius: var(--radius-md);
}

/* --- Monthly Calendar Specific Styles (Moved from monthly_calendar.php) --- */

.month-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 1rem;
    flex-wrap: wrap; /* Allow wrapping for smaller screens */
}
.month-controls > div {
    flex: 1 1 auto; /* Allow items to grow and shrink */
    min-width: 120px; /* Ensure minimum width for inputs */
}
.month-controls label {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 0.2rem;
    display: block;
}
.month-controls input[type="month"],
.month-controls select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: var(--color-surface-alt);
    color: var(--color-text);
}
.month-controls button {
    margin-top: 1.2rem; /* Align with other inputs */
}

.weekday-labels {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-weight: 700; /* Bolder font */
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
    background-color: var(--color-surface-alt);
    border-radius: var(--radius-md);
    color: var(--color-text);
    font-size: 0.85rem;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem; /* Reduced gap */
}
.month-cell {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md); /* Consistent radius */
    min-height: 120px; /* Reduced min-height */
    padding: 0.4rem; /* Reduced padding */
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    font-size: 0.75rem; /* Reduced font size */
    box-shadow: var(--shadow-sm); /* Consistent shadow */
    transition: all 0.2s ease-in-out;
    z-index: 1; /* Establish stacking context for each cell */
    overflow: visible; /* Ensure tooltip is not clipped */
}
.month-cell:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    z-index: 100; /* Bring hovered cell and its contents to the very front */
}
.month-cell.off-month {
    background: var(--color-surface-alt);
    color: var(--color-text-muted);
}
.month-cell.weekend-day {
    background-color: #fefce8; /* Light yellow background for weekends */
    border-color: #fde68a; /* Yellow border */
}
.month-cell.holiday-day {
    background-color: #fff7ed; /* Light orange background for holidays */
    border-color: #fcd34d; /* Orange border */
}

.day-header {
    font-weight: 700; /* Bolder font */
    margin-bottom: 0.2rem; /* Reduced margin */
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem; /* Reduced font size */
    color: var(--color-text);
}
.day-note {
    display: block;
    font-size: 0.55rem; /* Reduced font size */
    color: var(--color-danger); /* Use danger color for holiday notes */
    font-weight: 500;
}

.location-card {
    background: var(--color-surface-alt);
    border-radius: var(--radius-md);
    padding: 0.3rem; /* Reduced padding */
    margin-top: 0.3rem; /* Reduced margin */
    font-size: 0.7rem; /* Reduced font size */
    position: relative;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    /* Removed z-index from here, it's handled by month-cell:hover */
}
.location-card:hover .tooltip {
    opacity: 1;
    pointer-events: auto;
}
.location-card__title {
    display: flex;
    flex-direction: column;
    gap: 0.1rem; /* Reduced gap */
}
.location-card__location {
    font-size: 0.6rem; /* Reduced font size */
    color: var(--color-text-muted);
    font-weight: 500;
}
.count-line {
    display: flex;
    gap: 0.4rem; /* Reduced gap */
    margin-top: 0.1rem; /* Reduced margin */
    font-size: 0.65rem; /* Reduced font size */
    flex-wrap: wrap;
}
.count-line span {
    white-space: nowrap;
}

.group-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem; /* Reduced gap */
    margin-top: 0.2rem; /* Reduced margin */
    font-size: 0.5rem; /* Reduced font size */
}
.group-tag {
    padding: 0.1rem 0.3rem; /* Reduced padding */
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #f3f4f6;
    color: var(--color-text-muted);
    font-weight: 500;
}
.group-tag--internal {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #b45309;
}

/* Vibrant Group Tag Colors */
.group-tag-color-0 { background-color: #e0f2fe; border-color: #93c5fd; color: #2563eb; } /* Light Blue */
.group-tag-color-1 { background-color: #d1fae5; border-color: #6ee7b7; color: #059669; } /* Light Green */
.group-tag-color-2 { background-color: #fffbeb; border-color: #fcd34d; color: #b45309; } /* Light Yellow */
.group-tag-color-3 { background-color: #ffe4e6; border-color: #fda4af; color: #ef4444; } /* Light Red */
.group-tag-color-4 { background-color: #ede9fe; border-color: #c4b5fd; color: #7c3aed; } /* Light Purple */
.group-tag-color-5 { background-color: #e2e8f0; border-color: #94a3b8; color: #475569; } /* Light Gray */
.group-tag-color-6 { background-color: #fef2f2; border-color: #fca5a5; color: #dc2626; } /* Lighter Red */

/* Faint Background Colors for Detail Groups */
.detail-group-color-0 { background-color: rgba(224, 242, 254, 0.3); } /* Very Light Blue */
.detail-group-color-1 { background-color: rgba(209, 250, 229, 0.3); } /* Very Light Green */
.detail-group-color-2 { background-color: rgba(255, 251, 235, 0.3); } /* Very Light Yellow */
.detail-group-color-3 { background-color: rgba(255, 228, 230, 0.3); } /* Very Light Red */
.detail-group-color-4 { background-color: rgba(237, 233, 254, 0.3); } /* Very Light Purple */
.detail-group-color-5 { background-color: rgba(226, 232, 240, 0.3); } /* Very Light Gray */
.detail-group-color-6 { background-color: rgba(254, 242, 242, 0.3); } /* Very Lighter Red */

/* Tooltip styles */
.tooltip {
    position: absolute;
    left: 0;
    top: 100%;
    background: var(--color-surface);
    color: var(--color-text);
    padding: 0.5rem 0.75rem; /* Reduced padding */
    border-radius: var(--radius-md);
    font-size: 0.6rem; /* Reduced font size */
    width: 300px; /* Reduced width */
    max-width: 95vw;
    z-index: 9999; /* Increased z-index to ensure it appears on top */
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px); /* Slightly more offset */
    transition: opacity 0.2s ease, transform 0.2s ease;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
}
.detail-tooltip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* Adjusted grid for details */
    gap: 0.3rem; /* Reduced gap */
}
.detail-group {
    border-bottom: 1px dashed var(--color-border);
    padding: 0.25rem 0;
    margin-bottom: 0.25rem;
}
.detail-card-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
}
.detail-group:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}
.detail-group__title {
    font-size: 0.65rem; /* Reduced font size */
    font-weight: 600;
    margin-bottom: 0.15rem; /* Reduced margin */
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.detail-group--internal {
    background: rgba(253, 230, 138, 0.2);
    border-radius: 4px;
    padding: 0.15rem 0.25rem;
}
.detail-card {
    padding: 0.3rem 0.4rem; /* Reduced padding */
    border-radius: 6px;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid rgba(15, 23, 42, 0.1);
    margin-bottom: 0.2rem;
    width: 100%;
}
.detail-card:last-child {
    margin-bottom: 0;
}
.detail-card__name {
    font-size: 0.68rem; /* Reduced font size */
    font-weight: 600;
    margin-bottom: 0.1rem;
}
.detail-card__time {
    font-size: 0.6rem; /* Reduced font size */
    color: var(--color-text-muted);
    margin-bottom: 0.15rem;
}
.detail-card__meta {
    display: flex;
    align-items: center;
    font-size: 0.6rem; /* Reduced font size */
    gap: 0.2rem;
}
.detail-card__meta span {
    color: var(--color-text);
}

/* Dynamic detail card colors (reusing group colors for consistency) */
.detail-card.group-color-0 { background: #e0e7ff; border-color: #a5b4fc; } /* Blue */
.detail-card.group-color-1 { background: #d1fae5; border-color: #a7f3d0; } /* Green */
.detail-card.group-color-2 { background: #fffbeb; border-color: #fde68a; } /* Yellow */
.detail-card.group-color-3 { background: #ffe4e6; border-color: #fda4af; } /* Red */
.detail-card.group-color-4 { background: #ede9fe; border-color: #ddd6fe; } /* Purple */
