:root {
    --brand-navy: #173a70;
    --brand-navy-dark: #102d59;
    --brand-navy-light: #214b86;
    --brand-gold: #ffc400;
    --brand-gold-soft: #fff5cf;
    --bg: #f5f7fa;
    --white: #fff;
    --text: #172033;
    --text-secondary: #4f5d73;
    --text-muted: #8390a4;
    --border: #e3e8ef;
    --border-light: #edf0f4;
    --success: #2e8b57;
    --sidebar-width: 248px;
    --sidebar-brand-height: 82px;
    --topbar-height: 70px;
    --shadow-sm: 0 2px 8px rgba(17,32,55,.04);
    --shadow-md: 0 8px 24px rgba(17,32,55,.07);
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;min-height:100%}
[hidden]{display:none !important}
body{min-height:100vh;font-family:Arial,Helvetica,sans-serif;background:var(--bg);color:var(--text)}
a{color:inherit;text-decoration:none}button,input,select,textarea{font:inherit}button{border:0}img{display:block;max-width:100%}
.dashboard-shell{min-height:100vh}
.sidebar{position:fixed;top:0;left:0;bottom:0;width:var(--sidebar-width);display:flex;flex-direction:column;background:var(--brand-navy);color:#fff;overflow:hidden;z-index:100}
.sidebar-brand{height:var(--sidebar-brand-height);min-height:var(--sidebar-brand-height);display:flex;align-items:center;justify-content:center;padding:10px 22px;background:#fff;border-bottom:1px solid #e1e5eb}
.brand-logo{width:140px;max-width:140px;height:auto;max-height:52px;object-fit:contain}
.sidebar-nav{flex:1;padding:22px 12px;overflow-y:auto}
.nav-section-title{margin:0;padding:0 12px 8px;color:rgba(255,255,255,.46);font-size:10px;font-weight:700;letter-spacing:.13em;line-height:1.2}
.nav-section-spaced{margin-top:23px}
.nav-item{position:relative;min-height:42px;display:flex;align-items:center;gap:11px;padding:0 12px;margin-bottom:4px;border-radius:8px;color:rgba(255,255,255,.78);font-size:13px;font-weight:500;transition:background .15s ease,color .15s ease}
.nav-item:hover{background:rgba(255,255,255,.08);color:#fff}
.nav-item.active{background:var(--brand-gold);color:var(--brand-navy-dark);font-weight:700}
.nav-icon{width:18px;height:18px;min-width:18px;display:flex;align-items:center;justify-content:center}.nav-icon svg{width:17px;height:17px;fill:currentColor}
.nav-label{flex:1}
.sidebar-footer{height:54px;min-height:54px;display:flex;align-items:center;gap:9px;padding:0 18px;border-top:1px solid rgba(255,255,255,.08)}
.sidebar-status-dot{width:7px;height:7px;border-radius:50%;background:var(--brand-gold)}.sidebar-status-text{color:rgba(255,255,255,.5);font-size:10px;font-weight:600}
.dashboard-main{min-height:100vh;margin-left:var(--sidebar-width)}
.topbar{position:sticky;top:0;height:var(--topbar-height);display:flex;align-items:center;justify-content:space-between;padding:0 34px;background:#fff;border-bottom:1px solid var(--border);z-index:90}
.topbar-left{min-width:0;flex:1}.global-search{position:relative;width:min(470px,100%)}
.search-icon{position:absolute;left:13px;top:50%;width:17px;height:17px;transform:translateY(-50%);color:#91a0b3}.search-icon svg{width:17px;height:17px;fill:currentColor}
.search-input{width:100%;height:39px;padding:0 42px 0 38px;border:1px solid var(--border);border-radius:9px;background:#f8fafc;color:var(--text);font-size:12px;outline:none}.search-input::placeholder{color:#9aa6b7}.search-input:focus{background:#fff;border-color:#c5d0de;box-shadow:0 0 0 3px rgba(23,58,112,.06)}
.search-shortcut{position:absolute;right:11px;top:50%;transform:translateY(-50%);width:22px;height:22px;display:flex;align-items:center;justify-content:center;border:1px solid var(--border);border-radius:5px;background:#fff;color:#8d99aa;font-size:11px}
.topbar-right{display:flex;align-items:center;gap:13px}.topbar-icon-button{position:relative;width:35px;height:35px;display:flex;align-items:center;justify-content:center;background:transparent;color:#6e7c90;cursor:pointer;border-radius:8px}.topbar-icon-button:hover{background:#f5f7fa}.topbar-icon-button svg{width:18px;height:18px;fill:currentColor}.notification-dot{position:absolute;top:7px;right:7px;width:5px;height:5px;border-radius:50%;background:var(--brand-gold)}.topbar-divider{width:1px;height:28px;background:var(--border)}
.user-menu{display:flex;align-items:center;gap:10px}.user-avatar{width:37px;height:37px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--brand-navy);color:#fff;font-size:13px;font-weight:700}.user-name{font-size:12px;font-weight:700;color:var(--text)}.user-role{margin-top:2px;color:var(--text-muted);font-size:10px}.mobile-menu-button{display:none}
.dashboard-content{padding:30px 34px 46px;min-height:calc(100vh - var(--topbar-height))}
.page-heading-row{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;margin-bottom:28px}.page-eyebrow{color:var(--text-muted);margin-bottom:8px;font-size:10px;font-weight:700;letter-spacing:.16em}.page-title-block h1{margin:0 0 8px;font-size:29px;line-height:1.2}.page-title-block p{max-width:700px;margin:0;color:var(--text-secondary);font-size:13px;line-height:1.65}
.primary-button{min-height:38px;display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:0 14px;border-radius:8px;background:var(--brand-gold);color:var(--brand-navy-dark);font-size:11px;font-weight:700;cursor:pointer}.primary-button:hover{filter:brightness(.98)}
.secondary-button{min-height:36px;display:inline-flex;align-items:center;justify-content:center;gap:7px;padding:0 11px;border:1px solid var(--border);border-radius:7px;background:#fff;color:var(--text-secondary);font-size:10px;font-weight:700;cursor:pointer}.secondary-button:hover{background:#f8fafc}
.hero-card{background:var(--brand-navy);border-radius:16px;padding:31px 38px;position:relative;overflow:hidden;color:#fff;box-shadow:var(--shadow-md)}.hero-card h1{margin:0 0 8px;font-size:30px}.hero-card p{margin:0;color:rgba(255,255,255,.8);font-size:13px;line-height:1.6}.hero-eyebrow{margin-bottom:10px;color:rgba(255,255,255,.55);font-size:10px;font-weight:700;letter-spacing:.16em}.hero-ring{position:absolute;width:240px;height:240px;border:1px solid rgba(255,255,255,.12);border-radius:50%;right:-45px;top:-65px}.hero-ring:after{content:"";position:absolute;width:180px;height:180px;right:28px;top:27px;border:1px solid rgba(255,255,255,.08);border-radius:50%}.hero-dot{position:absolute;right:102px;top:95px;width:11px;height:11px;background:var(--brand-gold);border-radius:50%}
.overview-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-top:18px}.overview-card{background:#fff;border:1px solid var(--border);border-radius:14px;padding:18px;box-shadow:var(--shadow-sm)}.overview-card-top{display:flex;align-items:center;justify-content:space-between}.overview-icon{width:38px;height:38px;border-radius:10px;background:#eef3f9;color:var(--brand-navy);display:flex;align-items:center;justify-content:center}.overview-icon svg{width:18px;height:18px;fill:currentColor}.overview-label{font-size:10px;color:var(--text-secondary);font-weight:700}.overview-value{margin-top:18px;font-size:25px;font-weight:700;color:var(--text)}.overview-description{margin-top:5px;color:var(--text-muted);font-size:11px;line-height:1.45}
.table-card{background:#fff;border:1px solid var(--border);border-radius:14px;box-shadow:var(--shadow-sm);overflow:hidden}.toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px;border-bottom:1px solid var(--border-light)}.toolbar-left,.toolbar-right{display:flex;align-items:center;gap:8px}.filter-input,.filter-select{height:36px;border:1px solid var(--border);border-radius:7px;background:#fff;color:var(--text);font-size:11px;padding:0 10px;outline:none}.filter-input{width:280px}.filter-input:focus,.filter-select:focus{border-color:#c5d0de;box-shadow:0 0 0 3px rgba(23,58,112,.06)}
.table-wrapper{overflow-x:auto}.data-table{width:100%;border-collapse:collapse}.data-table th{padding:11px 16px;background:#fafbfd;border-bottom:1px solid var(--border);text-align:left;color:#738197;font-size:9px;font-weight:700;letter-spacing:.05em;text-transform:uppercase}.data-table td{padding:13px 16px;border-bottom:1px solid var(--border-light);color:var(--text-secondary);font-size:11px;vertical-align:middle}.data-table tr:last-child td{border-bottom:0}.data-table tbody tr:hover{background:#fbfcfe}
.status-badge{display:inline-flex;align-items:center;min-height:23px;padding:0 8px;border-radius:6px;font-size:9px;font-weight:700}.status-active{background:#edf7f1;color:var(--success)}.status-inactive{background:#f2f4f7;color:var(--text-muted)}.type-badge{display:inline-flex;align-items:center;min-height:23px;padding:0 8px;border-radius:6px;background:#eef3f9;color:var(--brand-navy);font-size:9px;font-weight:700}.type-external{background:var(--brand-gold-soft);color:#6e5600}
.person-cell{display:flex;align-items:center;gap:10px}.person-avatar{width:32px;height:32px;min-width:32px;border-radius:8px;background:#eef3f9;color:var(--brand-navy);display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:700}.person-name{font-weight:700;color:var(--text)}.person-meta{margin-top:3px;color:var(--text-muted);font-size:9px}.whatsapp-number{font-variant-numeric:tabular-nums}.row-actions{display:flex;justify-content:flex-end;gap:5px}.table-action{min-height:28px;padding:0 8px;border:1px solid var(--border);border-radius:6px;background:#fff;color:var(--text-secondary);font-size:9px;font-weight:700;cursor:pointer}.table-action:hover{background:#f7f9fb}
.notice{padding:12px 14px;border-radius:8px;border:1px solid var(--border);background:#fafbfd;color:var(--text-secondary);font-size:11px;line-height:1.5}.notice-success{background:#edf7f1;border-color:#d2eadb;color:#236c45}.notice-error{background:#fff1f1;border-color:#f1d1d1;color:#9a3030}
.modal{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;padding:20px;z-index:300}.modal[hidden]{display:none}.modal-backdrop{position:absolute;inset:0;background:rgba(16,45,89,.34);backdrop-filter:blur(2px)}.modal-dialog{position:relative;width:min(560px,100%);max-height:calc(100vh - 40px);overflow:auto;background:#fff;border:1px solid var(--border);border-radius:14px;box-shadow:0 20px 60px rgba(16,45,89,.18)}.modal-header{padding:20px 22px;border-bottom:1px solid var(--border-light);display:flex;justify-content:space-between;gap:16px}.modal-header h2{margin:0;font-size:19px}.modal-header p{margin:6px 0 0;color:var(--text-muted);font-size:10px}.modal-close{width:30px;height:30px;border-radius:6px;background:#f4f6f9;color:var(--text-secondary);font-size:18px;cursor:pointer}.modal-body{padding:22px}.form-field{margin-bottom:15px}.form-field label{display:block;margin-bottom:6px;color:var(--text-secondary);font-size:10px;font-weight:700}.form-field input,.form-field select,.form-field textarea{width:100%;border:1px solid var(--border);border-radius:7px;background:#fff;padding:10px 11px;color:var(--text);font-size:11px;outline:none}.form-field textarea{min-height:82px;resize:vertical}.form-field input:focus,.form-field select:focus,.form-field textarea:focus{border-color:#c5d0de;box-shadow:0 0 0 3px rgba(23,58,112,.06)}.form-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}.form-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
.home-actions{display:flex;gap:8px;margin-top:22px}.home-section{margin-top:28px}.home-section h2{margin:0;font-size:17px}.home-section p{margin:6px 0 0;color:var(--text-muted);font-size:11px}.application-strip{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:16px}.application-card{background:#fff;border:1px solid var(--border);border-radius:12px;padding:17px;box-shadow:var(--shadow-sm)}.application-card h3{margin:12px 0 5px;font-size:14px}.application-card p{margin:0;color:var(--text-muted);font-size:10px;line-height:1.5}
@media (max-width:1000px){.overview-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.application-strip{grid-template-columns:1fr}.dashboard-content{padding:24px}.topbar{padding:0 24px}}
@media (max-width:760px){:root{--sidebar-width:0px}.sidebar{width:260px;transform:translateX(-100%);transition:transform .2s ease;box-shadow:12px 0 30px rgba(0,0,0,.12)}.sidebar.open{transform:translateX(0)}.dashboard-main{margin-left:0}.mobile-menu-button{display:flex;width:34px;height:34px;align-items:center;justify-content:center;background:transparent;color:var(--brand-navy);cursor:pointer;margin-right:8px}.mobile-menu-button svg{width:19px;height:19px;stroke:currentColor;fill:none;stroke-width:2}.topbar{padding:0 14px}.global-search{width:100%}.topbar-left{display:flex;align-items:center}.topbar-right .user-info{display:none}.user-avatar{width:34px;height:34px}.page-heading-row{flex-direction:column}.overview-grid{grid-template-columns:1fr}.form-row{grid-template-columns:1fr}.filter-input{width:200px}}

/* =========================================================
   TASKS WORKSPACE
   ========================================================= */
.task-overview-grid { margin-bottom: 24px; }
.task-toolbar-left { flex-wrap: wrap; }
.task-table td { vertical-align: middle; }
.task-name-cell { display: flex; align-items: center; gap: 11px; min-width: 260px; }
.task-type-dot { width: 32px; height: 32px; flex: 0 0 32px; display: grid; place-items: center; border-radius: 8px; background: var(--brand-gold-soft); color: var(--brand-navy-dark); font-size: 12px; font-weight: 800; }
.mini-people-list { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.mini-person { display: inline-flex; gap: 6px; align-items: center; font-size: 11px; color: var(--text); }
.mini-person small { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.mini-person.more { color: var(--text-secondary); }
.status-completed { background: #e9f6ef; color: #237346; }
.status-overdue { background: #fff0ef; color: #b13b31; }
.status-draft { background: #eef2f7; color: #6d7889; }
.table-action.danger { color: #a23731; }
.task-modal-dialog { width: min(860px, calc(100vw - 28px)); max-height: min(90vh, 920px); overflow: hidden; }
.task-modal-dialog .modal-body { overflow-y: auto; max-height: calc(90vh - 116px); }
.task-form-section { padding: 18px 0; border-bottom: 1px solid var(--border-light); }
.task-form-section:first-child { padding-top: 0; }
.task-form-section:last-of-type { border-bottom: 0; }
.task-form-section-title { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--brand-navy); margin-bottom: 12px; }
.task-form-section-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:18px; margin-bottom: 12px; }
.task-form-section-heading a { color: var(--brand-navy); font-size: 11px; font-weight: 700; white-space: nowrap; }
.schedule-extra { margin-top: 10px; }
.month-checkboxes { display: grid; grid-template-columns: repeat(6, minmax(70px, 1fr)); gap: 8px; }
.month-checkboxes label { display:flex; align-items:center; gap:6px; padding:8px 9px; border:1px solid var(--border); border-radius:7px; font-size:11px; color:var(--text-secondary); background:#fbfcfe; }
.month-checkboxes input { accent-color: var(--brand-navy); }
.person-picker-wrap { position: relative; }
.person-picker-results { position:absolute; top: calc(100% + 7px); left:0; right:0; max-height:300px; overflow:auto; background:#fff; border:1px solid var(--border); border-radius:10px; box-shadow:var(--shadow-md); z-index:300; padding:6px; }
.person-picker-item { width:100%; display:flex; align-items:center; gap:10px; text-align:left; padding:9px; background:transparent; border-radius:8px; cursor:pointer; color:var(--text); }
.person-picker-item:hover { background:var(--bg); }
.person-picker-item strong { display:block; font-size:12px; }
.person-picker-item small { display:block; color:var(--text-muted); font-size:10px; margin-top:2px; }
.person-picker-empty { padding:12px; color:var(--text-muted); font-size:11px; }
.selected-people-list { display:flex; flex-direction:column; gap:7px; margin: 8px 0 10px; }
.selected-person-row { display:grid; grid-template-columns: 1fr auto auto; gap:10px; align-items:center; padding:8px 10px; background:#f8fafc; border:1px solid var(--border-light); border-radius:9px; }
.person-role-select { min-width:175px; height:34px; padding:0 9px; border:1px solid var(--border); border-radius:7px; background:#fff; color:var(--text); font-size:11px; }
.form-check { display:flex; align-items:flex-start; gap:10px; margin-bottom:11px; padding:10px 0; cursor:pointer; }
.form-check input { margin-top:2px; accent-color:var(--brand-navy); }
.form-check span { display:flex; flex-direction:column; gap:3px; }
.form-check strong { font-size:12px; color:var(--text); }
.form-check small { font-size:10px; color:var(--text-muted); line-height:1.45; }

@media (max-width: 900px) {
    .month-checkboxes { grid-template-columns: repeat(4, minmax(70px, 1fr)); }
    .selected-person-row { grid-template-columns: 1fr; }
    .person-role-select { width:100%; }
}

@media (max-width: 720px) {
    .task-name-cell { min-width: 210px; }
    .task-modal-dialog .modal-body { max-height: calc(100vh - 120px); }
    .month-checkboxes { grid-template-columns: repeat(3, minmax(70px, 1fr)); }
}


/* =========================================================
   TASK FORM — POLISHED MODAL OVERRIDES
   ========================================================= */
.task-modal-dialog {
    width: min(920px, calc(100vw - 32px));
    max-height: min(88vh, 900px);
    overflow: hidden;
    border-radius: 16px;
}

.task-modal-dialog .modal-header {
    padding: 22px 26px 18px;
    background: #ffffff;
}

.task-modal-dialog .modal-header h2 {
    margin: 2px 0 0;
    font-size: 20px;
    line-height: 1.25;
}

.task-modal-dialog .modal-header p {
    max-width: 640px;
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.55;
}

.task-modal-dialog .modal-body {
    display: block;
    padding: 0 26px 88px;
    overflow-y: auto;
    max-height: calc(88vh - 92px);
}

.task-form-section {
    padding: 22px 0;
    border-bottom: 1px solid var(--border-light);
}

.task-form-section:first-child {
    padding-top: 22px;
}

.task-form-section:last-of-type {
    border-bottom: 0;
}

.task-form-section-title {
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: none;
    color: var(--text);
}

.task-form-section > .task-form-section-title::after {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    margin-top: 7px;
    border-radius: 99px;
    background: var(--brand-gold);
}

.task-form-section-heading {
    margin-bottom: 16px;
}

.task-form-section-heading .field-hint {
    margin-top: 6px;
}

.form-field {
    margin-bottom: 16px;
}

.form-field:last-child {
    margin-bottom: 0;
}

.form-field label {
    margin-bottom: 7px;
    font-size: 10px;
    color: var(--text-secondary);
}

.form-field input,
.form-field select,
.form-field textarea {
    min-height: 40px;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
}

.form-field textarea {
    min-height: 92px;
}

.form-row {
    gap: 16px;
}

.task-form .field-hint {
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.55;
}

.person-picker-wrap {
    position: relative;
}

.person-picker-wrap input {
    padding-left: 36px;
}

.person-picker-wrap::before {
    content: '⌕';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #91a0b3;
    font-size: 16px;
    z-index: 2;
    pointer-events: none;
}

.person-picker-results {
    top: calc(100% + 6px);
    padding: 6px;
    border-radius: 10px;
}

.person-picker-item {
    padding: 10px;
}

.selected-people-list {
    margin: 12px 0;
    gap: 8px;
}

.selected-person-row {
    grid-template-columns: minmax(0, 1fr) 190px auto;
    padding: 10px 12px;
    background: #fafbfd;
    border: 1px solid var(--border);
}

.person-role-select {
    min-width: 0;
    height: 38px;
}

.schedule-extra {
    margin-top: 14px;
}

.month-checkboxes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.month-checkboxes label {
    min-height: 38px;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}

.form-check {
    margin-bottom: 0;
    padding: 13px 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fafbfd;
}

.form-check + .form-check {
    margin-top: 9px;
}

.form-check strong {
    font-size: 11px;
}

.form-check small {
    font-size: 10px;
}

.task-form > .notice {
    margin-top: 18px;
}

.task-form .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 4;
    margin: 20px -26px -88px;
    padding: 14px 26px;
    background: rgba(255,255,255,.97);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 18px rgba(17,32,55,.04);
}

.task-form .form-actions button {
    min-width: 102px;
    min-height: 38px;
}

@media (max-width: 760px) {
    .task-modal-dialog {
        width: min(100%, calc(100vw - 20px));
        max-height: calc(100vh - 20px);
        border-radius: 14px;
    }

    .task-modal-dialog .modal-header {
        padding: 18px 18px 15px;
    }

    .task-modal-dialog .modal-body {
        padding: 0 18px 78px;
        max-height: calc(100vh - 80px);
    }

    .form-row,
    .selected-person-row {
        grid-template-columns: 1fr;
    }

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

    .task-form .form-actions {
        margin-left: -18px;
        margin-right: -18px;
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* Hidden attribute must always win over component display rules. */
.schedule-extra[hidden], .modal[hidden], .person-picker-results[hidden], .notice[hidden] { display: none !important; }


/* =========================================================
   TASK FORM V3 — clearer scheduling + sticky footer
   ========================================================= */
body.modal-open { overflow: hidden; }
.task-modal-dialog { width: min(980px, calc(100vw - 32px)); height: min(92vh, 920px); max-height: 92vh; overflow: hidden; }
.task-modal-dialog .modal-header { flex: 0 0 auto; }
.task-form { display:flex; flex-direction:column; min-height:0; height:calc(100% - 0px); }
.task-modal-scroll { flex:1 1 auto; min-height:0; overflow-y:auto; padding:0 26px 8px; }
.task-form .form-actions { position:relative; bottom:auto; margin:0; padding:14px 26px; flex:0 0 auto; background:#fff; border-top:1px solid var(--border); box-shadow:0 -8px 20px rgba(17,32,55,.05); }
.task-form-section { padding:22px 0; }
.task-form-section-title { font-size:14px; font-weight:800; }
.form-field .optional { font-weight:500; color:var(--text-muted); }
.section-description { color:var(--text-muted); font-size:10px; line-height:1.55; margin-bottom:12px; }
.schedule-extra[hidden], .modal[hidden], .person-picker-results[hidden], .notice[hidden] { display:none !important; }
.schedule-summary { margin-top:6px; padding:11px 12px; border:1px solid var(--border-light); border-radius:9px; background:#f8fafc; color:var(--text-secondary); font-size:10px; line-height:1.5; }
.selected-month-help { margin-bottom:10px; color:var(--text-muted); font-size:10px; line-height:1.5; }
.selected-month-rows { display:flex; flex-direction:column; gap:8px; }
.selected-month-row { display:grid; grid-template-columns:minmax(0,1fr) 150px auto; gap:10px; align-items:center; }
.selected-month-row .filter-select, .selected-month-row .month-day-input { min-height:38px; }
.month-day-input { width:100%; border:1px solid var(--border); border-radius:8px; background:#fff; color:var(--text); padding:10px 12px; font-size:11px; }
.add-month-button { margin-top:10px; min-height:36px; padding:0 12px; border:1px dashed #bac6d7; border-radius:8px; background:#fff; color:var(--brand-navy); font-size:11px; font-weight:700; cursor:pointer; }
.add-month-button:hover { background:#f8fafc; }
.add-month-button:disabled { opacity:.45; cursor:not-allowed; }
.reminder-options { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.reminder-option { display:flex; align-items:flex-start; gap:10px; padding:12px; min-height:82px; border:1px solid var(--border); border-radius:9px; background:#fafbfd; cursor:pointer; }
.reminder-option:hover { border-color:#cdd7e4; background:#fff; }
.reminder-option input { margin-top:3px; accent-color:var(--brand-navy); }
.reminder-option span { display:flex; flex-direction:column; gap:4px; }
.reminder-option strong { font-size:11px; color:var(--text); }
.reminder-option small { font-size:9px; line-height:1.45; color:var(--text-muted); }
.reminder-note { margin-top:10px; }

@media (max-width:760px) {
  .task-modal-dialog { width:calc(100vw - 18px); height:calc(100vh - 18px); max-height:calc(100vh - 18px); }
  .task-modal-scroll { padding:0 18px 4px; }
  .task-form .form-actions { padding:12px 18px; }
  .selected-month-row { grid-template-columns:1fr 110px auto; gap:6px; }
  .reminder-options { grid-template-columns:1fr; }
}

/* ===== Tasks v4 polish ===== */
.task-stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:22px}
.tasks-page-head{margin-bottom:18px}.task-toolbar{display:flex;justify-content:space-between;align-items:center;gap:14px;padding:14px;border-bottom:1px solid var(--border-light);background:#fff}.task-search-wrap{position:relative;flex:1;max-width:560px}.task-search-wrap>span{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:#94a3b8}.task-search-wrap input{width:100%;height:40px;padding:0 13px 0 34px;border:1px solid var(--border);border-radius:9px;background:#f8fafc;outline:none;font-size:12px}.task-search-wrap input:focus{background:#fff;border-color:#c6d1df;box-shadow:0 0 0 3px rgba(23,58,112,.06)}.task-filter-group{display:flex;gap:8px}.task-table th{font-size:10px;letter-spacing:.08em;text-transform:uppercase}.task-table td{vertical-align:middle;padding:16px 14px}.task-title-cell{font-size:13px;font-weight:700;color:var(--text);line-height:1.35}.task-type-dot{width:34px;height:34px;border-radius:10px;display:flex;align-items:center;justify-content:center;background:var(--brand-gold-soft);color:var(--brand-navy);font-weight:800}.mini-person{display:flex;flex-direction:column;gap:2px;margin-bottom:5px}.mini-person b{font-size:11px}.mini-person small{font-size:9px;color:var(--text-muted)}.mini-person.more{display:inline-flex;flex-direction:row;background:#f4f6f9;padding:4px 6px;border-radius:6px}.schedule-cell{display:flex;flex-direction:column;gap:3px}.schedule-cell b{font-size:11px}.schedule-cell small{font-size:9px;color:var(--text-muted)}.due-cell{font-size:11px}.empty-table{text-align:center;padding:50px!important;color:var(--text-muted)}

.task-modal-dialog{width:min(980px,calc(100vw - 30px));height:min(90vh,900px);max-height:90vh;display:flex;flex-direction:column;overflow:hidden;border-radius:16px}.task-modal-header{flex:0 0 auto;padding:28px 30px}.task-modal-header h2{font-size:27px;margin:5px 0 0}.task-modal-header p{font-size:12px;max-width:700px;margin-top:8px;line-height:1.5}.task-form{display:flex;flex:1 1 auto;min-height:0;flex-direction:column}.task-modal-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;padding:6px 30px 26px;scrollbar-gutter:stable}.task-form-section{padding:26px 0;border-bottom:1px solid var(--border-light)}.task-form-section:last-of-type{border-bottom:0}.task-section-heading{display:flex;justify-content:space-between;gap:16px;margin-bottom:16px}.task-form-section-title{font-size:16px;letter-spacing:0;text-transform:none;margin-bottom:4px}.task-section-sub{font-size:11px;color:var(--text-muted);line-height:1.5}.task-section-heading>a{font-size:11px;color:var(--brand-navy);font-weight:700}.person-add-row{display:flex;gap:10px;align-items:center}.person-picker-wrap{position:relative;flex:1}.person-picker-wrap input{width:100%;height:42px;padding:0 12px 0 36px;border:1px solid var(--border);border-radius:9px;font-size:12px}.picker-icon{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:#94a3b8;z-index:1}.compact-button{height:42px;padding:0 14px}.person-picker-results{position:absolute;left:0;right:0;top:calc(100% + 7px);z-index:20;background:#fff;border:1px solid var(--border);border-radius:10px;padding:6px;box-shadow:var(--shadow-md);max-height:310px;overflow:auto}.person-picker-results button{display:flex;width:100%;align-items:center;gap:10px;text-align:left;background:#fff;border:0;padding:10px;border-radius:7px;cursor:pointer}.person-picker-results button:hover{background:#f5f7fa}.picker-avatar{width:30px;height:30px;border-radius:8px;display:flex;align-items:center;justify-content:center;background:var(--brand-gold-soft);color:var(--brand-navy);font-size:11px;font-weight:800}.person-picker-results button span:last-child{display:flex;flex-direction:column;gap:3px}.person-picker-results button b{font-size:11px}.person-picker-results button small{font-size:9px;color:var(--text-muted)}.picker-empty{padding:10px;color:var(--text-muted);font-size:11px}.picker-add{color:var(--brand-navy)!important;font-weight:700!important}.selected-people-list{display:flex;flex-direction:column;gap:8px;margin-top:12px}.selected-empty{padding:13px 14px;border:1px dashed var(--border);border-radius:9px;background:#fbfcfe;color:var(--text-muted);font-size:11px}.selected-person{display:grid;grid-template-columns:34px 1fr 210px 34px;gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:#fbfcfe}.selected-avatar{width:34px;height:34px;border-radius:9px;background:var(--brand-navy);color:#fff;display:flex;align-items:center;justify-content:center;font-size:11px;font-weight:800}.selected-person-main{display:flex;flex-direction:column;gap:3px}.selected-person-main b{font-size:11px}.selected-person-main small{font-size:9px;color:var(--text-muted)}.selected-person select{height:36px;border:1px solid var(--border);border-radius:8px;background:#fff;padding:0 9px;font-size:10px}.remove-person{width:30px;height:30px;border-radius:7px;background:#fff;border:1px solid var(--border);color:#7b8798;cursor:pointer}.remove-person:hover{color:#b42318;border-color:#f1b8b3}.schedule-cards{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin:16px 0 18px}.schedule-type-card{position:relative;display:block}.schedule-type-card input{position:absolute;opacity:0;pointer-events:none}.schedule-type-card span{display:flex;flex-direction:column;gap:4px;padding:13px;border:1px solid var(--border);border-radius:10px;background:#fff;cursor:pointer;height:100%}.schedule-type-card strong{font-size:11px;color:var(--text)}.schedule-type-card small{font-size:9px;color:var(--text-muted);line-height:1.35}.schedule-type-card input:checked+span{border-color:var(--brand-navy);box-shadow:0 0 0 2px rgba(23,58,112,.08);background:#f8fbff}.schedule-extra[hidden]{display:none!important}.schedule-state-box .schedule-summary{min-height:42px;display:flex;align-items:center;padding:0 12px;border:1px solid var(--border);border-radius:9px;background:#f8fafc;font-size:11px;color:var(--text-secondary)}.inline-info{padding:10px 12px;background:#f8fafc;border:1px solid var(--border-light);border-radius:8px;color:var(--text-secondary);font-size:10px;margin-bottom:12px}.selected-month-rows{display:flex;flex-direction:column;gap:8px;margin-bottom:10px}.selected-month-row{display:grid;grid-template-columns:1fr 160px auto;gap:10px;align-items:end;padding:10px 12px;border:1px solid var(--border);border-radius:9px;background:#fbfcfe}.selected-month-row .form-field{margin-bottom:0}.selected-month-row label{font-size:9px}.selected-month-row .table-action{height:36px}.reminder-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:14px}.reminder-option{display:flex;gap:10px;align-items:flex-start;border:1px solid var(--border);border-radius:10px;padding:14px;background:#fff;cursor:pointer}.reminder-option.selected{border-color:#c8d5e6;background:#f8fbff}.reminder-option input{margin-top:3px}.reminder-option span{display:flex;flex-direction:column;gap:4px}.reminder-option strong{font-size:11px}.reminder-option small{font-size:9px;color:var(--text-muted);line-height:1.4}.reminder-note{margin-top:10px}.automation-row{display:flex;gap:10px;padding:13px 14px;border:1px solid var(--border);border-radius:9px;margin-top:9px;background:#fbfcfe}.automation-row input{margin-top:2px}.automation-row span{display:flex;flex-direction:column;gap:3px}.automation-row strong{font-size:11px}.automation-row small{font-size:9px;color:var(--text-muted)}.form-actions{flex:0 0 auto;display:flex;justify-content:flex-end;gap:9px;padding:15px 30px;background:#fff;border-top:1px solid var(--border);box-shadow:0 -8px 18px rgba(17,32,55,.05)}.form-actions button{min-width:118px;height:40px}.mini-modal[hidden]{display:none}.mini-modal{position:fixed;inset:0;z-index:500;display:flex;align-items:center;justify-content:center;padding:20px}.mini-modal-backdrop{position:absolute;inset:0;background:rgba(16,45,89,.25);backdrop-filter:blur(2px)}.mini-modal-dialog{position:relative;width:min(520px,calc(100vw - 30px));background:#fff;border:1px solid var(--border);border-radius:14px;box-shadow:0 24px 70px rgba(16,45,89,.2);overflow:hidden}.mini-modal-head{display:flex;justify-content:space-between;gap:18px;padding:22px;border-bottom:1px solid var(--border-light)}.mini-modal-head h3{font-size:18px;margin:4px 0}.mini-modal-head p{font-size:10px;color:var(--text-muted);margin:0}.mini-modal-body{padding:22px}.mini-modal-actions{display:flex;justify-content:flex-end;gap:8px;padding:14px 22px;border-top:1px solid var(--border-light)}
@media (max-width:900px){.task-stat-grid{grid-template-columns:repeat(2,1fr)}.schedule-cards{grid-template-columns:repeat(2,1fr)}.reminder-grid{grid-template-columns:1fr}.selected-person{grid-template-columns:34px 1fr 34px}.selected-person select{grid-column:2}.remove-person{grid-column:3;grid-row:1}.task-modal-header{padding:22px}.task-modal-scroll{padding:4px 22px 20px}.form-actions{padding:12px 22px}.task-filter-group{flex-wrap:wrap}.task-toolbar{flex-direction:column;align-items:stretch}.task-search-wrap{max-width:none}}
@media (max-width:620px){.task-stat-grid{grid-template-columns:1fr}.schedule-cards{grid-template-columns:1fr}.form-row{grid-template-columns:1fr}.person-add-row{flex-direction:column;align-items:stretch}.selected-month-row{grid-template-columns:1fr 1fr}.selected-month-row .table-action{grid-column:2;justify-self:end}.task-modal-dialog{width:calc(100vw - 12px);height:calc(100vh - 12px);max-height:calc(100vh - 12px)}.task-modal-header h2{font-size:22px}}
