:root {
    --bg: #f7faf9;
    --surface: #ffffff;
    --surface-muted: #f0f7f4;
    --text: #16302d;
    --text-soft: #56716d;
    --border: #d8e7e2;
    --teal: #0d7a72;
    --teal-dark: #085e59;
    --green: #1d9f67;
    --lime: #b4d93d;
    --lime-dark: #85ab1a;
    --warning: #c57c17;
    --danger: #cb3a31;
    --shadow: 0 18px 50px rgba(13, 122, 114, 0.12);
    --shadow-soft: 0 10px 30px rgba(22, 48, 45, 0.08);
    --radius: 20px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(180, 217, 61, 0.16), transparent 24%),
        radial-gradient(circle at top left, rgba(13, 122, 114, 0.11), transparent 20%),
        var(--bg);
    color: var(--text);
}

body.no-scroll {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-layout {
    width: min(1080px, 100%);
    display: grid;
    grid-template-columns: 1.2fr 0.95fr;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(216, 231, 226, 0.9);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.auth-brand {
    padding: 48px;
    background:
        linear-gradient(155deg, rgba(13, 122, 114, 0.98), rgba(8, 94, 89, 0.94)),
        var(--teal);
    color: #fff;
    position: relative;
}

.auth-brand::after {
    content: "";
    position: absolute;
    inset: auto -60px -60px auto;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(180, 217, 61, 0.42), transparent 65%);
}

.brand-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.brand-chip span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 0 8px rgba(180, 217, 61, 0.18);
}

.auth-brand h1 {
    margin: 28px 0 14px;
    font-size: clamp(2rem, 3vw, 3.4rem);
    line-height: 1.08;
}

.auth-brand p {
    margin: 0;
    max-width: 480px;
    color: rgba(255, 255, 255, 0.86);
    line-height: 1.7;
}

.auth-benefits {
    display: grid;
    gap: 14px;
    margin-top: 34px;
}

.auth-benefit {
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-card {
    padding: 44px 38px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-card h2 {
    margin: 0 0 8px;
    font-size: 2rem;
    color: var(--text);
}

.auth-card p {
    margin: 0 0 26px;
    color: var(--text-soft);
}

.auth-form {
    display: grid;
    gap: 16px;
}

.auth-form-link {
    text-align: right;
}

.auth-form-link a {
    color: var(--teal);
    font-weight: 800;
    text-decoration: none;
}

.auth-form-link a:hover {
    text-decoration: underline;
}

.form-group {
    display: grid;
    gap: 6px;
}

.form-group label {
    font-size: 0.86rem;
    color: var(--text-soft);
    font-weight: 600;
}

.input,
select,
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="tel"] {
    width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

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

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

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 76px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 11px;
    padding: 8px 11px;
    color: var(--teal);
    background: rgba(13, 122, 114, 0.08);
    font-weight: 800;
    cursor: pointer;
}

.password-toggle:hover {
    background: rgba(13, 122, 114, 0.14);
}

.search-select {
    position: relative;
}

.search-select-trigger {
    width: 100%;
    min-height: 52px;
    padding: 13px 44px 13px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    text-align: left;
    position: relative;
}

.search-select-trigger::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-soft);
    border-bottom: 2px solid var(--text-soft);
    transform: translateY(-60%) rotate(45deg);
}

.search-select-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 40;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.search-select-input {
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    box-shadow: none;
}

.search-select-input:focus {
    box-shadow: none;
}

.search-select-options {
    max-height: 220px;
    overflow-y: auto;
    padding: 6px;
}

.search-select-option {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    text-align: left;
    padding: 11px 12px;
    border-radius: 10px;
}

.search-select-option:hover,
.search-select-option.selected {
    background: rgba(13, 122, 114, 0.14);
    color: var(--teal-dark);
}

.multi-select-dropdown {
    position: relative;
}

.multi-select-dropdown summary {
    width: 100%;
    min-height: 52px;
    padding: 13px 44px 13px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    list-style: none;
}

.multi-select-dropdown summary::-webkit-details-marker {
    display: none;
}

.multi-select-dropdown summary::after {
    content: "";
    position: absolute;
    right: 16px;
    top: 25px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-soft);
    border-bottom: 2px solid var(--text-soft);
    transform: translateY(-60%) rotate(45deg);
}

.multi-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 40;
    display: grid;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.multi-select-menu label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--text);
    cursor: pointer;
}

.multi-select-menu label:hover {
    background: rgba(13, 122, 114, 0.1);
}

.multi-select-menu input {
    width: auto;
}

.btn,
.btn-secondary,
.btn-ghost,
.btn-danger,
.btn-lime {
    border: none;
    padding: 10px 14px;
    border-radius: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover,
.btn-secondary:hover,
.btn-ghost:hover,
.btn-danger:hover,
.btn-lime:hover {
    transform: translateY(-1px);
}

.btn {
    color: #fff;
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
    box-shadow: 0 12px 25px rgba(13, 122, 114, 0.26);
}

.btn-secondary {
    color: #fff;
    background: linear-gradient(135deg, var(--green) 0%, #1a7d53 100%);
}

.btn-lime {
    color: #244319;
    background: linear-gradient(135deg, #d7f279 0%, var(--lime) 100%);
}

.btn-danger {
    color: #fff;
    background: linear-gradient(135deg, #df5d54 0%, var(--danger) 100%);
}

.btn-ghost {
    color: var(--teal);
    background: rgba(13, 122, 114, 0.08);
    border: 1px solid rgba(13, 122, 114, 0.14);
}

.btn.small,
.btn-secondary.small,
.btn-ghost.small,
.btn-danger.small,
.btn-lime.small {
    padding: 7px 10px;
    border-radius: 10px;
    font-size: 0.88rem;
}

.status-text {
    min-height: 22px;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--green);
}

.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 70;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(216, 231, 226, 0.9);
    align-items: center;
    justify-content: space-between;
}

.mobile-topbar .brand-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--teal-dark);
}

.mobile-menu-btn {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    border: none;
    background: rgba(13, 122, 114, 0.1);
    color: var(--teal);
    font-size: 1.15rem;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 26px 20px;
    background: linear-gradient(180deg, #082a28 0%, #0c4c47 100%);
    color: #fff;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand h2 {
    margin: 0 0 6px;
    font-size: 1.1rem;
}

.sidebar-brand p,
.sidebar-footer p {
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.92rem;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
    margin-top: 26px;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 14px;
    border-radius: 15px;
    color: rgba(255, 255, 255, 0.84);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(180, 217, 61, 0.16);
    transform: translateX(2px);
}

.sidebar-footer {
    margin-top: 26px;
    padding: 16px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    min-width: 0;
    overflow: hidden;
}

.sidebar-footer p {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.shell-main {
    padding: 18px;
}

.shell-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.page-eyebrow {
    margin: 0 0 6px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--green);
    font-weight: 700;
}

.shell-header h1 {
    margin: 0;
    font-size: clamp(1.6rem, 2.2vw, 2.4rem);
}

.page-subtitle {
    margin: 10px 0 0;
    color: var(--text-soft);
    max-width: 760px;
}

.shell-header .page-subtitle,
.section-title > div > p,
.modal-header > div > p {
    display: none;
}

.header-actions,
.toolbar-actions,
.action-row,
.inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.page-content {
    display: grid;
    gap: 14px;
}

.card,
.table-card,
.hero-card,
.metric-card,
.detail-card,
.summary-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(216, 231, 226, 0.92);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}

.card,
.table-card,
.detail-card,
.summary-card {
    padding: 16px;
}

.hero-card {
    padding: 18px;
    background:
        linear-gradient(145deg, rgba(13, 122, 114, 0.98), rgba(19, 124, 91, 0.9)),
        var(--teal);
    color: #fff;
}

.hero-card h2 {
    margin: 0;
}

.hero-card p {
    color: rgba(255, 255, 255, 0.88);
}

.hero-card .summary-pill {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.hero-card .summary-pill strong {
    color: #fff;
}

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

.section-title h2,
.section-title h3 {
    margin: 0;
}

.section-title p {
    margin: 6px 0 0;
    color: var(--text-soft);
}

.grid-2,
.grid-3,
.grid-4,
.stats-grid {
    display: grid;
    gap: 12px;
}

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

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4,
.stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.metric-card::after {
    content: "";
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(180, 217, 61, 0.24), transparent 72%);
}

.metric-label {
    margin: 0 0 12px;
    color: var(--text-soft);
    font-weight: 700;
}

.metric-value {
    margin: 0;
    font-size: 2rem;
    font-weight: 800;
    color: var(--teal-dark);
}

.metric-footnote {
    margin-top: 10px;
    color: var(--text-soft);
    font-size: 0.92rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.9;
}

