:root {
    --bg: #f7f8fb;
    --surface: #ffffff;
    --surface-soft: #fbfcff;
    --text: #172033;
    --muted: #687085;
    --line: #e6e9f1;
    --accent: #4f46e5;
    --accent-soft: #eef2ff;
    --blue: #2563eb;
    --cyan: #0891b2;
    --success: #0f9f6e;
    --success-soft: #e8f8f1;
    --warning: #b7791f;
    --warning-soft: #fff7e6;
    --danger: #c2413a;
    --danger-soft: #fff0ef;
    --shadow: 0 18px 45px rgba(24, 34, 57, 0.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

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

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

.auth-page {
    display: grid;
    place-items: center;
    padding: 28px;
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, 0.08), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #f6f8fb 100%);
}

.auth-card {
    width: min(440px, 100%);
    padding: 34px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-card h1 {
    margin: 18px 0 8px;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0;
}

.auth-card p,
.auth-meta {
    color: var(--muted);
}

.brand,
.identity,
.employee-head,
.task-type,
.task-card-head,
.topbar-actions,
.action-row,
.status-stack {
    display: flex;
    align-items: center;
}

.brand {
    gap: 12px;
    padding: 4px 2px 24px;
}

.brand strong {
    display: block;
    font-weight: 600;
}

.brand small {
    display: block;
    color: var(--muted);
}

.brand-mark,
.avatar {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    color: #fff;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.2);
}

.avatar {
    background: #eef2ff;
    color: var(--accent);
    box-shadow: none;
}

.avatar.small {
    width: 30px;
    height: 30px;
    font-size: 12px;
}

.app-shell {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px;
    background: rgba(255, 255, 255, 0.92);
    border-right: 1px solid var(--line);
    backdrop-filter: blur(14px);
    z-index: 20;
}

.side-nav {
    display: grid;
    gap: 7px;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 11px 13px;
    border-radius: var(--radius);
    color: #475069;
    font-weight: 500;
    line-height: 1;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.side-nav a:hover,
.side-nav a.active {
    background: var(--accent-soft);
    color: var(--accent);
    transform: translateX(2px);
}

.nav-icon,
.task-icon {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border: 1.6px solid currentColor;
    border-radius: 5px;
    color: currentColor;
}

.nav-icon {
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 0;
    background: currentColor;
    opacity: 0.94;
    -webkit-mask-image: var(--icon);
    mask-image: var(--icon);
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 21px 21px;
    mask-size: 21px 21px;
}

.side-nav a.active .nav-icon,
.side-nav a:hover .nav-icon {
    opacity: 1;
}

.nav-icon-grid {
    --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 4h6.7v6.7H4V4Zm9.3 0H20v6.7h-6.7V4ZM4 13.3h6.7V20H4v-6.7Zm9.3 0H20V20h-6.7v-6.7ZM6 6v2.7h2.7V6H6Zm9.3 0v2.7H18V6h-2.7ZM6 15.3V18h2.7v-2.7H6Zm9.3 0V18H18v-2.7h-2.7Z'/%3E%3C/svg%3E");
}

.nav-icon-clients {
    --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M7 4h7.4L19 8.6V20H7a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3Zm0 2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10V9.4L13.6 6H7Zm2 6h6v2H9v-2Zm0 4h5v2H9v-2Z'/%3E%3C/svg%3E");
}

.nav-icon-users {
    --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M9.6 11.6a4 4 0 1 1 0-8 4 4 0 0 1 0 8Zm0-2a2 2 0 1 0 0-4 2 2 0 0 0 0 4Zm7.1 1.7a3.2 3.2 0 1 1 0-6.4 3.2 3.2 0 0 1 0 6.4Zm0-2a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4ZM2.8 19.8c.6-4.1 3.1-6.2 6.8-6.2s6.2 2.1 6.8 6.2H2.8Zm2.5-2h8.6c-.7-1.5-2.1-2.2-4.3-2.2-2.1 0-3.6.7-4.3 2.2Zm11.5-3.5c2.5.2 4 1.8 4.4 4.7h-2.1c-.3-1.3-1-2.1-2.1-2.5-.1-.8-.4-1.5-.8-2.1l.6-.1Z'/%3E%3C/svg%3E");
}

.nav-icon-tasks {
    --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M8 4h8a2 2 0 0 1 2 2h1a2 2 0 0 1 2 2v10a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V8a2 2 0 0 1 2-2h1a2 2 0 0 1 2-2Zm0 2v2h8V6H8ZM5 8v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V8h-1v2H6V8H5Zm4 5h6v2H9v-2Z'/%3E%3C/svg%3E");
}

.nav-icon-reports {
    --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2Zm0 2v14h14V5H5Zm3 11h2v2H8v-2Zm0-4h2v3H8v-3Zm4 1h2v5h-2v-5Zm4-5h2v10h-2V8Z'/%3E%3C/svg%3E");
}

.nav-icon-activity {
    --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 2a10 10 0 1 1 0 20 10 10 0 0 1 0-20Zm0 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm1 3v4.6l3.2 3.2-1.4 1.4L11 12.4V7h2Z'/%3E%3C/svg%3E");
}

.nav-icon-matrix {
    --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 4h16v16H4V4Zm2 2v4h4V6H6Zm6 0v4h6V6h-6Zm-6 6v6h4v-6H6Zm6 0v6h6v-6h-6Z'/%3E%3C/svg%3E");
}

.nav-icon-today {
    --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M7 2h2v2h6V2h2v2h2a2 2 0 0 1 2 2v13a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a2 2 0 0 1 2-2h2V2Zm12 8H5v9a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-9ZM5 8h14V6H5v2Zm10.3 4.4 1.4 1.4-5.1 5.1-3.1-3.1 1.4-1.4 1.7 1.7 3.7-3.7Z'/%3E%3C/svg%3E");
}

.nav-icon-history {
    --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 4a8 8 0 1 1-7.3 4.8H2.2A10 10 0 1 0 12 2a10 10 0 0 0-8.6 4.9L2 4.5V11h6.5L4.9 7.4A8 8 0 0 1 12 4Zm1 3v5.2l3.6 2.1-1 1.7-4.6-2.7V7h2Z'/%3E%3C/svg%3E");
}

.nav-icon-profile {
    --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M12 3a5 5 0 1 1 0 10 5 5 0 0 1 0-10Zm0 2a3 3 0 1 0 0 6 3 3 0 0 0 0-6ZM3.5 21c.7-4.5 3.8-7 8.5-7s7.8 2.5 8.5 7h-17Zm2.5-2h12c-1-2-3-3-6-3s-5 .9-6 3Z'/%3E%3C/svg%3E");
}

.nav-icon-reminder {
    --icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M4 5h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2Zm0 2v.5l8 5 8-5V7H4Zm0 2.9V17h16V9.9l-8 5-8-5Z'/%3E%3C/svg%3E");
}

.task-icon.graphics::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: currentColor;
}

.task-icon.video::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    border: 1.4px solid currentColor;
}

.task-icon.video::after {
    content: "";
    position: absolute;
    right: -5px;
    top: 5px;
    border-left: 6px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

.task-icon.large {
    width: 54px;
    height: 54px;
    border-radius: var(--radius);
    display: inline-grid;
    place-items: center;
    color: var(--accent);
    background: linear-gradient(180deg, #f8faff 0%, var(--accent-soft) 100%);
    border-color: #c7d2fe;
}

.task-icon.large.graphics {
    --task-card-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm0 2v12h14V6H5Zm2 9 3.2-3.7 2.5 2.8 1.8-2.1L18 16H7v-1Zm2-4.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Z'/%3E%3C/svg%3E");
}

.task-icon.large.video {
    --task-card-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 6h10a2 2 0 0 1 2 2v1.8l3.4-2.1A1 1 0 0 1 22 8.5v7a1 1 0 0 1-1.6.8L17 14.2V16a2 2 0 0 1-2 2H5a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3Zm0 2a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h10V8H5Zm12 4 3 1.8V10.2L17 12Z'/%3E%3C/svg%3E");
}

.task-icon.large::before {
    content: "";
    position: absolute;
    inset: 13px;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    background: currentColor;
    transform: none;
    -webkit-mask-image: var(--task-card-icon);
    mask-image: var(--task-card-icon);
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.task-icon.large::after {
    content: none;
}

.sidebar-profile {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 74px;
    display: flex;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    color: inherit;
    transition: border-color 150ms ease, background 150ms ease;
}

.sidebar-profile:hover {
    border-color: #c7d2fe;
    background: var(--accent-soft);
}

.sidebar-profile > div:last-child {
    min-width: 0;
}

.sidebar-profile strong,
.sidebar-profile small {
    display: block;
}

.sidebar-profile small {
    max-width: 155px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: #3e465b;
    font-weight: 500;
    transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

.sidebar-logout:hover {
    border-color: #ffd0cc;
    background: var(--danger-soft);
    color: var(--danger);
}

.main-shell {
    min-width: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 22px 32px;
    background: rgba(247, 248, 251, 0.86);
    border-bottom: 1px solid rgba(230, 233, 241, 0.78);
    backdrop-filter: blur(12px);
}

.topbar h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0;
}

.topbar p {
    margin: 4px 0 0;
    color: var(--muted);
}

.topbar-actions {
    gap: 10px;
}

.date-pill,
.score-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 12px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--muted);
    font-weight: 500;
}

.content-wrap {
    width: min(1480px, 100%);
    margin: 0 auto;
    padding: 28px 32px 48px;
}

.panel,
.stat-card,
.employee-card,
.task-card,
.mini-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 10px 28px rgba(24, 34, 57, 0.05);
}

.panel {
    margin-bottom: 22px;
    padding: 22px;
}

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

.panel-header h2,
.employee-card h3,
.task-card h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0;
}

