:root {
    --wp-task-red: #d5001c;
    --wp-task-cyan: #00a8c7;
    --wp-task-ink: #17191b;
    --wp-task-muted: #66717a;
    --wp-task-line: #d6dadd;
    --wp-task-panel: #ffffff;
}

.wp-task-header-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

body:not([data-view="login"]):not([data-view="register"]):not([data-view="twofa"]) .wp-task-header-button {
    flex: 0 0 60px !important;
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--wp-ui-border, #d2d6d9) !important;
    border-radius: 18px !important;
    background: var(--wp-ui-control, #eef0f2) !important;
    color: var(--wp-ui-text, #2d3135) !important;
    box-shadow: var(--wp-ui-shadow-soft, 0 7px 18px rgba(20,24,28,.07)) !important;
}

body:not([data-view="login"]):not([data-view="register"]):not([data-view="twofa"]) .wp-task-header-button:hover,
body:not([data-view="login"]):not([data-view="register"]):not([data-view="twofa"]) .wp-task-header-button[aria-expanded="true"] {
    border-color: #aeb4b9 !important;
    background: #ffffff !important;
}

.wp-task-header-button svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wp-task-header-badge {
    position: absolute;
    top: 9px;
    right: 8px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--wp-task-red);
    color: #fff;
    font-size: 10px;
    font-weight: 950;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(213,0,28,.28);
}

.wp-task-drawer {
    position: fixed;
    z-index: 245000;
    top: var(--wp-task-safe-top, 84px);
    right: 18px;
    width: min(410px, calc(100vw - 36px));
    max-height: calc(100vh - var(--wp-task-safe-top, 84px) - 18px);
    overflow: hidden;
    border: 1px solid #cfd4d8;
    border-radius: 20px;
    background: #fff;
    color: var(--wp-task-ink);
    box-shadow: 0 24px 70px rgba(20,24,28,.22);
}

.wp-task-drawer[hidden],
.wp-task-manager-overlay[hidden] {
    display: none !important;
}

.wp-task-drawer-head,
.wp-task-manager-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 72px;
    margin: 0;
    padding: 14px 17px;
    border: 0;
    border-bottom: 1px solid var(--wp-task-line);
    background: linear-gradient(135deg, #f6f7f8, #e8ebed);
    color: var(--wp-task-ink);
    box-shadow: none;
}

.wp-task-drawer-head small,
.wp-task-manager-head small,
.wp-task-form-head small {
    display: block;
    margin-bottom: 3px;
    color: #6b747c;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .1em;
}

.wp-task-drawer-head h2,
.wp-task-manager-head h2,
.wp-task-form-head h3 {
    margin: 0;
    color: var(--wp-task-ink);
    font-size: 19px;
    font-weight: 950;
}

.wp-task-drawer-head > button,
.wp-task-manager-head > button {
    width: 38px;
    height: 38px;
    border: 1px solid #cbd0d4;
    border-radius: 11px;
    background: #fff;
    color: #394149;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.wp-task-date-row {
    display: grid;
    grid-template-columns: 38px 1fr 38px;
    gap: 8px;
    padding: 13px 15px;
    border-bottom: 1px solid #e1e4e6;
    background: #fafafa;
}

.wp-task-date-row > button {
    border: 1px solid #ccd1d5;
    border-radius: 10px;
    background: #fff;
    color: #343b42;
    cursor: pointer;
    font-size: 22px;
    font-weight: 800;
}

.wp-task-date-row label {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 9px;
    color: #525c65;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.wp-task-date-row input {
    width: 100%;
    min-height: 38px;
    padding: 0 9px;
    border: 1px solid #ccd1d5;
    border-radius: 9px;
    background: #fff;
    color: #202428;
    font: 750 12px/1 inherit;
}

.wp-task-status {
    min-height: 0;
    padding: 0 15px;
    color: #64707a;
    font-size: 10px;
}

.wp-task-status:not(:empty) { padding-block: 9px; }
.wp-task-status.is-error { color: #c2001b; }

.wp-task-drawer-list {
    display: grid;
    gap: 8px;
    max-height: min(465px, calc(100vh - var(--wp-task-safe-top, 84px) - 225px));
    padding: 13px 15px;
    overflow: auto;
}

.wp-task-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-height: 58px;
    padding: 8px 10px;
    border: 1px solid #d9dde0;
    border-left: 4px solid #aeb5ba;
    border-radius: 12px;
    background: #fff;
}

.wp-task-row.is-high { border-left-color: var(--wp-task-red); }
.wp-task-row.is-overdue { background: #fff7f8; }
.wp-task-row.is-completed { opacity: .58; }
.wp-task-row.is-completed .wp-task-row-copy strong { text-decoration: line-through; }

.wp-task-check {
    width: 27px;
    height: 27px;
    border: 2px solid #aeb5ba;
    border-radius: 8px;
    background: #fff;
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 950;
    line-height: 22px;
}

.wp-task-row.is-completed .wp-task-check {
    border-color: #178a56;
    background: #178a56;
}

.wp-task-row-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.wp-task-row-copy strong {
    overflow: hidden;
    color: #202428;
    font-size: 12px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wp-task-row-copy span {
    overflow: hidden;
    color: #6d7780;
    font-size: 9px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wp-task-empty {
    display: grid;
    place-items: center;
    min-height: 120px;
    padding: 20px;
    border: 1px dashed #cdd2d6;
    border-radius: 13px;
    color: #707a82;
    text-align: center;
}

.wp-task-empty strong { color: #30383f; font-size: 13px; }
.wp-task-empty span { margin-top: 5px; font-size: 10px; }

.wp-task-drawer-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    padding: 13px 15px;
    border-top: 1px solid #e1e4e6;
    background: #fafafa;
}

.wp-task-drawer-actions button,
.wp-task-form-actions button,
.wp-task-template-head button,
.wp-task-file-button {
    min-height: 40px;
    padding: 0 13px;
    border: 1px solid #cbd0d4;
    border-radius: 10px;
    background: #fff;
    color: #2d343a;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 900;
}

.wp-task-drawer-actions .primary,
.wp-task-form-actions .primary {
    border-color: #9ca3a8;
    background: linear-gradient(180deg, #697178, #42494f);
    color: #fff;
}

.wp-task-manager-overlay {
    position: fixed;
    z-index: 300000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 28px;
    background: rgba(27,31,35,.48);
    backdrop-filter: blur(6px);
}

body.wp-task-manager-open { overflow: hidden; }

.wp-task-manager {
    width: min(1180px, calc(100vw - 56px));
    height: min(790px, calc(100vh - 56px));
    overflow: hidden;
    border: 1px solid #c9ced2;
    border-radius: 24px;
    background: #f5f6f7;
    box-shadow: 0 35px 100px rgba(18,22,26,.34);
}

.wp-task-manager-head {
    height: 78px;
    padding-inline: 22px;
}

.wp-task-manager-body {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    height: calc(100% - 78px);
    min-height: 0;
}

.wp-task-template-column {
    min-width: 0;
    padding: 16px;
    border-right: 1px solid #d7dbde;
    background: #eef0f2;
    overflow: hidden;
}

.wp-task-template-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.wp-task-template-head strong { font-size: 14px; }
.wp-task-template-head button { min-height: 34px; }

.wp-task-template-list {
    display: grid;
    gap: 8px;
    max-height: calc(100% - 48px);
    overflow: auto;
}

.wp-task-template {
    display: grid;
    gap: 5px;
    width: 100%;
    padding: 12px;
    border: 1px solid #d0d5d8;
    border-radius: 12px;
    background: #fff;
    color: #283038;
    cursor: pointer;
    text-align: left;
}

.wp-task-template:hover,
.wp-task-template.is-active {
    border-color: #8f979d;
    box-shadow: 0 7px 17px rgba(20,24,28,.09);
}

.wp-task-template.is-active { border-left: 4px solid var(--wp-task-red); }
.wp-task-template strong { font-size: 12px; font-weight: 900; }
.wp-task-template span, .wp-task-template small { color: #6c7680; font-size: 9px; }

.wp-task-form {
    min-width: 0;
    padding: 20px 24px;
    overflow: auto;
    background: #fff;
}

.wp-task-form-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.wp-task-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
}

.wp-task-field {
    display: grid;
    gap: 6px;
    margin-bottom: 13px;
}

.wp-task-field label,
.wp-task-weekdays legend {
    color: #59636c;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .045em;
    text-transform: uppercase;
}

.wp-task-field input,
.wp-task-field select,
.wp-task-field textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #cdd2d6;
    border-radius: 10px;
    background: #fff;
    color: #202428;
    font: 700 12px/1.35 inherit;
    outline: none;
}

.wp-task-field textarea { min-height: 132px; resize: vertical; }
.wp-task-field input:focus, .wp-task-field select:focus, .wp-task-field textarea:focus { border-color: #8e969c; box-shadow: 0 0 0 3px rgba(85,92,99,.11); }

.wp-task-weekdays {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 15px;
    padding: 12px;
    border: 1px solid #d6dade;
    border-radius: 11px;
}

.wp-task-weekdays[hidden] { display: none; }
.wp-task-weekdays legend { padding-inline: 5px; }
.wp-task-weekdays label { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 9px; border: 1px solid #d2d6da; border-radius: 8px; color: #434c54; font-size: 10px; font-weight: 850; }

.wp-task-attachments {
    display: grid;
    gap: 9px;
    margin-top: 3px;
    padding: 13px;
    border: 1px solid #d7dbde;
    border-radius: 12px;
    background: #f8f9fa;
}

.wp-task-attachments > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wp-task-attachments strong { font-size: 11px; }
.wp-task-file-button { display: inline-flex; align-items: center; min-height: 34px; }

.wp-task-file-selection { display: flex; flex-wrap: wrap; gap: 6px; }
.wp-task-file-selection > span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 7px; background: #e8ebed; color: #394149; font-size: 9px; font-weight: 750; }
.wp-task-file-selection button { border: 0; background: transparent; color: #bd0019; cursor: pointer; font-weight: 950; }

.wp-task-attachment-list { display: grid; gap: 6px; }
.wp-task-attachment-list > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 9px; border: 1px solid #d8dcdf; border-radius: 8px; background: #fff; }
.wp-task-attachment-open, .wp-task-attachment-delete { border: 0; background: transparent; cursor: pointer; font: inherit; font-size: 10px; font-weight: 850; }
.wp-task-attachment-open { overflow: hidden; color: #263039; text-overflow: ellipsis; white-space: nowrap; }
.wp-task-attachment-delete { color: #c3001b; }

.wp-task-form-error { min-height: 18px; margin-top: 9px; color: #c3001b; font-size: 10px; font-weight: 750; }

.wp-task-form-actions {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 9px;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid #e0e3e5;
}

.wp-task-form-actions .danger { border-color: rgba(213,0,28,.28); color: #c3001b; }

.wp-assistant-task-card {
    margin-bottom: 12px;
    padding: 13px;
    border: 1px solid #dce1e5;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(17,24,32,.045);
}

.wp-assistant-task-card > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
}

.wp-assistant-task-card header small { color: #75808a; font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.wp-assistant-task-card header h3 { margin: 2px 0 0; color: #20272d; font-size: 16px; font-weight: 950; }
.wp-assistant-task-card header > button, .wp-assistant-task-more { min-height: 32px; padding: 0 11px; border: 1px solid #d4d9dc; border-radius: 9px; background: #f6f7f8; color: #48525b; cursor: pointer; font: inherit; font-size: 9px; font-weight: 850; }
.wp-assistant-task-summary { display: grid; gap: 6px; margin-top: 10px; }
.wp-assistant-task-summary > span { color: #737d86; font-size: 9px; }
.wp-assistant-task-card .wp-task-row { min-height: 48px; padding: 6px 8px; }
.wp-assistant-task-card .wp-task-check { width: 24px; height: 24px; line-height: 19px; }
.wp-assistant-task-more { width: 100%; }

.wp-assistant-calendar-grid.is-week-detail {
    grid-template-columns: 1fr !important;
}

.wp-assistant-calendar-back {
    min-height: 36px;
    border: 1px solid #d1d6da;
    border-radius: 10px;
    background: #f5f6f7;
    color: #3b444c;
    cursor: pointer;
    font-size: 10px;
    font-weight: 900;
}

.wp-assistant-calendar-day {
    display: grid;
    grid-template-columns: 95px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 9px 11px;
    border: 1px solid #d8dde0;
    border-radius: 11px;
    background: #fff;
    color: #283139;
    cursor: pointer;
    text-align: left;
}

.wp-assistant-calendar-day.is-today { border-color: #9aa2a8; box-shadow: inset 4px 0 0 var(--wp-task-red); }
.wp-assistant-calendar-day > strong { font-size: 11px; }
.wp-assistant-calendar-day > span { color: #67727b; font-size: 10px; }
.wp-assistant-calendar-day > b { min-width: 25px; height: 25px; border-radius: 999px; background: #eceff1; color: #343c43; font-size: 10px; line-height: 25px; text-align: center; }

@media (max-width: 900px) {
    .wp-task-manager-body { grid-template-columns: 260px minmax(0, 1fr); }
    .wp-task-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
    .wp-task-drawer { right: 10px; width: calc(100vw - 20px); }
    .wp-task-manager-overlay { padding: 10px; }
    .wp-task-manager { width: calc(100vw - 20px); height: calc(100vh - 20px); }
    .wp-task-manager-body { grid-template-columns: 1fr; grid-template-rows: 190px minmax(0, 1fr); }
    .wp-task-template-column { border-right: 0; border-bottom: 1px solid #d7dbde; }
    .wp-task-template-list { display: flex; overflow: auto; }
    .wp-task-template { flex: 0 0 220px; }
    .wp-task-form { padding: 16px; }
    .wp-task-form-grid { grid-template-columns: 1fr; }
    .wp-task-form-actions { grid-template-columns: 1fr 1fr; }
    .wp-task-form-actions span { display: none; }
}

@media print {
    .wp-task-header-button,
    .wp-task-drawer,
    .wp-task-manager-overlay { display: none !important; }
}