.badge.NEW,
.badge.NOT_STARTED,
.badge.NOT_PAID,
.badge.DRAFT,
.badge.ACTIVE,
.badge.LOGIN_ONLY {
    background: rgba(13, 122, 114, 0.1);
    color: var(--teal);
}

.badge.CONTACTED,
.badge.INTERESTED,
.badge.CONTENT_PENDING,
.badge.ADVANCE_PAID,
.badge.SENT {
    background: rgba(180, 217, 61, 0.18);
    color: #527000;
}

.badge.PROPOSAL_SENT,
.badge.NEGOTIATION,
.badge.PARTIAL_PAID,
.badge.DESIGNING,
.badge.DEVELOPMENT,
.badge.REVIEW {
    background: rgba(29, 159, 103, 0.12);
    color: var(--green);
}

.badge.CONVERTED,
.badge.FULLY_PAID,
.badge.APPROVED,
.badge.ON_LEAVE,
.badge.COMPLETED,
.badge.DELIVERED {
    background: rgba(29, 159, 103, 0.16);
    color: #16744b;
}

.badge.LOST,
.badge.REJECTED,
.badge.ABSENT,
.badge.EXPIRED,
.badge.INACTIVE,
.badge.DOWN {
    background: rgba(203, 58, 49, 0.12);
    color: var(--danger);
}

.badge.HALF_DAY {
    background: rgba(197, 124, 23, 0.16);
    color: var(--warning);
}

.badge.ADMIN,
.badge.UP {
    background: rgba(13, 122, 114, 0.12);
    color: var(--teal-dark);
}

.badge.SALES,
.badge.STAFF,
.badge.ACCOUNTS {
    background: rgba(180, 217, 61, 0.2);
    color: #587300;
}

.badge.ATTENDANCE_ONLINE {
    background: rgba(20, 164, 93, 0.16);
    color: #087a45;
}

.badge.ATTENDANCE_BREAK {
    background: rgba(234, 155, 36, 0.18);
    color: #a15c00;
}

.badge.ATTENDANCE_LOGGED_OUT {
    background: rgba(72, 91, 112, 0.14);
    color: #334155;
}

.badge.ATTENDANCE_AUTO_END {
    background: rgba(33, 112, 181, 0.14);
    color: #155f9f;
}

.badge.LATE_DETECTION {
    background: rgba(203, 58, 49, 0.14);
    color: var(--danger);
}

.late-duration {
    color: var(--warning);
    font-weight: 700;
    white-space: nowrap;
}

.toolbar {
    display: grid;
    gap: 10px;
}

.toolbar-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.form-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.table-wrap {
    overflow-x: auto;
    width: 100%;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 820px;
}

thead th {
    padding: 10px 12px;
    text-align: left;
    font-size: 0.83rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-soft);
    border-bottom: 1px solid var(--border);
    background: var(--surface-muted);
}

tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(216, 231, 226, 0.7);
    vertical-align: top;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.card,
.table-card,
.detail-card,
.summary-card,
.hero-card,
.modal-card,
.chat-users-card,
.chat-window-card {
    max-width: 100%;
}

tbody tr:hover {
    background: rgba(13, 122, 114, 0.03);
}

tbody tr.selected-row {
    background: rgba(13, 122, 114, 0.1);
    box-shadow: inset 4px 0 0 var(--teal);
}

.table-title {
    font-weight: 700;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.table-subtitle {
    margin-top: 4px;
    font-size: 0.9rem;
    color: var(--text-soft);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.table-description {
    max-width: 100%;
    line-height: 1.6;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.empty-state {
    padding: 28px;
    border: 1px dashed var(--border);
    border-radius: 18px;
    text-align: center;
    color: var(--text-soft);
    background: var(--surface-muted);
}

.split-layout {
    display: grid;
    grid-template-columns: 1.05fr 1.3fr;
    gap: 20px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-attendance-details {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-attendance-details .detail-item span,
.dashboard-attendance-details .detail-item strong,
.dashboard-attendance-details .badge {
    font-weight: 500;
}

.detail-item {
    padding: 11px;
    border-radius: 13px;
    background: var(--surface-muted);
}

.detail-item span {
    display: block;
    margin-bottom: 6px;
    color: var(--text-soft);
    font-size: 0.86rem;
    font-weight: 700;
}

.emergency-leave-options label,
.emergency-leave-options select,
.emergency-leave-options option {
    white-space: nowrap;
}

.emergency-leave-options select {
    min-width: 220px;
}

.timeline {
    display: grid;
    gap: 14px;
}

.timeline-item {
    position: relative;
    padding: 16px 16px 16px 20px;
    border-left: 4px solid rgba(13, 122, 114, 0.24);
    border-radius: 14px;
    background: var(--surface-muted);
}

.timeline-item h4,
.timeline-item p {
    margin: 0;
}

.timeline-item p {
    margin-top: 8px;
    color: var(--text-soft);
}

.summary-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 13px;
    background: var(--surface-muted);
    font-weight: 700;
}

.summary-pill strong {
    color: var(--teal-dark);
}

.receipt-details-active {
    border-color: rgba(13, 122, 114, 0.45);
    box-shadow: 0 18px 42px rgba(13, 122, 114, 0.18);
    animation: receiptPreviewPulse 0.75s ease both;
}

.receipt-preview-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: -4px 0 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(13, 122, 114, 0.12), rgba(180, 217, 61, 0.18));
    color: var(--teal-dark);
    font-weight: 800;
}

.receipt-preview-banner span {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
}

@keyframes receiptPreviewPulse {
    0% {
        transform: translateY(8px);
        box-shadow: 0 0 0 rgba(13, 122, 114, 0);
    }
    100% {
        transform: translateY(0);
    }
}

.attendance-title-row {
    align-items: center;
}

.attendance-action-row {
    flex-wrap: nowrap;
    justify-content: flex-end;
    overflow-x: auto;
    padding-bottom: 2px;
}

.attendance-action-row > * {
    flex: 0 0 auto;
    white-space: nowrap;
}

.attendance-action-row .summary-pill {
    padding: 11px 13px;
}

.dashboard-metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-dashboard-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.compact-dashboard-metrics .ultra-metric-card {
    min-height: 132px;
    padding: 16px 16px 14px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.compact-dashboard-metrics .metric-label {
    margin-bottom: 10px;
    font-size: 0.84rem;
    line-height: 1.2;
}

.compact-dashboard-metrics .metric-value {
    font-size: clamp(1.7rem, 2vw, 2.08rem);
    line-height: 1;
    margin-bottom: 10px;
    word-break: keep-all;
}

.compact-dashboard-metrics .metric-footnote {
    margin-top: 0;
    font-size: 0.8rem;
    line-height: 1.35;
}

.compact-dashboard-metrics .metric-glow {
    width: 104px;
    height: 68px;
}

.compact-dashboard-metrics .ultra-metric-card::before {
    right: -44px;
    top: 24px;
    width: 112px;
    height: 112px;
    border-width: 12px;
}

.compact-dashboard-metrics .ultra-metric-card::after {
    width: 64px;
    height: 64px;
}

.dashboard-panels {
    align-items: start;
}

.dashboard-panel {
    min-height: 100%;
}

.dashboard-compact-list {
    gap: 10px;
}

.timeline-item.compact {
    padding: 12px 14px 12px 16px;
    border-radius: 12px;
}

.timeline-item-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.timeline-item.compact h4 {
    font-size: 0.95rem;
}

.timeline-item.compact p {
    margin-top: 6px;
    font-size: 0.92rem;
    line-height: 1.45;
}

.dashboard-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}

.dashboard-pager-info {
    color: var(--text-soft);
    font-size: 0.88rem;
    font-weight: 700;
}

.dashboard-summary-grid {
    align-items: start;
}

.toast-container {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 60;
    display: grid;
    gap: 10px;
}

.toast {
    min-width: 260px;
    padding: 14px 16px;
    border-radius: 16px;
    color: #fff;
    box-shadow: var(--shadow-soft);
    animation: slideUp 0.2s ease;
}

.toast.success {
    background: linear-gradient(135deg, var(--green) 0%, #157b52 100%);
}

.toast.error {
    background: linear-gradient(135deg, #dd5a53 0%, var(--danger) 100%);
}

.toast.info {
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
}

.overlay {
    display: none;
}

.helper-text {
    font-size: 0.86rem;
    color: var(--text-soft);
}

.kpi-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.mono {
    font-family: Consolas, "Courier New", monospace;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(7, 24, 22, 0.58);
    overflow-y: auto;
}

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

.modal-card {
    width: min(1040px, 100%);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(7, 24, 22, 0.3);
}

.modal-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
}

.modal-header h2,
.modal-header p {
    margin: 0;
}

.modal-header p {
    margin-top: 4px;
    color: var(--text-soft);
}

.quotation-modal {
    padding-bottom: 16px;
}

.quotation-document {
    position: relative;
    width: min(900px, calc(100% - 32px));
    margin: 22px auto;
    padding: 34px;
    color: #173531;
    background: #fff;
    border: 1px solid #dbe9e5;
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.quote-ribbon {
    position: absolute;
    inset: 0 0 auto;
    height: 9px;
    background: linear-gradient(90deg, var(--teal), var(--green), var(--lime));
}

.quote-header,
.quote-intro,
.quote-summary,
.quote-footer {
    display: grid;
    gap: 20px;
}

.quote-header {
    grid-template-columns: 1fr auto;
    align-items: start;
    padding-bottom: 22px;
    border-bottom: 1px solid #dbe9e5;
}

.quote-brand {
    display: flex;
    gap: 14px;
    align-items: center;
}

.quote-logo {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--teal-dark), var(--green));
    font-weight: 900;
    letter-spacing: 0.04em;
}

.quote-brand h2,
.quote-intro h3 {
    margin: 0;
}

.quote-brand p,
.quote-intro p,
.quote-summary p,
.quote-footer p {
    margin: 5px 0 0;
    color: #5b746f;
}

.quote-meta {
    min-width: 190px;
    padding: 14px;
    border-radius: 12px;
    background: #eef7f3;
    text-align: right;
}

.quote-meta span,
.quote-label {
    display: block;
    color: var(--green);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.quote-meta strong {
    display: block;
    margin-top: 5px;
    font-size: 1.2rem;
}

.quote-meta small {
    display: block;
    margin-top: 4px;
    color: #5b746f;
}

.quote-intro {
    grid-template-columns: 0.9fr 1.1fr;
    padding: 24px 0;
}

.quote-table-wrap {
    overflow-x: auto;
}

.quote-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
}

.quote-table thead th {
    color: #fff;
    background: var(--teal-dark);
    border-bottom: 0;
}

.quote-table tbody td {
    color: #173531;
    background: #fff;
}

.quote-summary {
    grid-template-columns: 1fr 320px;
    align-items: start;
    padding-top: 20px;
}

.quote-total-box {
    border: 1px solid #dbe9e5;
    border-radius: 14px;
    overflow: hidden;
}

.quote-total-box div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 15px;
    border-bottom: 1px solid #dbe9e5;
}

.quote-total-box div:last-child {
    border-bottom: 0;
}

.quote-total-box .grand-total {
    color: #fff;
    background: var(--teal-dark);
}

.quote-footer {
    grid-template-columns: 1fr 1fr;
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid #dbe9e5;
}

.quote-footer p:last-child {
    text-align: right;
}

.project-info-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 4px 0 20px;
}