.panel-header p,
.employee-card p,
.task-card p {
    margin: 3px 0 0;
    color: var(--muted);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

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

.stat-card {
    min-height: 112px;
    padding: 18px;
}

.stat-card span,
.stat-card small {
    display: block;
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin-top: 12px;
    font-size: 30px;
    font-weight: 600;
    letter-spacing: 0;
}

.stat-card.accent {
    background: linear-gradient(135deg, #ffffff, #f4f7ff);
    border-color: #dfe6ff;
}

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

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

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

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

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

.form-grid .full,
.full {
    grid-column: 1 / -1;
}

label span,
fieldset legend {
    display: block;
    margin-bottom: 7px;
    color: #3e465b;
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    padding: 11px 12px;
    color: var(--text);
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #a5b4fc;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

textarea {
    resize: vertical;
}

.password-field {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.checkbox-set {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
}

.checkbox-set label,
.autosave-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: 18px;
}

.checkbox-set input,
.autosave-check input {
    width: auto;
}

.assignment-box {
    padding: 16px;
    border: 1px dashed #cfd6e6;
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.assignment-box h3 {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
    gap: 22px;
    align-items: start;
}

.profile-summary-panel {
    display: grid;
    gap: 18px;
}

.profile-hero {
    display: flex;
    align-items: center;
    gap: 14px;
}

.profile-avatar {
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    font-size: 18px;
}

.profile-hero h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 650;
    letter-spacing: 0;
}

.profile-detail-grid {
    display: grid;
    gap: 10px;
}

.profile-detail-grid div {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.profile-detail-grid span {
    color: #596177;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0;
}

.profile-detail-grid strong {
    min-width: 0;
    color: var(--text);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.btn,
.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.btn:hover,
.link-button:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--blue));
    color: #fff;
    box-shadow: 0 12px 22px rgba(79, 70, 229, 0.18);
}

.btn-light {
    background: #fff;
    border-color: var(--line);
    color: #3e465b;
}

.btn-small {
    min-height: 31px;
    padding: 5px 9px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.link-button {
    min-height: auto;
    color: var(--accent);
    background: var(--accent-soft);
}

.filter-bar,
.inline-filter {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-bar.wide > * {
    flex: 1 1 150px;
}

.inline-filter select {
    min-width: 180px;
}

.client-filter-panel {
    display: grid;
    grid-template-columns: minmax(240px, 1.2fr) repeat(4, minmax(132px, 0.75fr)) auto;
    gap: 10px;
    align-items: end;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff, #fbfcff);
}

.filter-field {
    display: grid;
    grid-template-rows: 18px 44px;
    gap: 6px;
    min-width: 0;
}

.filter-field span {
    display: flex;
    align-items: center;
    margin: 0;
    color: #596177;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0;
}

.filter-field input,
.filter-field select {
    width: 100%;
    height: 44px;
    min-height: 44px;
    padding-block: 9px;
    background-color: #fff;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    align-self: end;
    min-width: 0;
}

.filter-actions .btn {
    min-height: 44px;
    padding-inline: 12px;
}

.report-range-panel {
    display: grid;
    gap: 18px;
}

.report-range-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.report-range-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0;
}

.report-range-head p {
    margin: 4px 0 0;
    color: var(--muted);
}

.report-range-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.report-range-chip {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    color: #596177;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.report-export-btn {
    min-height: 42px;
    padding-inline: 18px;
}

.report-range-form {
    display: grid;
    grid-template-columns: minmax(190px, 240px) minmax(190px, 240px) auto;
    gap: 12px;
    align-items: end;
    justify-content: start;
}

.report-date-field {
    display: grid;
    grid-template-rows: 18px 46px;
    gap: 6px;
    min-width: 0;
}

.report-date-field span {
    display: flex;
    align-items: center;
    margin: 0;
    color: #596177;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0;
}

.report-date-field input {
    height: 46px;
    min-height: 46px;
    padding-block: 10px;
}

.report-range-actions {
    display: flex;
    align-items: end;
}

.report-range-actions .btn {
    min-height: 46px;
    padding-inline: 18px;
}

[data-client-results] {
    transition: opacity 160ms ease;
}

[data-client-results].is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.client-filter-panel.is-loading input,
.client-filter-panel.is-loading select,
.client-filter-panel.is-loading .btn {
    cursor: progress;
}

.table-wrap,
.matrix-wrap {
    width: 100%;
    overflow-x: auto;
}

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

th,
td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

th {
    color: #596177;
    background: var(--surface-soft);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0;
}

tr:hover td {
    background: #fcfdff;
}

.table-wrap .task-type {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    color: #2f3a50;
    font-weight: 400;
    white-space: nowrap;
}

.table-wrap .task-type .task-icon {
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 0;
    background: currentColor;
    -webkit-mask-image: var(--task-type-icon);
    mask-image: var(--task-type-icon);
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.table-wrap .task-type .task-icon.graphics {
    --task-type-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm0 2v12h14V6H5Zm2 9 3.2-3.7 2.5 2.8 1.8-2.1L18 16H7v-1Zm2-4.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Z'/%3E%3C/svg%3E");
}

.table-wrap .task-type .task-icon.video {
    --task-type-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 6h10a2 2 0 0 1 2 2v1.8l3.4-2.1A1 1 0 0 1 22 8.5v7a1 1 0 0 1-1.6.8L17 14.2V16a2 2 0 0 1-2 2H5a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3Zm0 2a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h10V8H5Zm12 4 3 1.8V10.2L17 12Z'/%3E%3C/svg%3E");
}

.table-wrap .task-type .task-icon.graphics::after,
.table-wrap .task-type .task-icon.video::before,
.table-wrap .task-type .task-icon.video::after {
    content: none;
}

.table-wrap .identity {
    gap: 10px;
    min-width: 0;
}

.table-wrap .identity .avatar.small {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
}

.matrix-panel-header {
    margin-bottom: 16px;
}

.matrix-panel-header > * {
    width: 100%;
}

.matrix-heading {
    display: grid;
    gap: 14px;
}

.employee-switcher {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 10px;
    width: 100%;
}

.employee-tab {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 10px;
    min-height: 62px;
    padding: 12px 14px 12px 15px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff, #fbfcff);
    color: var(--text);
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease, transform 150ms ease;
}

.employee-tab::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: transparent;
}

.employee-tab:hover {
    transform: translateY(-1px);
    border-color: #d7dded;
    box-shadow: 0 10px 24px rgba(24, 34, 57, 0.08);
}

.employee-tab.active {
    border-color: #b8c5ff;
    background: #f5f7ff;
    box-shadow: 0 12px 26px rgba(79, 70, 229, 0.12);
}

.employee-tab.active::before {
    background: linear-gradient(180deg, var(--accent), var(--blue));
}

.employee-tab .avatar.small {
    grid-row: 1 / span 2;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
}

.employee-tab strong,
.employee-tab small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.employee-tab strong {
    color: var(--text);
    font-weight: 650;
}

.employee-tab small {
    color: var(--muted);
    font-size: 12px;
}

.matrix-current-employee {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 38px;
    margin: -2px 0 14px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    color: var(--muted);
}

.matrix-current-employee span {
    color: #596177;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0;
}

.matrix-current-employee strong {
    color: var(--text);
    font-weight: 650;
}

.matrix-current-employee small {
    color: var(--muted);
}

.matrix-table {
    min-width: 920px;
    table-layout: fixed;
}

.matrix-table th,
.matrix-table td {
    padding: 12px 16px;
    vertical-align: middle;
}

.matrix-table th:nth-child(1),
.matrix-table td:nth-child(1) {
    width: 25%;
}

.matrix-table th:nth-child(2),
.matrix-table td:nth-child(2) {
    width: 15%;
}

.matrix-table th:nth-child(3),
.matrix-table td:nth-child(3),
.matrix-table th:nth-child(4),
.matrix-table td:nth-child(4) {
    width: 10%;
    text-align: center;
}

.matrix-table th:nth-child(5),
.matrix-table td:nth-child(5) {
    width: 40%;
}

.matrix-table .autosave-check {
    justify-content: center;
    margin: 0;
}

.matrix-table .status-stack {
    justify-content: flex-start;
    gap: 8px;
}

.matrix-table .badge {
    min-width: 0;
    min-height: 34px;
    padding-inline: 12px;
}

.task-monitor-table {
    min-width: 1080px;
    table-layout: fixed;
}

.task-monitor-table th,
.task-monitor-table td {
    padding: 16px;
    vertical-align: top;
}

.task-monitor-table th {
    height: 52px;
    background: #f9fafc;
    color: #3f4961;
    font-size: 11px;
    line-height: 1.25;
}

.task-monitor-table th:nth-child(1),
.task-monitor-table td:nth-child(1) {
    width: 88px;
}

.task-monitor-table th:nth-child(2),
.task-monitor-table td:nth-child(2),
.task-monitor-table th:nth-child(3),
.task-monitor-table td:nth-child(3) {
    width: 132px;
}

.task-monitor-table th:nth-child(4),
.task-monitor-table td:nth-child(4) {
    width: 122px;
}

.task-monitor-table th:nth-child(5),
.task-monitor-table td:nth-child(5),
.task-monitor-table th:nth-child(6),
.task-monitor-table td:nth-child(6),
.task-monitor-table th:nth-child(8),
.task-monitor-table td:nth-child(8) {
    width: 148px;
}

.task-monitor-table th:nth-child(7),
.task-monitor-table td:nth-child(7) {
    width: 128px;
}

.task-monitor-table th:nth-child(9),
.task-monitor-table td:nth-child(9) {
    width: 210px;
}

.manager-status-strip {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.manager-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 58px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
}

.manager-status-item span {
    color: var(--muted);
    font-weight: 500;
}

.manager-status-item strong {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0;
}

.manager-today-table {
    min-width: 940px;
    table-layout: fixed;
}

.manager-today-table th,
.manager-today-table td {
    padding: 14px 16px;
    vertical-align: middle;
}

.manager-today-table th:first-child,
.manager-today-table td:first-child {
    width: 28%;
}

.manager-today-table th:nth-child(2),
.manager-today-table td:nth-child(2) {
    width: 13%;
}

.manager-today-table th:nth-child(3),
.manager-today-table td:nth-child(3),
.manager-today-table th:nth-child(4),
.manager-today-table td:nth-child(4) {
    width: 10%;
}

.manager-today-table th:nth-child(5),
.manager-today-table td:nth-child(5),
.manager-today-table th:nth-child(6),
.manager-today-table td:nth-child(6),
.manager-today-table th:nth-child(7),
.manager-today-table td:nth-child(7) {
    width: 13%;
}

.manager-today-table th:not(:first-child),
.manager-today-table td:not(:first-child) {
    text-align: center;
}

.manager-today-table .badge {
    justify-content: center;
    min-width: 42px;
}

.team-task-table {
    min-width: 1060px;
    table-layout: fixed;
}

.team-task-table th,
.team-task-table td {
    padding: 14px 16px;
    vertical-align: middle;
}

.team-task-table th:nth-child(1),
.team-task-table td:nth-child(1),
.team-task-table th:nth-child(2),
.team-task-table td:nth-child(2) {
    width: 15%;
}

.team-task-table th:nth-child(3),
.team-task-table td:nth-child(3) {
    width: 13%;
}

.team-task-table th:nth-child(4),
.team-task-table td:nth-child(4),
.team-task-table th:nth-child(5),
.team-task-table td:nth-child(5) {
    width: 20%;
}

.team-task-table th:nth-child(6),
.team-task-table td:nth-child(6) {
    width: 12%;
}

.team-task-table th:nth-child(7),
.team-task-table td:nth-child(7) {
    width: 5%;
}

.team-task-table .task-type {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: #2f3a50;
    font-weight: 500;
    white-space: nowrap;
}

.team-task-table .task-type .task-icon {
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 0;
    background: currentColor;
    -webkit-mask-image: var(--task-type-icon);
    mask-image: var(--task-type-icon);
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 18px 18px;
    mask-size: 18px 18px;
}

.team-task-table .task-type .task-icon.graphics {
    --task-type-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm0 2v12h14V6H5Zm2 9 3.2-3.7 2.5 2.8 1.8-2.1L18 16H7v-1Zm2-4.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Z'/%3E%3C/svg%3E");
}

.team-task-table .task-type .task-icon.video {
    --task-type-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 6h10a2 2 0 0 1 2 2v1.8l3.4-2.1A1 1 0 0 1 22 8.5v7a1 1 0 0 1-1.6.8L17 14.2V16a2 2 0 0 1-2 2H5a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3Zm0 2a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h10V8H5Zm12 4 3 1.8V10.2L17 12Z'/%3E%3C/svg%3E");
}

.team-task-table .task-type .task-icon.graphics::after,
.team-task-table .task-type .task-icon.video::before,
.team-task-table .task-type .task-icon.video::after {
    content: none;
}

.datetime-stack {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    color: var(--text);
    line-height: 1.35;
}

.datetime-stack strong {
    font-weight: 500;
}

.datetime-stack small,
.table-muted {
    color: var(--muted);
}

.datetime-stack.compact strong,
.datetime-stack.compact small {
    white-space: nowrap;
}

.task-monitor-table .task-type {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: #2f3a50;
    font-weight: 500;
    white-space: nowrap;
}

.task-monitor-table .task-type .task-icon {
    width: 18px;
    height: 18px;
    border: 0;
    border-radius: 0;
    background: currentColor;
    -webkit-mask-image: var(--task-type-icon);
    mask-image: var(--task-type-icon);
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 18px 18px;
    mask-size: 18px 18px;
}

.task-monitor-table .task-type .task-icon.graphics {
    --task-type-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm0 2v12h14V6H5Zm2 9 3.2-3.7 2.5 2.8 1.8-2.1L18 16H7v-1Zm2-4.5a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3Z'/%3E%3C/svg%3E");
}

.task-monitor-table .task-type .task-icon.video {
    --task-type-icon: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='black' d='M5 6h10a2 2 0 0 1 2 2v1.8l3.4-2.1A1 1 0 0 1 22 8.5v7a1 1 0 0 1-1.6.8L17 14.2V16a2 2 0 0 1-2 2H5a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3Zm0 2a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h10V8H5Zm12 4 3 1.8V10.2L17 12Z'/%3E%3C/svg%3E");
}

.task-monitor-table .task-type .task-icon.graphics::after,
.task-monitor-table .task-type .task-icon.video::before,
.task-monitor-table .task-type .task-icon.video::after {
    content: none;
}

.task-monitor-table .badge {
    min-height: 30px;
    padding-inline: 11px;
}

.task-history-table {
    min-width: 1120px;
    table-layout: fixed;
}

.task-history-table th,
.task-history-table td {
    padding: 14px 16px;
    vertical-align: middle;
}

.task-history-table th:nth-child(1),
.task-history-table td:nth-child(1) {
    width: 16%;
}

.task-history-table th:nth-child(2),
.task-history-table td:nth-child(2) {
    width: 13%;
}

.task-history-table th:nth-child(3),
.task-history-table td:nth-child(3),
.task-history-table th:nth-child(5),
.task-history-table td:nth-child(5) {
    width: 20%;
}

.task-history-table th:nth-child(4),
.task-history-table td:nth-child(4) {
    width: 13%;
}

.task-history-table th:nth-child(6),
.task-history-table td:nth-child(6) {
    width: 10%;
}

.task-history-table th:nth-child(7),
.task-history-table td:nth-child(7) {
    width: 8%;
}

.task-history-table th:nth-child(6),
.task-history-table td:nth-child(6),
.task-history-table th:nth-child(7),
.task-history-table td:nth-child(7) {
    text-align: center;
}

.employee-table {
    min-width: 1040px;
    table-layout: fixed;
}

.employee-table th,
.employee-table td {
    padding: 14px 12px;
}

.employee-table th:nth-child(1),
.employee-table td:nth-child(1) {
    width: 18%;
}

.employee-table th:nth-child(2),
.employee-table td:nth-child(2) {
    width: 19%;
}

.employee-table th:nth-child(3),
.employee-table td:nth-child(3) {
    width: 9%;
}

.employee-table th:nth-child(4),
.employee-table td:nth-child(4) {
    width: 8%;
}

.employee-table th:nth-child(5),
.employee-table td:nth-child(5) {
    width: 10%;
}

.employee-table th:nth-child(6),
.employee-table td:nth-child(6) {
    width: 6%;
}

.employee-table th:nth-child(7),
.employee-table td:nth-child(7) {
    width: 7%;
}

.employee-table th:nth-child(8),
.employee-table td:nth-child(8) {
    width: 23%;
}

.employee-table th:nth-child(4),
.employee-table td:nth-child(4),
.employee-table th:nth-child(5),
.employee-table td:nth-child(5),
.employee-table th:nth-child(6),
.employee-table td:nth-child(6),
.employee-table th:nth-child(7),
.employee-table td:nth-child(7) {
    text-align: center;
}

.employee-table .identity {
    gap: 10px;
    min-width: 0;
}

.employee-table .avatar.small {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
}

.employee-name {
    display: block;
    min-width: 0;
    color: var(--text);
    font-weight: 500;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.contact-stack {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.contact-stack strong,
.contact-stack small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-stack strong {
    color: var(--text);
    font-weight: 500;
}

.contact-stack small {
    color: var(--muted);
}

.employee-table .score-pill {
    justify-content: center;
    min-width: 76px;
    color: #596177;
}

.employee-table .badge,
.employee-table .score-pill {
    margin-inline: auto;
}

.action-row.employee-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.action-row.employee-actions form {
    margin: 0;
}

.action-row.employee-actions .reset-form {
    display: flex;
    flex: 1 1 178px;
    gap: 8px;
    align-items: center;
}

.action-row.employee-actions .reset-form input {
    width: 100%;
    min-width: 0;
}

.remarks-text {
    display: block;
    max-width: 28ch;
    color: #263249;
    line-height: 1.45;
}

.action-row {
    gap: 7px;
    flex-wrap: wrap;
}

.action-row.stacked {
    align-items: flex-start;
}

.action-row.stacked.employee-actions {
    align-items: center;
    gap: 8px;
}

.reset-form {
    display: flex;
    gap: 6px;
}

.reset-form input {
    width: 132px;
    min-height: 31px;
    padding: 5px 8px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.badge.success { color: var(--success); background: var(--success-soft); }
.badge.warning { color: var(--warning); background: var(--warning-soft); }
.badge.info { color: var(--blue); background: #eff6ff; }
.badge.danger { color: var(--danger); background: var(--danger-soft); }
.badge.muted { color: var(--muted); background: #f1f3f7; }

.progress-track {
    width: 100%;
    height: 10px;
    overflow: hidden;
    border-radius: var(--radius);
    background: #edf0f6;
}

.progress-track.small {
    height: 7px;
    margin-top: 8px;
}

.progress-track + .chart-list {
    margin-top: 14px;
}

.progress-track span,
.chart-row i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    animation: grow 500ms ease both;
}

@keyframes grow {
    from { width: 0; }
}

.chart-list,
.stack-list,
.activity-list,
.split-summary {
    display: grid;
    gap: 12px;
}

.chart-row {
    display: grid;
    grid-template-columns: 120px minmax(120px, 1fr) 48px;
    gap: 10px;
    align-items: center;
}

.chart-row div {
    height: 9px;
    border-radius: var(--radius);
    background: #edf0f6;
    overflow: hidden;
}

.mini-card,
.list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mini-card {
    justify-content: flex-start;
    padding: 14px;
}

.mini-card > div {
    width: 100%;
}

.activity-list div {
    position: relative;
    padding-left: 18px;
}

.activity-list div > span {
    position: absolute;
    left: 0;
    top: 7px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
}

.activity-list p,
.activity-list small {
    margin: 0;
}

.activity-list small,
.list-row small {
    color: var(--muted);
}

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

.reminder-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #ffffff, #fbfcff);
}

.reminder-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.reminder-card-head h3,
.reminder-card-head p {
    margin: 0;
}

.reminder-card-head h3 {
    font-size: 17px;
    font-weight: 650;
}

.reminder-card-head p {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.reminder-message {
    min-height: 152px;
    margin: 0;
    padding: 12px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-soft);
    color: #3e465b;
    font: inherit;
    white-space: pre-wrap;
}

.employee-card-grid,
.task-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.employee-card,
.task-card {
    padding: 18px;
    animation: enter 280ms ease both;
}

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

.employee-head,
.task-card-head {
    gap: 12px;
    align-items: flex-start;
}

.task-card-head {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    justify-content: stretch;
    align-items: start;
}

.task-card-head > div {
    min-width: 0;
}

.task-card-head h2 {
    font-weight: 400;
    overflow-wrap: anywhere;
}

.task-card-head .badge {
    margin-top: 4px;
    font-weight: 400;
    white-space: nowrap;
}

.task-card label span,
.task-card .task-meta-grid strong,
.task-card .task-actions .btn {
    font-weight: 400;
}

.task-card .task-meta-grid strong {
    color: #263047;
}

.mini-stats,
.task-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 0;
}

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

.mini-stats span,
.task-meta-grid span {
    padding: 10px;
    border-radius: var(--radius);
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.mini-stats strong,
.task-meta-grid strong,
.task-meta-grid small {
    display: block;
}

.task-meta-grid small {
    color: var(--muted);
}

.card-footer,
.task-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.card-footer small {
    color: var(--muted);
}

.autosave-check span {
    position: relative;
    width: 48px;
    height: 28px;
    border-radius: 999px;
    background: #dfe4ee;
    transition: background 160ms ease;
}

.autosave-check span::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 8px rgba(17, 24, 39, 0.16);
    transition: transform 160ms ease;
}

.autosave-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.autosave-check input:checked + span {
    background: var(--accent);
}

.autosave-check input:checked + span::after {
    transform: translateX(20px);
}

.autosave-check input:disabled + span {
    opacity: 0.62;
}

.autosave-check small {
    min-width: 48px;
    color: var(--muted);
}

.autosave-check small.saved { color: var(--success); }
.autosave-check small.error { color: var(--danger); }

.status-stack {
    gap: 6px;
    flex-wrap: wrap;
}

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

.empty-state.spacious {
    grid-column: 1 / -1;
    padding: 38px;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-list span {
    padding: 8px 10px;
    border-radius: var(--radius);
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.pagination {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.pagination a {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--muted);
}

.pagination a.active {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.flash-stack,
.toast-host {
    display: grid;
    gap: 10px;
}

.flash-stack {
    margin-bottom: 18px;
}

.toast-host {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 100;
}

.toast {
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: var(--shadow);
    color: var(--text);
}

.toast-host .toast {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast-host .toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success { border-color: #bcebd6; background: var(--success-soft); }
.toast-error { border-color: #ffd0cc; background: var(--danger-soft); }

body.modal-open {
    overflow: hidden;
}

.confirm-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.42);
    backdrop-filter: blur(7px);
    opacity: 0;
    transition: opacity 160ms ease;
}

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

.confirm-modal-backdrop.open {
    opacity: 1;
}

.confirm-modal {
    width: min(460px, 100%);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius);
    background:
        linear-gradient(135deg, rgba(79, 70, 229, 0.07), transparent 42%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.22);
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    transition: opacity 160ms ease, transform 160ms ease;
}

.confirm-modal-backdrop.open .confirm-modal {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.confirm-modal-head {
    display: flex;
    gap: 13px;
    align-items: center;
    margin-bottom: 15px;
}

.confirm-modal-icon {
    position: relative;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--blue));
    box-shadow: 0 14px 28px rgba(79, 70, 229, 0.22);
}

.confirm-modal-icon::before,
.confirm-modal-icon::after {
    content: "";
    position: absolute;
    background: #fff;
}

.confirm-modal-icon::before {
    left: 19px;
    top: 10px;
    width: 4px;
    height: 17px;
    border-radius: 999px;
}

.confirm-modal-icon::after {
    left: 19px;
    bottom: 10px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
}

.confirm-eyebrow {
    display: block;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

.confirm-modal h2 {
    margin: 2px 0 0;
    color: var(--text);
    font-size: 20px;
    font-weight: 650;
    letter-spacing: 0;
}

.confirm-modal p {
    margin: 0;
    color: #485268;
    font-size: 15px;
    line-height: 1.55;
}

.confirm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 22px;
}

.confirm-modal-actions .btn {
    min-width: 108px;
}

.mobile-menu-button {
    display: none;
}

.icon-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.icon-button span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    background: var(--text);
    border-radius: 2px;
}

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

.completed-pop {
    animation: completePop 650ms ease both;
}

@keyframes completePop {
    0% { transform: scale(1); opacity: 1; }
    45% { transform: scale(1.02); opacity: 1; }
    100% { transform: scale(0.96); opacity: 0; }
}

@media (max-width: 1180px) {
    .stat-grid,
    .stat-grid.four,
    .dashboard-grid,
    .dashboard-grid.three,
    .profile-layout,
    .reminder-grid,
    .employee-card-grid,
    .task-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .client-filter-panel .filter-search,
    .client-filter-panel .filter-actions {
        grid-column: 1 / -1;
    }

    .client-filter-panel .filter-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 860px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(310px, 88vw);
        transform: translateX(-105%);
        transition: transform 180ms ease;
    }

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

    .mobile-menu-button {
        display: inline-block;
    }

    .topbar {
        align-items: flex-start;
        padding: 18px;
    }

    .topbar-actions {
        flex-direction: column;
        align-items: flex-end;
    }

    .content-wrap {
        padding: 18px;
    }

    .form-grid.two,
    .form-grid.three,
    .stat-grid,
    .stat-grid.four,
    .dashboard-grid,
    .dashboard-grid.three,
    .profile-layout,
    .reminder-grid,
    .employee-card-grid,
    .task-board,
    .manager-status-strip,
    .mini-stats,
    .task-meta-grid {
        grid-template-columns: 1fr;
    }

    .panel-header,
    .card-footer,
    .task-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-bar > *,
    .inline-filter,
    .inline-filter select {
        width: 100%;
    }

    .client-filter-panel {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .client-filter-panel .filter-search,
    .client-filter-panel .filter-actions {
        grid-column: auto;
    }

    .client-filter-panel .filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .employee-tab {
        width: 100%;
    }

    .matrix-current-employee {
        display: grid;
        gap: 2px;
    }

    .report-range-head {
        flex-direction: column;
        align-items: stretch;
    }

    .report-range-tools {
        justify-content: flex-start;
    }

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

    .report-range-actions {
        grid-column: auto;
    }

    .report-range-actions .btn,
    .report-export-btn {
        width: 100%;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 13px;
    }

    .auth-card {
        padding: 22px;
    }

    .topbar {
        flex-wrap: wrap;
    }

    .topbar h1 {
        font-size: 21px;
    }

    .stat-card strong {
        font-size: 26px;
    }

    .panel,
    .task-card,
    .employee-card {
        padding: 16px;
    }

    .task-card-head {
        display: grid;
        grid-template-columns: auto 1fr;
    }

    .task-card-head .badge {
        grid-column: 1 / -1;
        width: fit-content;
    }
}