.lead-report-document {
    max-width: 840px;
}

.lead-report-table th,
.lead-report-table td {
    font-size: 0.9rem;
}

.lead-report-table td {
    vertical-align: top;
}

.lead-staff-summary {
    display: grid;
    gap: 10px;
}

.lead-report-summary-grid {
    padding-top: 8px;
}

.timeline .inline-actions {
    justify-content: flex-end;
}

.lead-followup-actions {
    margin-top: 12px;
}

.print-page {
    background: #fff;
}

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

@media (max-width: 1100px) {
    .grid-4,
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compact-dashboard-metrics {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
    }

    .compact-dashboard-metrics .ultra-metric-card {
        min-height: 140px;
        padding: 18px 16px;
    }

    .compact-dashboard-metrics .metric-footnote {
        font-size: 0.82rem;
    }

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

@media (max-width: 900px) {
    .compact-dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1320px) {
    .app-shell {
        grid-template-columns: 240px minmax(0, 1fr);
    }

    .sidebar {
        padding: 22px 16px;
    }

    .shell-main {
        padding: 20px;
        min-width: 0;
    }

    .split-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-metrics-grid,
    .dashboard-visual-grid,
    .dashboard-spotlight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .compact-dashboard-metrics {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .dashboard-hero-content {
        grid-template-columns: minmax(0, 1fr) minmax(220px, 0.7fr);
    }

    .dashboard-hero-copy h2 {
        font-size: clamp(1.75rem, 2.6vw, 2.35rem);
    }

    .dashboard-hero-visual {
        min-height: 230px;
    }

    .orbit-one {
        width: 230px;
        height: 230px;
    }

    .orbit-two {
        width: 184px;
        height: 184px;
    }

    .hero-core {
        width: 166px;
        height: 166px;
    }
}

@media (max-width: 1440px) and (min-width: 921px) {
    .split-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-visual-grid,
    .dashboard-spotlight-grid,
    .dashboard-panels {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-hero-copy h2 {
        font-size: clamp(1.75rem, 2.4vw, 2.45rem);
    }
}

@media (max-width: 1180px) and (min-width: 921px) {
    .app-shell {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .nav-link {
        padding: 12px;
        font-size: 0.94rem;
    }

    .card,
    .table-card,
    .detail-card,
    .summary-card {
        padding: 18px;
    }

    .dashboard-hero-ultra {
        padding: 22px;
    }

    .dashboard-hero-content,
    .dashboard-visual-grid,
    .dashboard-spotlight-grid,
    .dashboard-panels,
    .dashboard-summary-grid,
    .staff-task-layout {
        grid-template-columns: 1fr;
    }

    .dashboard-hero-visual {
        display: none;
    }

    .dashboard-pager,
    .section-title {
        align-items: stretch;
        flex-direction: column;
    }

    .attendance-title-row {
        align-items: center;
        flex-direction: row;
    }

    .section-title .inline-actions {
        width: 100%;
    }

    .section-title .attendance-action-row {
        width: auto;
    }

    .section-title .inline-actions > * {
        flex: 1 1 auto;
        min-width: 0;
    }

    .section-title .attendance-action-row > * {
        flex: 0 0 auto;
    }

    .toolbar-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .staff-admin-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .staff-wide-table-card table {
        min-width: 720px;
    }

    .staff-task-layout {
        grid-template-columns: 1fr;
    }

    .task-form-card {
        position: static;
    }

    .task-form-card .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .task-form-card .form-group:nth-child(2) {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 920px) {
    .mobile-topbar {
        display: flex;
    }

    .app-shell {
        grid-template-columns: 1fr;
        padding-top: 75px;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(84vw, 300px);
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        z-index: 90;
    }

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

    .overlay {
        position: fixed;
        inset: 0;
        background: rgba(8, 20, 19, 0.36);
        z-index: 80;
    }

    body.menu-open .overlay {
        display: block;
    }

    .shell-main {
        padding: 16px;
        min-width: 0;
    }

    .toolbar-grid,
    .form-grid,
    .grid-2,
    .detail-grid,
    .grid-3,
    .grid-4,
    .stats-grid,
    .staff-task-layout,
    .split-layout {
        grid-template-columns: 1fr;
    }

    .staff-admin-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .staff-wide-table-card table,
    .staff-task-layout table,
    .staff-directory-layout table {
        min-width: 0;
    }

    .task-workspace {
        margin-top: 16px;
        gap: 16px;
    }

    .task-form-card {
        position: static;
    }

    .task-status-card .toolbar-grid {
        grid-template-columns: 1fr;
    }

    .task-status-card table {
        min-width: 0;
        table-layout: auto;
    }

    .shell-header {
        flex-direction: column;
        align-items: stretch;
        margin-bottom: 16px;
    }

    .header-actions {
        justify-content: flex-start;
    }

    .card,
    .table-card,
    .detail-card,
    .summary-card,
    .hero-card {
        padding: 18px;
    }

    .page-content {
        gap: 16px;
    }

    .search-select-panel {
        position: static;
        margin-top: 8px;
    }
}

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

    .auth-brand,
    .auth-card {
        padding: 28px 22px;
    }

    .grid-4,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        align-items: stretch;
        flex-direction: column;
    }

    .attendance-title-row {
        align-items: center;
        flex-direction: row;
        gap: 10px;
    }

    .section-title .inline-actions,
    .section-title input,
    .section-title select,
    .header-actions,
    .action-row {
        width: 100%;
    }

    .btn,
    .btn-secondary,
    .btn-ghost,
    .btn-danger,
    .btn-lime {
        min-height: 44px;
        white-space: normal;
    }

    .inline-actions {
        align-items: stretch;
    }

    .inline-actions > * {
        flex: 1 1 auto;
        min-width: 0;
    }

    .section-title .attendance-action-row {
        width: auto;
        align-items: center;
    }

    .section-title .attendance-action-row > * {
        flex: 0 0 auto;
        min-width: max-content;
    }

    .toolbar-grid {
        grid-template-columns: 1fr;
    }

    .toolbar-grid > *,
    .header-actions > *,
    .action-row > * {
        width: 100%;
    }

    .table-wrap {
        overflow-x: auto;
    }

    table,
    thead,
    tbody,
    tr,
    td {
        display: block;
        width: 100%;
    }

    table {
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0 12px;
    }

    thead {
        display: none;
    }

    tbody tr {
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: #fff;
        box-shadow: var(--shadow-soft);
    }

    tbody td {
        display: grid;
        grid-template-columns: minmax(104px, 38%) 1fr;
        gap: 12px;
        align-items: start;
        padding: 10px 4px;
        border-bottom: 1px solid rgba(216, 231, 226, 0.7);
    }

    tbody td:last-child {
        border-bottom: 0;
    }

    tbody td .inline-actions {
        width: 100%;
    }

    tbody td::before {
        content: attr(data-label);
        color: var(--text-soft);
        font-size: 0.8rem;
        font-weight: 800;
        text-transform: uppercase;
    }

    tbody td[colspan] {
        display: block;
    }

    tbody td[colspan]::before {
        content: "";
    }

    .task-status-card tbody tr {
        padding: 14px;
    }

    .task-status-card tbody td {
        grid-template-columns: minmax(92px, 34%) 1fr;
        gap: 10px;
    }

    .task-status-card tbody td:first-child {
        background: rgba(235, 248, 247, 0.82);
        border-radius: 12px;
        padding: 12px;
    }

    .modal-backdrop {
        padding: 12px;
    }

    .modal-card {
        max-height: calc(100vh - 24px);
        border-radius: 12px;
    }

    .modal-header,
    .quote-header,
    .quote-intro,
    .quote-summary,
    .quote-footer,
    .project-info-grid {
        grid-template-columns: 1fr;
    }

    .modal-header {
        align-items: stretch;
        flex-direction: column;
    }

    .quotation-document {
        width: 100%;
        padding: 18px;
    }

    .quote-meta,
    .quote-footer p:last-child {
        text-align: left;
    }

    .quote-table,
    .quote-table thead,
    .quote-table tbody,
    .quote-table tr,
    .quote-table td,
    .quote-table th {
        display: revert;
        width: auto;
    }

    .quote-table thead {
        display: table-header-group;
    }

    .quote-table tbody tr {
        display: table-row;
        padding: 0;
        border: 0;
        box-shadow: none;
    }

    .quote-table tbody td {
        display: table-cell;
        padding: 10px;
    }

    .quote-table tbody td::before {
        content: "";
    }
}

@media (max-width: 560px) {
    .mobile-topbar {
        padding: 12px 14px;
    }

    .mobile-topbar .brand-title {
        font-size: 0.92rem;
    }

    .shell-main {
        padding: 12px;
    }

    .card,
    .table-card,
    .detail-card,
    .summary-card,
    .hero-card,
    .auth-brand,
    .auth-card {
        padding: 16px;
    }

    .shell-header h1 {
        font-size: 1.5rem;
    }

    .page-subtitle,
    .section-title p,
    .metric-footnote,
    .helper-text {
        font-size: 0.88rem;
    }

    .summary-pill {
        width: 100%;
        justify-content: space-between;
        padding: 10px 12px;
    }

    .attendance-action-row .summary-pill {
        width: auto;
        justify-content: center;
    }

    .metric-value {
        font-size: 1.6rem;
    }

    tbody tr {
        padding: 10px;
    }

    tbody td {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 8px 2px;
    }

    tbody td::before {
        font-size: 0.74rem;
    }

    .timeline-item,
    .timeline-item.compact {
        padding: 12px;
    }

    .timeline-item-top {
        flex-direction: column;
        gap: 4px;
    }

    .dashboard-pager {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-pager .inline-actions {
        width: 100%;
    }

    .modal-card {
        border-radius: 10px;
    }
}

@media (max-width: 420px) {
    .shell-header h1 {
        font-size: 1.35rem;
    }

    .page-eyebrow {
        font-size: 0.74rem;
    }

    .btn,
    .btn-secondary,
    .btn-ghost,
    .btn-danger,
    .btn-lime {
        padding: 11px 13px;
        font-size: 0.92rem;
    }

    .search-select-trigger,
    .input,
    select,
    textarea,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="number"],
    input[type="date"],
    input[type="tel"] {
        min-height: 46px;
        padding: 11px 12px;
    }

    .quote-header,
    .quote-intro,
    .quote-summary {
        gap: 12px;
    }
}

@media print {
    body {
        background: #fff;
    }

    .mobile-topbar,
    .sidebar,
    .shell-header,
    .table-card,
    .card,
    .modal-header,
    .overlay {
        display: none !important;
    }

    .modal-backdrop,
    .modal-card {
        position: static;
        display: block;
        padding: 0;
        max-height: none;
        overflow: visible;
        background: #fff;
        box-shadow: none;
    }

    .quotation-document {
        width: 100%;
        margin: 0;
        padding: 22px;
        border: 0;
        box-shadow: none;
    }

    .quote-table {
        min-width: 0;
    }
}

.dashboard-hero-ultra {
    position: relative;
    overflow: hidden;
    padding: 28px;
    border-radius: 26px;
    background:
        radial-gradient(circle at top right, rgba(180, 217, 61, 0.24), transparent 28%),
        radial-gradient(circle at left center, rgba(19, 140, 129, 0.2), transparent 24%),
        linear-gradient(135deg, #083d3b 0%, #0f6c66 58%, #1d9f67 100%);
    box-shadow: var(--shadow);
    color: #fff;
}

.dashboard-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent 82%);
    pointer-events: none;
}

.dashboard-hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
    gap: 24px;
    align-items: center;
}

.dashboard-hero-copy h2 {
    margin: 10px 0 12px;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.08;
    max-width: 720px;
}

.dashboard-hero-copy p:last-child {
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    max-width: 680px;
    line-height: 1.7;
}

.dashboard-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 0.84rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.dashboard-chip::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--lime);
    box-shadow: 0 0 0 8px rgba(180, 217, 61, 0.18);
}

.dashboard-hero-visual {
    min-height: 280px;
    display: grid;
    place-items: center;
    position: relative;
}

.hero-orbit {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.18);
    animation: orbitFloat 8s ease-in-out infinite;
}

.orbit-one {
    width: 280px;
    height: 280px;
}

.orbit-two {
    width: 220px;
    height: 220px;
    animation-duration: 6.5s;
    animation-direction: reverse;
}

.orbit-three {
    width: 160px;
    height: 160px;
    animation-duration: 5.5s;
}

.hero-core {
    position: relative;
    z-index: 2;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(10px);
}

.hero-core span,
.hero-core small {
    color: rgba(255, 255, 255, 0.82);
}

.hero-core strong {
    display: block;
    margin: 8px 0;
    font-size: 2rem;
    line-height: 1.1;
}

.hero-pill-row {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.dashboard-hero-ultra .summary-pill {
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.96);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.dashboard-hero-ultra .summary-pill strong {
    color: #ffffff;
}

.dashboard-spotlight-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.spotlight-card {
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08));
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 18px 30px rgba(5, 34, 32, 0.16);
    backdrop-filter: blur(12px);
}

.spotlight-label {
    display: inline-block;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.spotlight-card strong {
    display: block;
    font-size: 1.5rem;
    line-height: 1.1;
    color: #fff;
}

.spotlight-card p {
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.55;
}

.dashboard-visual-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.dashboard-visual-card {
    min-height: 320px;
    position: relative;
    overflow: hidden;
}

.dashboard-visual-card::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, rgba(13, 122, 114, 0.09), transparent 68%);
    pointer-events: none;
}

.ultra-metric-card {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(13, 122, 114, 0.12);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 249, 247, 0.96));
    animation: dashboardReveal 0.7s ease both;
    animation-delay: var(--delay, 0ms);
    box-shadow: 0 14px 28px rgba(8, 56, 52, 0.07);
}

.metric-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 140px;
    height: 88px;
    border-radius: 0 0 90px 0;
    background:
        linear-gradient(135deg, rgba(13, 122, 114, 0.22) 0%, rgba(35, 164, 143, 0.12) 48%, rgba(142, 215, 187, 0.02) 100%);
    filter: blur(0.2px);
    pointer-events: none;
}

.ultra-metric-card::before {
    content: "";
    position: absolute;
    right: -46px;
    top: 18px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 16px solid rgba(13, 122, 114, 0.08);
    border-left-color: transparent;
    border-bottom-color: transparent;
    transform: rotate(20deg);
    pointer-events: none;
}

.ultra-metric-card::after {
    content: "";
    position: absolute;
    right: -22px;
    top: -22px;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(13, 122, 114, 0.08), transparent 68%);
    pointer-events: none;
}

.ultra-metric-card.theme-leads .metric-glow {
    background: linear-gradient(135deg, rgba(13, 122, 114, 0.24) 0%, rgba(32, 166, 159, 0.12) 50%, rgba(32, 166, 159, 0.02) 100%);
}

.ultra-metric-card.theme-leads::before {
    border-color: rgba(13, 122, 114, 0.11);
    border-left-color: transparent;
    border-bottom-color: transparent;
}

.ultra-metric-card.theme-new .metric-glow {
    background: linear-gradient(135deg, rgba(156, 201, 43, 0.22) 0%, rgba(213, 236, 119, 0.11) 50%, rgba(213, 236, 119, 0.02) 100%);
}

.ultra-metric-card.theme-new::before {
    right: auto;
    left: -42px;
    top: auto;
    bottom: -24px;
    width: 132px;
    height: 132px;
    border: 14px solid rgba(180, 217, 61, 0.14);
    border-top-color: transparent;
    border-right-color: transparent;
    transform: rotate(-14deg);
}

.ultra-metric-card.theme-new::after {
    right: 18px;
    top: 22px;
    width: 54px;
    height: 54px;
    background: radial-gradient(circle, rgba(180, 217, 61, 0.16), transparent 70%);
}

.ultra-metric-card.theme-converted .metric-glow {
    background: linear-gradient(135deg, rgba(29, 159, 103, 0.22) 0%, rgba(89, 214, 156, 0.11) 50%, rgba(89, 214, 156, 0.02) 100%);
}

.ultra-metric-card.theme-converted::before {
    right: -16px;
    top: 22px;
    width: 120px;
    height: 120px;
    border: 0;
    background:
        radial-gradient(circle at center, transparent 44%, rgba(29, 159, 103, 0.1) 45%, rgba(29, 159, 103, 0.1) 54%, transparent 55%),
        radial-gradient(circle at center, transparent 64%, rgba(29, 159, 103, 0.08) 65%, rgba(29, 159, 103, 0.08) 72%, transparent 73%);
    transform: none;
}

.ultra-metric-card.theme-converted::after {
    background: radial-gradient(circle, rgba(29, 159, 103, 0.1), transparent 70%);
}

.ultra-metric-card.theme-lost .metric-glow {
    background: linear-gradient(135deg, rgba(203, 58, 49, 0.21) 0%, rgba(240, 128, 121, 0.1) 50%, rgba(240, 128, 121, 0.02) 100%);
}

.ultra-metric-card.theme-lost::before {
    right: -20px;
    top: 18px;
    width: 148px;
    height: 80px;
    border-radius: 80px 80px 0 0;
    border: 14px solid rgba(203, 58, 49, 0.1);
    border-bottom: 0;
    background: none;
    transform: rotate(14deg);
}

.ultra-metric-card.theme-lost::after {
    right: auto;
    left: 18px;
    top: auto;
    bottom: 16px;
    width: 56px;
    height: 56px;
    background: radial-gradient(circle, rgba(203, 58, 49, 0.12), transparent 70%);
}

.ultra-metric-card.theme-followups .metric-glow {
    background: linear-gradient(135deg, rgba(36, 121, 198, 0.22) 0%, rgba(110, 174, 240, 0.1) 50%, rgba(110, 174, 240, 0.02) 100%);
}

.ultra-metric-card.theme-followups::before {
    right: -40px;
    top: 10px;
    width: 164px;
    height: 164px;
    border: 12px dashed rgba(36, 121, 198, 0.12);
    border-radius: 50%;
    background: none;
    transform: rotate(18deg);
}

.ultra-metric-card.theme-followups::after {
    background: radial-gradient(circle, rgba(36, 121, 198, 0.1), transparent 68%);
}

.ultra-metric-card.theme-payments .metric-glow {
    background: linear-gradient(135deg, rgba(197, 124, 23, 0.22) 0%, rgba(227, 178, 91, 0.1) 50%, rgba(227, 178, 91, 0.02) 100%);
}

.ultra-metric-card.theme-payments::before {
    right: -32px;
    top: 12px;
    width: 140px;
    height: 140px;
    border: 14px solid rgba(197, 124, 23, 0.12);
    border-left-color: transparent;
    border-top-color: transparent;
    transform: rotate(-24deg);
}

.ultra-metric-card.theme-payments::after {
    background: radial-gradient(circle, rgba(197, 124, 23, 0.12), transparent 70%);
}

.ultra-metric-card.theme-monthly-revenue .metric-glow {
    background: linear-gradient(135deg, rgba(9, 91, 110, 0.22) 0%, rgba(39, 164, 192, 0.1) 50%, rgba(39, 164, 192, 0.02) 100%);
}

.ultra-metric-card.theme-monthly-revenue::before {
    right: -12px;
    top: 16px;
    width: 132px;
    height: 132px;
    border: 0;
    background:
        conic-gradient(from 210deg, rgba(9, 91, 110, 0.12), rgba(39, 164, 192, 0.03), transparent 72%);
    border-radius: 50%;
    transform: none;
}

.ultra-metric-card.theme-monthly-revenue::after {
    background: radial-gradient(circle, rgba(9, 91, 110, 0.12), transparent 68%);
}

.ultra-metric-card.theme-total-revenue .metric-glow {
    background: linear-gradient(135deg, rgba(15, 61, 93, 0.22) 0%, rgba(70, 141, 181, 0.1) 50%, rgba(70, 141, 181, 0.02) 100%);
}

.ultra-metric-card.theme-total-revenue::before {
    right: auto;
    left: -26px;
    top: 14px;
    width: 150px;
    height: 150px;
    border: 16px solid rgba(15, 61, 93, 0.1);
    border-right-color: transparent;
    border-bottom-color: transparent;
    transform: rotate(-10deg);
}

.ultra-metric-card.theme-total-revenue::after {
    right: 18px;
    top: auto;
    bottom: 18px;
    width: 62px;
    height: 62px;
    background: radial-gradient(circle, rgba(70, 141, 181, 0.13), transparent 70%);
}

.ultra-metric-card.theme-projects .metric-glow {
    background: linear-gradient(135deg, rgba(95, 96, 216, 0.22) 0%, rgba(149, 149, 238, 0.1) 50%, rgba(149, 149, 238, 0.02) 100%);
}

.ultra-metric-card.theme-projects::before {
    right: -24px;
    top: 18px;
    width: 142px;
    height: 90px;
    border-radius: 90px 90px 0 0;
    border: 14px solid rgba(95, 96, 216, 0.11);
    border-bottom: 0;
    background: none;
    transform: rotate(-16deg);
}

.ultra-metric-card.theme-projects::after {
    background: radial-gradient(circle, rgba(95, 96, 216, 0.12), transparent 70%);
}

.ultra-metric-card:hover {
    transform: translateY(-4px);
    border-color: rgba(13, 122, 114, 0.2);
    box-shadow: 0 20px 40px rgba(8, 56, 52, 0.12);
}

.ultra-metric-card:hover::before {
    border-color: rgba(13, 122, 114, 0.14);
    border-left-color: transparent;
    border-bottom-color: transparent;
}

.ultra-metric-card.theme-new:hover::before {
    border-color: rgba(180, 217, 61, 0.18);
    border-top-color: transparent;
    border-right-color: transparent;
}

.ultra-metric-card.theme-lost:hover::before,
.ultra-metric-card.theme-projects:hover::before {
    border-color: inherit;
    border-bottom: 0;
}

.ultra-metric-card.theme-followups:hover::before {
    border-color: rgba(36, 121, 198, 0.16);
}

.ultra-metric-card.theme-monthly-revenue:hover::before,
.ultra-metric-card.theme-converted:hover::before {
    opacity: 0.95;
}

.mini-bar-chart {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
    gap: 14px;
    align-items: end;
    min-height: 220px;
    padding-top: 8px;
}

.mini-bar-group {
    display: grid;
    gap: 8px;
    justify-items: center;
}

.mini-bar-track {
    width: 100%;
    max-width: 60px;
    height: 170px;
    display: flex;
    align-items: end;
    padding: 6px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(13, 122, 114, 0.06), rgba(13, 122, 114, 0.16));
}

.mini-bar-fill {
    width: 100%;
    height: var(--bar-height, 0%);
    border-radius: 14px;
    background: linear-gradient(180deg, #0d7a72, #085e59);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
    animation: growBar 1s ease both;
}

.mini-bar-fill.tone-lime {
    background: linear-gradient(180deg, #c7ea5b, #98c425);
}

.mini-bar-fill.tone-green {
    background: linear-gradient(180deg, #32bf7d, #1d9f67);
}

.mini-bar-fill.tone-red {
    background: linear-gradient(180deg, #ef736c, #cb3a31);
}

.mini-bar-fill.tone-teal {
    background: linear-gradient(180deg, #12a89d, #0d7a72);
}

.mini-bar-fill.tone-warning {
    background: linear-gradient(180deg, #e8b45d, #c57c17);
}

.mini-bar-value {
    font-weight: 800;
    color: var(--text);
}

.mini-bar-label {
    font-size: 0.85rem;
    color: var(--text-soft);
    text-align: center;
}

.chart-insights {
    margin-top: 16px;
}

.chart-note {
    display: inline-flex;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(13, 122, 114, 0.08);
    color: var(--text-soft);
    font-size: 0.9rem;
}

.donut-wrap {
    position: relative;
    width: 220px;
    max-width: 100%;
    margin: 10px auto 0;
}

.donut-chart {
    display: block;
    width: 100%;
    transform: rotate(-90deg);
}

.donut-base {
    fill: none;
    stroke: rgba(13, 122, 114, 0.09);
    stroke-width: 14;
}

.donut-segment {
    fill: none;
    stroke-width: 14;
    stroke-linecap: round;
    animation: donutReveal 1s ease both;
}

.segment-warning {
    stroke: #d89a33;
}

.segment-success {
    stroke: #1d9f67;
}

.segment-teal {
    stroke: #0d7a72;
}

.donut-center {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    text-align: center;
}

.donut-center strong {
    font-size: 1.8rem;
    line-height: 1;
}

.donut-center span {
    color: var(--text-soft);
    font-size: 0.9rem;
}

.donut-legend {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.legend-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-soft);
    flex-wrap: wrap;
}

.legend-row strong {
    color: var(--text);
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.legend-dot.warning {
    background: #d89a33;
}

.legend-dot.success {
    background: #1d9f67;
}

.legend-dot.teal {
    background: #0d7a72;
}

.premium-summary-card {
    border: 1px solid rgba(13, 122, 114, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 250, 249, 0.96));
}

.sales-prospect-panel {
    border: 1px solid rgba(13, 122, 114, 0.14);
    border-radius: 18px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(13, 122, 114, 0.06), rgba(216, 154, 51, 0.08));
}

.prospect-rows {
    display: grid;
    gap: 14px;
    margin-top: 12px;
}

.prospect-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr)) auto;
    align-items: end;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(18, 38, 35, 0.09);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.76);
}

.prospects-cell {
    min-width: 340px;
    vertical-align: top;
}

.prospect-summary-box {
    display: grid;
    gap: 12px;
    max-width: 430px;
}

.prospect-modal-card {
    max-width: 820px;
}

.prospect-modal-card .prospect-summary-box {
    max-width: none;
}

.prospect-view-button {
    white-space: nowrap;
    border-color: rgba(13, 122, 114, 0.26);
    color: #0d655f;
    background: rgba(13, 122, 114, 0.06);
}

.prospect-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: fit-content;
    min-width: 138px;
    padding: 7px 11px;
    border-radius: 999px;
    background: #f6fbfa;
    color: var(--text);
    border: 1px solid rgba(13, 122, 114, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.75);
}

.prospect-count-pill span {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-soft);
}

.prospect-count-pill strong {
    font-size: 1.05rem;
}

.prospect-mini-list {
    display: grid;
    gap: 10px;
}

.prospect-mini-card {
    position: relative;
    overflow: hidden;
    padding: 12px 13px 13px 16px;
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 250, 0.95));
    border: 1px solid rgba(13, 122, 114, 0.16);
    box-shadow: 0 14px 34px rgba(18, 38, 35, 0.08);
}

.prospect-mini-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, #0d7a72, #d89a33);
}

.prospect-mini-card-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.prospect-mini-card-head strong {
    color: var(--text);
    font-size: 0.9rem;
    letter-spacing: -0.01em;
}

.prospect-mini-card-head span {
    max-width: 48%;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(13, 122, 114, 0.08);
    color: #0d655f;
    font-size: 0.72rem;
    font-weight: 700;
    text-align: right;
}

.prospect-empty-note {
    color: var(--text-soft);
    font-size: 0.78rem;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(18, 38, 35, 0.04);
}

.prospect-mini-grid {
    display: grid;
    grid-template-columns: minmax(140px, 1.1fr) minmax(116px, auto) minmax(110px, 0.9fr);
    gap: 8px;
}

.prospect-mini-grid div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 8px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(18, 38, 35, 0.06);
}

.prospect-mini-grid span {
    color: var(--text-soft);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.prospect-mini-grid b {
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 700;
    word-break: break-word;
}

.prospect-phone {
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    font-variant-numeric: tabular-nums;
}

.floating-chat-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 40;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    height: 54px;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0d7a72, #1fa56f);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 18px 34px rgba(13, 122, 114, 0.28);
}

.chat-shell {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 22px;
    min-width: 0;
    height: calc(100vh - 150px);
    min-height: 620px;
    overflow: hidden;
}

.chat-users-card,
.chat-window-card {
    border-radius: 26px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-soft);
    padding: 22px;
}

.chat-search {
    width: 100%;
    margin-bottom: 14px;
}

.chat-users-list {
    display: grid;
    gap: 10px;
    max-height: none;
    overflow: auto;
    padding-right: 4px;
}

.chat-users-card {
    min-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
}

.chat-window-card {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
    overflow: hidden;
}

.chat-user {
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(13, 122, 114, 0.14);
    border-radius: 16px;
    background: #f8fcfb;
    text-align: left;
    cursor: pointer;
}

.chat-user.active {
    background: rgba(13, 122, 114, 0.12);
    border-color: rgba(13, 122, 114, 0.42);
}

.chat-user span,
.chat-user small {
    display: block;
    overflow-wrap: anywhere;
}

.chat-user span {
    font-weight: 800;
    color: var(--text);
}

.chat-user small {
    margin-top: 4px;
    color: var(--text-soft);
}

.chat-window-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    min-width: 0;
    background: rgba(255, 255, 255, 0.96);
    position: sticky;
    top: 0;
    z-index: 2;
}

.chat-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.chat-avatar {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e9fbf2, #d6eee9);
    color: #0d655f;
    font-weight: 900;
}

.chat-contact h2,
.chat-contact p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-mobile-actions {
    display: none;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 4px;
    overflow: auto;
    min-height: 0;
    overscroll-behavior: contain;
}

.chat-message-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    max-width: min(78%, 680px);
}

.chat-message-row.mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message-row.theirs {
    align-self: flex-start;
}

.chat-select {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(18, 38, 35, 0.06);
}

.chat-select input {
    width: 14px;
    height: 14px;
}

.chat-bubble {
    max-width: min(72%, 620px);
    padding: 12px 14px;
    border-radius: 18px;
}

.chat-message-row .chat-bubble {
    max-width: 100%;
}

.chat-bubble.mine {
    align-self: flex-end;
    border-bottom-right-radius: 6px;
    background: #0d7a72;
    color: #fff;
}

.chat-bubble.theirs {
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    background: #eef7f5;
    color: var(--text);
}

.chat-bubble p {
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.chat-bubble span {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    opacity: 0.78;
}

.chat-compose {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.96);
}

.chat-input-wrap {
    position: relative;
    min-width: 0;
}

.chat-emoji-toggle {
    position: absolute;
    left: 12px;
    bottom: 11px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(13, 122, 114, 0.14);
    border-radius: 50%;
    background: #f5fbfa;
    color: #0d655f;
    cursor: pointer;
    line-height: 1;
}

.chat-emoji-toggle svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chat-compose textarea {
    min-height: 54px;
    max-height: 140px;
    resize: vertical;
    padding-left: 56px;
}

.chat-emoji-picker {
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    z-index: 8;
    width: min(520px, calc(100vw - 48px));
    max-height: 360px;
    overflow-y: auto;
    padding: 16px;
    border-radius: 18px;
    background: #171d1c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}

.chat-emoji-picker[hidden] {
    display: none;
}

.chat-emoji-group + .chat-emoji-group {
    margin-top: 18px;
}

.chat-emoji-group h4 {
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
}

.chat-emoji-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 8px;
}

.chat-emoji-grid button {
    width: 100%;
    aspect-ratio: 1;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    font-size: 1.55rem;
}

.chat-emoji-grid button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-back-button {
    display: none;
}

.dashboard-quick-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 10px 0 0;
}

.quick-action-card {
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    border: 1px solid rgba(13, 122, 114, 0.14);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(232, 247, 244, 0.9));
    color: var(--text);
    text-align: left;
    text-decoration: none;
    box-shadow: 0 14px 38px rgba(13, 61, 57, 0.08);
    cursor: pointer;
}

.quick-action-card span {
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.quick-action-card strong {
    color: #073a36;
    font-size: 0.92rem;
    font-weight: 500;
}

.quick-action-card:hover {
    transform: translateY(-2px);
    border-color: rgba(13, 122, 114, 0.34);
}

.quick-action-attendance {
    border-color: rgba(9, 111, 99, 0.28);
    background: linear-gradient(135deg, #e7fbf7, #ffffff 68%);
    box-shadow: 0 14px 32px rgba(9, 111, 99, 0.12);
}

.quick-action-reminder {
    border-color: rgba(207, 145, 20, 0.28);
    background: linear-gradient(135deg, #fff6df, #ffffff 68%);
    box-shadow: 0 14px 32px rgba(207, 145, 20, 0.12);
}

.quick-action-worklog {
    border-color: rgba(50, 110, 185, 0.26);
    background: linear-gradient(135deg, #e9f4ff, #ffffff 68%);
    box-shadow: 0 14px 32px rgba(50, 110, 185, 0.12);
}

.quick-action-profile {
    border-color: rgba(112, 90, 180, 0.26);
    background: linear-gradient(135deg, #f0edff, #ffffff 68%);
    box-shadow: 0 14px 32px rgba(112, 90, 180, 0.12);
}

.dashboard-collapsible-stack {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.dashboard-collapsible-stack .collapsible-section[open] {
    grid-column: 1 / -1;
}

.collapsible-section {
    padding: 0;
    overflow: hidden;
}

.collapsible-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    color: var(--text);
    cursor: pointer;
    list-style: none;
}

.collapsible-summary::-webkit-details-marker {
    display: none;
}

.collapsible-summary span {
    font-size: 1.05rem;
    font-weight: 700;
}

.collapsible-toggle-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(13, 122, 114, 0.11);
    color: var(--primary-dark);
    font-style: normal;
    font-size: 1.35rem;
    line-height: 1;
}

.collapsible-toggle-icon::before {
    content: "+";
}

.collapsible-section[open] .collapsible-toggle-icon::before {
    content: "-";
}

.collapsible-body {
    padding: 0 18px 18px;
}

.collapsible-actions {
    justify-content: flex-end;
    margin-bottom: 12px;
}

.staff-admin-actions {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.staff-add-card {
    background: linear-gradient(135deg, #0d7a72, #159b72);
    color: #fff;
}

.staff-add-card span,
.staff-add-card strong {
    color: #fff;
}

.staff-form-panel {
    margin-top: 24px;
    border-color: rgba(13, 122, 114, 0.22);
}

.staff-history-preview {
    margin-top: 18px;
}

.staff-history-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.staff-history-card {
    display: grid;
    gap: 10px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(239, 249, 248, 0.94), rgba(255, 255, 255, 0.98));
    box-shadow: 0 14px 34px rgba(8, 62, 58, 0.08);
}

.staff-history-card > span {
    color: var(--text-soft);
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.staff-history-card > strong {
    color: var(--text);
    font-size: 2rem;
    line-height: 1;
}

.staff-history-card ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.staff-history-card li {
    display: grid;
    gap: 2px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(13, 122, 114, 0.1);
}

.staff-history-card li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.staff-history-card li strong {
    color: var(--teal-dark);
}

.staff-history-card li span {
    color: var(--text-soft);
}

.staff-history-card a {
    color: var(--teal);
    font-weight: 800;
}

.staff-task-layout {
    grid-template-columns: minmax(340px, 0.72fr) minmax(0, 1.28fr);
    align-items: start;
}

.task-workspace {
    margin-top: 24px;
    gap: 22px;
}

.task-form-card,
.task-status-card {
    position: relative;
    overflow: hidden;
}

.task-form-card::before,
.task-status-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: linear-gradient(90deg, var(--teal), rgba(203, 244, 64, 0.9));
}

.task-form-card {
    position: sticky;
    top: 18px;
}

.task-form-card .form-grid {
    gap: 14px;
}

.task-form-card textarea {
    min-height: 118px;
    resize: vertical;
}

.task-form-card .action-row {
    justify-content: space-between;
}

.task-status-card .section-title {
    align-items: center;
}

.task-status-card .toolbar {
    margin: 4px 0 10px;
}

.task-status-actions {
    justify-content: flex-end;
}

.task-collapse-toggle {
    display: none;
}

.task-status-body {
    display: grid;
    gap: 0;
}

.task-status-card .toolbar-grid {
    grid-template-columns: minmax(190px, 1.15fr) minmax(170px, 1fr) minmax(130px, 0.72fr);
}

.task-status-card .table-wrap {
    border-radius: 18px;
}

.task-status-card table {
    min-width: 760px;
    table-layout: fixed;
}

.task-status-card th:nth-child(1),
.task-status-card td:nth-child(1) {
    width: 31%;
}

.task-status-card th:nth-child(2),
.task-status-card td:nth-child(2) {
    width: 28%;
}

.task-status-card th:nth-child(3),
.task-status-card td:nth-child(3) {
    width: 12%;
}

.task-status-card th:nth-child(4),
.task-status-card td:nth-child(4),
.task-status-card th:nth-child(5),
.task-status-card td:nth-child(5) {
    width: 14.5%;
}

.task-status-card .table-title,
.task-status-card .table-description,
.task-status-card .table-subtitle {
    overflow-wrap: anywhere;
}

.date-range-select {
    min-width: 0;
    border: 2px solid var(--teal) !important;
    background: #edf8f7;
    box-shadow: 0 0 0 2px rgba(13, 122, 114, 0.1);
}

.date-range-custom {
    display: contents;
}

.date-range-custom.is-hidden,
.date-range-custom[hidden] {
    display: none !important;
}

.date-range-custom input[type="date"] {
    border: 2px solid var(--teal) !important;
    background: #edf8f7;
    box-shadow: 0 0 0 2px rgba(13, 122, 114, 0.1);
}

#staffHistorySection .toolbar select,
#staffHistorySection .toolbar input[type="date"],
.staff-wide-table-card .toolbar select,
.staff-wide-table-card .toolbar input[type="date"] {
    border: 2px solid var(--teal) !important;
    background: #edf8f7;
    box-shadow: 0 0 0 2px rgba(13, 122, 114, 0.1);
}

.date-range-select:focus,
.date-range-custom input[type="date"]:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(13, 122, 114, 0.14);
}

.staff-directory-layout {
    grid-template-columns: 1fr;
}

.staff-wide-table-card .toolbar-grid,
.staff-task-layout .toolbar-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.staff-wide-table-card .table-wrap,
.staff-task-layout .table-wrap,
.staff-directory-layout .table-wrap {
    overflow-x: auto;
}

.staff-wide-table-card table {
    min-width: 760px;
}

.staff-task-layout table {
    min-width: 640px;
}

.staff-directory-layout table {
    min-width: 560px;
}

.admin-overview-card {
    grid-column: 1 / -1;
}

@media (max-width: 1180px) {
    .staff-task-layout {
        grid-template-columns: 1fr;
    }

    .task-form-card {
        position: static;
    }

    .task-form-card .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .task-form-card .form-group:nth-child(2) {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 920px) {
    .task-workspace {
        margin-top: 16px;
        gap: 16px;
    }

    .task-form-card .form-grid,
    .task-status-card .toolbar-grid {
        grid-template-columns: 1fr;
    }

    .task-status-card table {
        min-width: 0;
        table-layout: auto;
    }

}

@media (max-width: 720px) {
    .task-status-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .task-collapse-toggle {
        display: inline-flex;
    }

    .task-status-card.is-collapsed .task-status-body {
        display: none;
    }

    .task-status-card th,
    .task-status-card td {
        width: 100% !important;
    }

    .task-status-card tbody tr {
        padding: 14px;
    }

    .task-status-card tbody td {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 12px;
        word-break: normal;
        overflow-wrap: anywhere;
    }

    .task-status-card tbody td:first-child {
        background: rgba(235, 248, 247, 0.82);
        border-radius: 12px;
    }

    .task-status-card tbody td::before {
        line-height: 1.2;
    }

    .task-status-card .table-title,
    .task-status-card .table-description,
    .task-status-card .table-subtitle {
        width: 100%;
        min-width: 0;
        white-space: normal;
    }

    .date-range-custom input {
        width: 100%;
    }
}

@keyframes orbitFloat {
    0%, 100% {
        transform: scale(1) translateY(0px);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.04) translateY(-8px);
        opacity: 1;
    }
}

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

@keyframes growBar {
    from {
        height: 0;
    }
    to {
        height: var(--bar-height, 0%);
    }
}

@keyframes donutReveal {
    from {
        opacity: 0.4;
    }
    to {
        opacity: 1;
    }
}

@media (max-width: 1100px) {
    .dashboard-hero-content,
    .dashboard-visual-grid,
    .dashboard-spotlight-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-hero-visual {
        min-height: 240px;
    }

    .prospect-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .prospect-mini-grid {
        grid-template-columns: 1fr;
    }

    .chat-shell {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .chat-users-list {
        max-height: 280px;
    }

    .chat-window-card {
        min-height: 560px;
    }

    .dashboard-collapsible-stack {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .staff-history-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-collapsible-stack {
        grid-template-columns: 1fr;
    }

    body.chat-mobile-active .mobile-topbar,
    body.chat-mobile-active .shell-header {
        display: none;
    }

    body.chat-mobile-active .shell-main {
        padding: 0;
    }

    .chat-shell {
        gap: 14px;
        height: calc(100vh - 78px);
        height: calc(100dvh - 78px);
        min-height: 0;
        overflow: hidden;
    }

    body.chat-mobile-active .chat-shell {
        height: 100vh;
        height: 100dvh;
    }

    .chat-users-card,
    .chat-window-card {
        border-radius: 20px;
        padding: 16px;
    }

    .chat-shell:not(.chat-selected) .chat-window-card {
        display: none;
    }

    .chat-shell.chat-selected .chat-users-card {
        display: none;
    }

    .chat-shell.chat-selected .chat-window-card {
        display: grid;
        height: 100%;
        min-height: 0;
        border-radius: 0;
        border: 0;
        padding-top: 0;
    }

    .chat-window-header {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        margin: 0 -16px;
        min-height: 68px;
        padding: 12px 12px;
        border-bottom: 0;
        background: #101819;
        color: #fff;
        overflow: visible;
    }

    .chat-window-header .inline-actions {
        display: flex;
        grid-column: 1 / -1;
        justify-content: flex-end;
        gap: 8px;
    }

    .chat-window-header .inline-actions .btn-ghost,
    .chat-window-header .inline-actions .btn-danger {
        background: rgba(255, 255, 255, 0.08);
        color: #fff;
        border-color: rgba(255, 255, 255, 0.12);
    }

    .chat-contact {
        gap: 10px;
        min-width: 0;
    }

    .chat-avatar {
        width: 42px;
        height: 42px;
        background: #fff;
        color: #0d655f;
    }

    .chat-contact h2 {
        max-width: 64vw;
        color: #fff;
        font-size: 1rem;
        line-height: 1.2;
        margin: 0;
    }

    .chat-contact p {
        display: none;
    }

    .chat-mobile-actions {
        display: none;
        align-items: center;
        gap: 16px;
        color: #fff;
        font-size: 1.35rem;
    }

    .chat-messages {
        min-height: 0;
        max-height: none;
        margin: 0 -16px;
        padding: 14px 12px;
        background:
            linear-gradient(rgba(9, 24, 23, 0.14), rgba(9, 24, 23, 0.14)),
            radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.22) 0 2px, transparent 3px),
            radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.16) 0 2px, transparent 3px),
            linear-gradient(135deg, #597c74, #d8dfd5);
        background-size: auto, 48px 48px, 60px 60px, auto;
    }

    .chat-message-row {
        max-width: 100%;
    }

    .chat-message-row.mine,
    .chat-message-row.theirs {
        flex-direction: row;
    }

    .chat-message-row.mine {
        justify-content: flex-end;
    }

    .chat-select {
        display: inline-flex;
        background: rgba(255, 255, 255, 0.18);
    }

    .chat-bubble {
        max-width: calc(100vw - 120px);
    }

    .chat-compose {
        grid-template-columns: minmax(0, 1fr) auto;
        margin: 0 -16px -16px;
        padding: 10px 12px 12px;
        border-top: 0;
        background: #101819;
    }

    .chat-input-wrap textarea {
        min-height: 48px;
        border-radius: 999px;
        background: #202b2d;
        border-color: transparent;
        color: #fff;
    }

    .chat-input-wrap textarea::placeholder {
        color: rgba(255, 255, 255, 0.56);
    }

    .chat-compose .btn {
        border-radius: 999px;
        background: #21c263;
        min-width: 68px;
    }

    .chat-bubble.mine {
        background: #0f5a3d;
    }

    .chat-bubble.theirs {
        background: #202b2d;
        color: #fff;
    }

    .chat-emoji-picker {
        left: -4px;
        width: calc(100vw - 56px);
        max-height: 42vh;
        padding: 12px;
        bottom: calc(100% + 12px);
    }

    .chat-emoji-grid {
        grid-template-columns: repeat(8, 1fr);
        gap: 6px;
    }

    .chat-back-button {
        display: inline-flex;
        min-height: 38px;
        padding: 8px 12px;
        background: transparent;
        border-color: transparent;
        color: #fff;
        font-size: 1.6rem;
    }

    .floating-chat-button {
        right: 16px;
        bottom: 16px;
        min-width: 64px;
        height: 48px;
    }

    .dashboard-hero-ultra {
        padding: 20px;
        border-radius: 22px;
    }

    .dashboard-quick-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .staff-admin-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-hero-copy h2 {
        font-size: 1.7rem;
    }

    .hero-core {
        width: 168px;
        height: 168px;
    }

    .orbit-one {
        width: 220px;
        height: 220px;
    }

    .orbit-two {
        width: 176px;
        height: 176px;
    }

    .orbit-three {
        width: 130px;
        height: 130px;
    }

    .mini-bar-track {
        height: 140px;
    }
}

@media (max-width: 560px) {
    .chat-users-list {
        max-height: none;
    }

    .dashboard-quick-actions {
        grid-template-columns: 1fr;
    }

    .compact-dashboard-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .staff-admin-actions {
        grid-template-columns: 1fr;
    }

    .staff-wide-table-card table,
    .staff-task-layout table,
    .staff-directory-layout table {
        min-width: 0;
    }

    .chat-messages {
        min-height: 0;
    }

    .chat-bubble {
        max-width: calc(100vw - 92px);
        padding: 11px 12px;
    }

    .chat-select {
        width: 24px;
        height: 24px;
        flex: 0 0 auto;
    }

    .dashboard-hero-ultra {
        padding: 18px;
    }

    .dashboard-chip {
        font-size: 0.76rem;
    }

    .hero-pill-row {
        flex-direction: column;
    }

    .dashboard-hero-ultra .summary-pill {
        width: 100%;
        justify-content: space-between;
    }

    .dashboard-hero-copy h2 {
        font-size: 1.45rem;
    }

    .hero-core strong {
        font-size: 1.55rem;
    }

    .mini-bar-chart {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .donut-wrap {
        width: 180px;
    }

    .prospect-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .shell-main {
        width: 100%;
        padding: 12px;
    }

    .page-content {
        width: 100%;
        gap: 12px;
    }

    .dashboard-quick-actions,
    .dashboard-summary-grid,
    .dashboard-metrics-grid,
    .compact-dashboard-metrics,
    .dashboard-visual-grid,
    .dashboard-spotlight-grid,
    .dashboard-panels {
        grid-template-columns: 1fr !important;
        width: 100%;
    }

    .quick-action-card,
    .metric-card,
    .ultra-metric-card,
    .dashboard-panel,
    .dashboard-visual-card,
    .card,
    .table-card,
    .summary-card {
        width: 100%;
        min-width: 0;
    }

    .attendance-title-row,
    .section-title {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .attendance-action-row {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        overflow: visible;
    }

    .attendance-action-row > *,
    .section-title .inline-actions > *,
    .header-actions > *,
    .action-row > * {
        width: 100%;
        min-width: 0;
    }

    .dashboard-pager,
    .timeline-item-top {
        align-items: stretch;
        flex-direction: column;
    }

    .timeline-item.compact {
        overflow-wrap: anywhere;
    }
}

@media (max-width: 420px) {
    .mobile-topbar {
        padding: 10px 12px;
        gap: 8px;
    }

    .mobile-topbar .brand-title {
        font-size: 0.9rem;
        min-width: 0;
    }

    .shell-main {
        padding: 10px;
    }

    .card,
    .table-card,
    .summary-card {
        padding: 14px;
        border-radius: 18px;
    }

    .compact-dashboard-metrics .ultra-metric-card {
        min-height: 112px;
        padding: 14px;
    }

    .compact-dashboard-metrics .metric-value {
        font-size: 1.55rem;
    }
}
