﻿/* ---------- Invite dialog & acceptance page ---------- */

.invite-field-group { margin-bottom: 10px; }

.invite-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 4px;
}

.invite-input {
    width: 100%;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-size: 13px;
    color: #1f2f46;
    background: #fff;
    box-sizing: border-box;
}
.invite-input:focus { outline: none; border-color: #2d72f7; box-shadow: 0 0 0 2px rgba(45,114,247,.12); }

.invite-hint { margin: 12px 0 0; font-size: 12px; color: #64748b; line-height: 1.5; }

.invite-link-box { display: flex; gap: 8px; align-items: center; }

.invite-link-input {
    flex: 1;
    height: 34px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-size: 12px;
    color: #334155;
    background: #f8fafc;
    font-family: monospace;
}

.invite-copy-btn {
    flex-shrink: 0;
    height: 34px;
    padding: 0 14px;
    border: 1px solid #2d72f7;
    border-radius: 5px;
    background: #2d72f7;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.invite-copy-btn:hover { background: #1a5fd6; }

.invite-send-btn {
    flex-shrink: 0;
    height: 34px;
    padding: 0 14px;
    border: 1px solid #16a34a;
    border-radius: 5px;
    background: #16a34a;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.invite-send-btn:hover { background: #15803d; }

.invite-copied-note { margin-top: 6px; font-size: 12px; color: #16a34a; }

/* Acceptance page */
#inviteBlock { justify-content: center; align-items: center; min-height: 100vh; background: #f1f5f9; }

.auth-input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-size: 14px;
    color: #1f2f46;
    box-sizing: border-box;
    margin-bottom: 10px;
}
.auth-input:focus { outline: none; border-color: #2d72f7; box-shadow: 0 0 0 2px rgba(45,114,247,.12); }
.auth-input[readonly] { background: #f8fafc; color: #64748b; }

/* ---------- Delete confirmation overlay ---------- */

.emp-del-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
    animation: empDelFadeIn 0.15s ease;
}

@keyframes empDelFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.emp-del-box {
    background: #fff;
    border-radius: 12px;
    padding: 32px 28px 24px;
    width: 360px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.2);
    text-align: center;
    animation: empDelSlideIn 0.18s ease;
}

@keyframes empDelSlideIn {
    from { transform: translateY(-12px); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

.emp-del-icon {
    font-size: 38px;
    color: #f59e0b;
    margin-bottom: 12px;
    line-height: 1;
}

.emp-del-title {
    font-size: 17px;
    font-weight: 700;
    color: #1f2f46;
    margin-bottom: 8px;
}

.emp-del-text {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 24px;
}

.emp-del-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.emp-del-cancel {
    flex: 1;
    height: 38px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #1f2f46;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.emp-del-cancel:hover { background: #f1f5f9; }

.emp-del-confirm {
    flex: 1;
    height: 38px;
    border: none;
    border-radius: 6px;
    background: #ef4444;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.emp-del-confirm:hover { background: #dc2626; }
.emp-del-confirm:disabled { background: #fca5a5; cursor: not-allowed; }

/* ---------- end invite ---------- */

.employee-form{
    display:grid;
    gap:16px;
}

.employee-form label{
    font-size:18px;
}

.employee-form input,
.employee-form select,
.employee-form textarea{
    font-size:18px;
}

.employee-form-section{
    border:1px solid #e4ebf5;
    border-radius:16px;
    padding:16px;
    background:linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
}

.employee-form-section-title{
    margin-bottom:14px;
    color:#0f172a;
    font-size:19.2px;
    font-weight:700;
}

.employee-form-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:14px;
}

.employee-form-wide{
    grid-column:1 / -1;
}

.employee-form-hint{
    margin-top:8px;
    color:#667085;
    font-size:15.6px;
    line-height:1.4;
}

.employee-optional-label{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}

.employee-optional-tag{
    color:#98a2b3;
    font-size:14.4px;
    font-weight:600;
}

.employee-required-tag{
    color:#b42318;
    font-size:14.4px;
    font-weight:700;
}

.employee-optional-toggle{
    display:inline-flex;
    align-items:center;
    gap:8px;
    margin:0 0 8px;
    color:#475467;
    font-size:15.6px;
    font-weight:600;
}

.employee-optional-toggle input{
    width:auto;
    margin:0;
}

.employee-inline-label{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.employee-multiselect{
    position:relative;
}

.employee-multiselect.disabled{
    opacity:.58;
}

.employee-multiselect-trigger{
    width:100%;
    min-height:48px;
    padding:12px 14px;
    border:1px solid #d9e2f1;
    border-radius:10px;
    background:#fff;
    color:#344054;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    text-align:left;
    font-size:18px;
}

.employee-multiselect-trigger:disabled{
    background:#f6f8fb;
    color:#98a2b3;
    border-color:#e3e8f0;
    cursor:not-allowed;
}

.employee-multiselect-text{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.employee-multiselect-caret{
    color:#667085;
    flex-shrink:0;
}

.employee-multiselect-dropdown{
    position:absolute;
    top:calc(100% + 8px);
    left:0;
    right:0;
    z-index:20;
    display:none;
    border:1px solid #d9e2f1;
    border-radius:14px;
    background:#fff;
    box-shadow:0 20px 48px rgba(15,23,42,0.14);
    overflow:hidden;
}

.employee-multiselect-dropdown.show{
    display:block;
}

.employee-multiselect-options{
    display:grid;
    gap:10px;
    max-height:280px;
    overflow:auto;
    padding:12px;
}

.employee-multiselect-footer{
    display:flex;
    justify-content:flex-end;
    padding:10px 12px 12px;
    border-top:1px solid #edf2f7;
    background:#fafcff;
}

.employee-option-btn{
    width:100%;
    padding:10px 12px;
    border:1px solid #d9e2f1;
    border-radius:10px;
    background:#fff;
    color:#344054;
    text-align:left;
    font-size:16.8px;
}

.employee-option-btn:hover{
    background:#f8fbff;
}

.employee-option-btn.active{
    border-color:#bcd0ff;
    background:#eef4ff;
    color:#1d4ed8;
}

.employee-link-action{
    padding:3px 7px;
    border:none;
    border-radius:8px;
    background:transparent;
    color:#1d4ed8;
    font-size:15.6px;
    font-weight:600;
}

.employee-link-action:hover{
    background:#e8f0ff;
    color:#174ea6;
    text-decoration:underline;
}

.employee-label-with-hint{
    display:flex;
    align-items:center;
    gap:8px;
}

.employee-label-hint{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:18px;
    height:18px;
    border-radius:50%;
    background:#e8eefb;
    color:#3659a8;
    font-size:14.4px;
    font-weight:700;
    cursor:help;
    flex-shrink:0;
}

.employee-toggle-field{
    margin-bottom:12px;
}

.employee-schedule-hidden{
    display:none;
}

.employee-schedule-editor{
    display:grid;
    gap:10px;
}

.employee-schedule-day{
    display:grid;
    grid-template-columns:72px minmax(0, 1fr);
    gap:12px;
    align-items:start;
    padding:10px 12px;
    border:1px solid #d9e2f1;
    border-radius:10px;
    background:#fff;
}

.employee-schedule-day-toggle{
    display:flex;
    align-items:center;
    gap:8px;
    margin:0;
    min-height:34px;
}

.employee-schedule-day-toggle input{
    width:auto;
    margin:0;
}

.employee-schedule-slots{
    display:grid;
    gap:8px;
}

.employee-schedule-slot{
    display:grid;
    grid-template-columns:minmax(0, 1fr) auto minmax(0, 1fr) auto;
    gap:8px;
    align-items:center;
}

.employee-schedule-slot span{
    color:#667085;
    font-size:15.6px;
    font-weight:600;
}

.employee-schedule-slot .employee-link-action:disabled{
    color:#98a2b3;
    cursor:not-allowed;
    text-decoration:none;
}

.employee-schedule-add-slot{
    justify-self:start;
}

.employee-check-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
    gap:10px;
}

.employee-check-item{
    display:flex;
    align-items:center;
    gap:10px;
    min-height:44px;
    padding:10px 12px;
    border:1px solid #d9e2f1;
    border-radius:12px;
    background:#fff;
    margin:0;
    font-size:16.8px;
    font-weight:600;
    color:#344054;
}

.employee-check-item input{
    width:auto;
    margin:0;
}

.employee-check-item.disabled{
    background:#f7f8fb;
    color:#98a2b3;
    border-color:#e5e7eb;
}

.employee-summary-grid{
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:12px;
    margin-bottom:16px;
}

.employee-summary-card{
    display:grid;
    gap:4px;
    padding:14px 16px;
    border:1px solid #d9e2f1;
    border-radius:14px;
    background:#fff;
}

.employee-summary-card strong{
    color:#111827;
    font-size:22px;
}

.employee-summary-card span{
    color:#667085;
    font-size:13px;
}

.employee-toolbar-spacer{
    flex:1 1 auto;
    min-width:16px;
}

.employee-columns-wrap{
    position:relative;
    margin-left:auto;
}

.employee-columns-toggle{
    height:29px;
    min-width:56px;
    padding:0 8px;
    border:1px solid #cfd6df;
    border-radius:3px;
    background:#fff;
    color:#1f2937;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    font-size:14px;
    line-height:1;
}

.employee-columns-toggle:hover,
.employee-columns-toggle.active{
    background:#f5f7fa;
    color:#1f2937;
}

.employee-columns-toggle.active{
    border-color:#9dbbeb;
    box-shadow:0 0 0 2px rgba(45,114,247,0.12);
}

.employee-columns-caret{
    color:#6b7280;
    font-size:11px;
}

.employee-columns-panel{
    position:absolute;
    top:calc(100% + 4px);
    right:0;
    z-index:30;
    display:none;
    width:205px;
    max-height:448px;
    overflow:auto;
    padding:8px 10px;
    border:1px solid #e5e7eb;
    border-radius:7px;
    background:#fff;
    box-shadow:0 4px 16px rgba(15,23,42,0.12);
}

.employee-columns-panel.show{
    display:grid;
    gap:4px;
}

.employee-column-check{
    display:flex;
    align-items:flex-start;
    gap:7px;
    margin:0;
    color:#374151;
    font-size:12px;
    font-weight:400;
    line-height:1.18;
}

.employee-column-check input{
    width:13px;
    height:13px;
    margin:0;
    accent-color:#1677ff;
    flex-shrink:0;
}

.employee-list-table-wrap{
    overflow-x:auto;
    overflow-y:visible;
    border-top:1px solid #e5e7eb;
    border-radius:0;
}

.employee-list-table{
    table-layout:fixed;
}

.employee-list-table th,
.employee-list-table td{
    height:33px;
    min-height:33px;
    max-height:33px;
    padding:0 8px;
    border-right:1px solid #e1e6ed;
    border-bottom:1px solid #eef1f5;
    color:#111827;
    font-size:12px;
    font-weight:400;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.employee-list-table th{
    background:#eef0f2;
    color:#111827;
}

.employee-list-table .employee-list-main-head{
    background:#c8cbce;
}

.employee-table-sort{
    float:right;
    color:#8a94a3;
    font-size:11px;
    line-height:1;
}

.employee-list-table .employee-table-person{
    gap:7px;
}

.employee-list-table .employee-avatar-thumb{
    width:24px;
    height:24px;
    font-size:11px;
}

.employee-list-table .employee-table-name{
    font-size:12px;
    font-weight:400;
}

.employee-list-table .employee-table-sub{
    display:none;
}

.employee-list-footer{
    padding:12px 6px 16px;
    color:#111827;
    font-size:12px;
}

.employee-actions-cell{
    text-align:right;
    white-space:nowrap;
}

.employee-row-action{
    min-height:32px;
    padding:6px 10px;
    border-radius:8px;
    font-size:13px;
}

.employee-empty-state{
    padding:20px 8px;
    color:#667085;
    font-size:14px;
}

.employee-table-person{
    display:flex;
    align-items:center;
    gap:12px;
}

.employee-clickable-row{
    cursor:pointer;
    transition:background-color .18s ease;
}

.employee-clickable-row:hover{
    background:#f8fbff;
}

.employee-avatar-thumb{
    width:38px;
    height:38px;
    border-radius:50%;
    background:linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color:#1d4ed8;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:15px;
    font-weight:700;
    flex-shrink:0;
}

.employee-avatar-photo{
    object-fit:cover;
}

.employee-table-name{
    color:#111827;
    font-size:14px;
    font-weight:700;
}

.employee-table-sub{
    margin-top:3px;
    color:#667085;
    font-size:12px;
    line-height:1.35;
}

.employee-status-badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:28px;
    padding:4px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
    white-space:nowrap;
}

.employee-status-badge.active{
    background:#dcfce7;
    color:#166534;
}

.employee-status-badge.vacation{
    background:#fef3c7;
    color:#92400e;
}

.employee-status-badge.fired{
    background:#fee2e2;
    color:#991b1b;
}

.employee-history-card{
    margin-top:16px;
    border:1px dashed #d7dfef;
    border-radius:14px;
    background:#fcfdff;
    padding:14px;
}

.employee-history-head{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:flex-start;
    margin-bottom:12px;
}

.employee-history-head span{
    color:#667085;
    font-size:13px;
    line-height:1.4;
}

.employee-history-list{
    display:grid;
    gap:10px;
}

.employee-history-item{
    display:flex;
    justify-content:space-between;
    gap:12px;
    align-items:center;
    padding:12px;
    border:1px solid #e7edf6;
    border-radius:12px;
    background:#fff;
}

.employee-history-item strong{
    display:block;
    margin-bottom:4px;
    color:#111827;
}

.employee-history-item div{
    color:#667085;
    font-size:13px;
}

.employee-history-meta{
    display:flex;
    align-items:center;
    gap:8px;
    flex-shrink:0;
}

.employee-directory-card{
    margin-top:16px;
    display:grid;
    gap:12px;
}

.employee-modal{
    max-width:920px;
}

.employee-modal .crm-modal-head{
    padding:12px 16px 8px;
}

.employee-modal .crm-modal-title{
    font-size:22.8px;
}

.employee-modal .crm-modal-body{
    padding:8px 16px;
}

.employee-modal .crm-modal-footer{
    padding:10px 16px 12px;
}

.employee-modal .employee-form{
    gap:6px;
}

.employee-modal .employee-form-section{
    border-radius:12px;
    padding:8px 12px;
    background:#fbfdff;
}

.employee-modal .employee-form-section-title{
    margin-bottom:6px;
    font-size:16.8px;
}

.employee-modal .employee-form-grid{
    gap:6px 10px;
}

.employee-modal .field{
    margin-bottom:3px;
}

.employee-modal label{
    margin-bottom:3px;
    font-size:14.4px;
    font-weight:700;
}

.employee-modal input,
.employee-modal select,
.employee-modal textarea{
    min-height:34px;
    padding:7px 10px;
    font-size:15.6px;
    border-radius:8px;
}

.employee-modal textarea{
    min-height:50px;
}

.employee-modal .employee-form-hint{
    margin-top:3px;
    font-size:13.2px;
    line-height:1.25;
}

.employee-modal .employee-optional-toggle{
    margin:0 0 4px;
    font-size:14.4px;
}

.employee-modal .employee-multiselect-trigger{
    min-height:34px;
    padding:7px 10px;
    font-size:15.6px;
    border-radius:8px;
}

.employee-modal .employee-multiselect.disabled{
    opacity:1;
}

.employee-modal .employee-multiselect.disabled .employee-multiselect-trigger:disabled{
    background:#eef4ff;
    color:#475467;
    border-color:#c5d6f1;
    box-shadow:inset 0 0 0 1px rgba(59, 130, 246, 0.06);
}

.employee-modal .employee-multiselect-options{
    gap:8px;
    padding:10px;
}

.employee-modal .employee-option-btn{
    padding:7px 9px;
    font-size:16.8px;
}

.employee-modal .employee-main-info-section{
    margin-bottom:-2cm;
}

.employee-modal .employee-photo-row{
    display:flex;
    align-items:center;
    gap:10px;
}

.employee-modal .employee-photo-row label{
    margin:0;
    flex:0 0 auto;
}

.employee-modal .employee-photo-row input[type="file"]{
    width:auto;
    min-height:0;
    padding:0;
    border:none;
    background:transparent;
}

.employee-modal .employee-position-inline{
    display:flex;
    align-items:flex-start;
    gap:10px;
}

.employee-modal .employee-specialization-inline{
    display:flex;
    align-items:flex-start;
    gap:10px;
}

.employee-modal .employee-specialization-field{
    transform:translateY(-3.05cm);
    margin-bottom:-5.55cm;
}

.employee-modal .employee-position-toggle{
    flex:0 0 auto;
    margin:2px 0 0;
    min-height:34px;
}

.employee-modal .employee-specialization-toggle{
    flex:0 0 auto;
    margin:2px 0 0;
    min-height:34px;
}

.employee-modal .employee-position-control{
    flex:0 0 210px;
    max-width:210px;
    transform:translateY(-0.5cm);
}

.employee-modal .employee-specialization-inline .employee-multiselect{
    flex:0 0 260px;
    max-width:260px;
    transform:translateY(-0.5cm);
}

.employee-modal .employee-position-hint{
    transform:translateY(-2.5cm);
}

.employee-modal .employee-specialization-hint{
    transform:translateY(-2cm);
}

.employee-modal .employee-toggle-field{
    margin-bottom:6px;
}

.employee-modal .checkbox-field label{
    font-size:14.4px;
}

.employee-modal .employee-optional-tag,
.employee-modal .employee-required-tag,
.employee-modal .employee-label-hint{
    font-size:14.4px;
}

.employee-modal .employee-link-action{
    font-size:15.6px;
}

.employee-modal .employee-check-item{
    font-size:16.8px;
}

.employee-modal .crm-modal-footer button{
    font-size:16.8px;
}

@media (max-width: 720px){
    .employee-schedule-day{
        grid-template-columns:1fr;
    }

    .employee-schedule-slot{
        grid-template-columns:1fr auto 1fr;
    }

    .employee-schedule-slot .employee-link-action{
        grid-column:1 / -1;
        justify-self:start;
    }
}

.crm-modal-root.employee-drawer-root{
    padding:0;
    overflow:hidden;
}

.crm-modal-root.employee-drawer-root .employee-drawer-backdrop{
    position:fixed;
    background:rgba(15, 23, 42, 0.48);
    backdrop-filter:none;
}

.employee-form-drawer.crm-modal{
    position:fixed;
    top:0;
    right:0;
    left:auto;
    transform:none;
    width:min(664px, calc(100vw - 24px));
    height:100vh;
    max-height:100vh;
    border:0;
    border-left:1px solid #d9e2f1;
    border-radius:0;
    box-shadow:0 20px 46px rgba(15,23,42,0.22);
    background:#fff;
}

.employee-form-drawer .employee-drawer-head{
    min-height:80px;
    padding:0 46px 0 17px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    border-bottom:1px solid #e5e7eb;
}

.employee-form-drawer .crm-modal-title{
    color:#2f3844;
    font-size:24px;
    font-weight:400;
    line-height:1.2;
}

.employee-drawer-close{
    position:absolute;
    top:0;
    right:0;
    width:31px;
    height:80px;
    border:0;
    border-left:1px solid #e5e7eb;
    border-radius:0;
    background:#fff;
    color:#9aa3af;
    font-size:30px;
    font-weight:300;
    line-height:1;
}

.employee-drawer-close:hover{
    background:#f7f8fa;
    color:#4b5563;
}

.employee-drawer-tabs{
    height:53px;
    padding:0 17px;
    display:flex;
    align-items:flex-end;
    gap:26px;
    border-bottom:1px solid #e5e7eb;
    background:#fff;
    flex-shrink:0;
}

.employee-drawer-tabs button{
    height:39px;
    padding:0 12px;
    border:0;
    border-bottom:2px solid transparent;
    border-radius:0;
    background:transparent;
    color:#3f4752;
    font-size:14px;
    font-weight:400;
}

.employee-drawer-tabs button.active{
    border-bottom-color:#1f73ff;
    color:#1f73ff;
}

.employee-drawer-panel.hidden{
    display:none;
}

.employee-form-drawer .employee-drawer-body{
    flex:1 1 auto;
    min-height:0;
    padding:28px 30px 30px 17px;
    overflow:auto;
    color:#303844;
    white-space:normal;
}

.employee-form-drawer .employee-drawer-footer{
    position: relative;
    min-height:63px;
    padding:15px 17px;
    justify-content:flex-start;
    align-items:center;
    border-top:1px solid #dbeafe;
    background:#eff6ff;
    flex-shrink:0;
}

.employee-form-drawer .employee-drawer-footer .btn-secondary{
    display:none;
}

.employee-form-drawer .employee-drawer-footer .employee-delete-btn{
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.employee-form-drawer .employee-drawer-footer button[data-submit-employee]{
    min-height:34px;
    padding:7px 17px;
    border-radius:4px;
    background:#1677ff;
    color:#fff;
    font-size:14px;
    font-weight:500;
}

.employee-form-drawer .employee-form{
    gap:22px;
}

.employee-form-drawer .employee-drawer-panel[data-employee-drawer-panel="general"]{
    display:grid;
    gap:22px;
}

.employee-form-drawer .employee-drawer-panel.hidden{
    display:none;
}

.employee-form-drawer .employee-form-section{
    padding:0;
    border:0;
    border-radius:0;
    background:transparent;
    display:grid;
    grid-template-columns:205px minmax(0, 1fr);
    gap:30px;
    align-items:start;
}

.employee-form-drawer .employee-form-section-title{
    margin:1px 0 0;
    color:#303844;
    font-size:18px;
    font-weight:600;
    line-height:1.3;
}

.employee-form-drawer .employee-form-grid{
    display:grid;
    grid-template-columns:1fr;
    gap:15px;
}

.employee-form-drawer .field,
.employee-form-drawer .employee-toggle-field{
    margin:0;
}

.employee-form-drawer label,
.employee-form-drawer.employee-modal label{
    margin:0 0 6px;
    color:#303844;
    font-size:13px;
    font-weight:500;
}

.employee-form-drawer .employee-required-tag{
    color:#e11d48;
    font-size:13px;
    font-weight:500;
}

.employee-form-drawer .employee-optional-tag{
    color:#8b95a1;
    font-size:13px;
    font-weight:400;
}

.employee-form-drawer input,
.employee-form-drawer select,
.employee-form-drawer textarea,
.employee-form-drawer.employee-modal input,
.employee-form-drawer.employee-modal select,
.employee-form-drawer.employee-modal textarea,
.employee-form-drawer .employee-multiselect-trigger{
    min-height:34px;
    padding:6px 10px;
    border:1px solid #cfd6df;
    border-radius:3px;
    background:#fff;
    color:#303844;
    font-size:14px;
}

.employee-form-drawer textarea{
    min-height:72px;
}

.employee-form-drawer .employee-form-hint{
    margin-top:5px;
    color:#6b7280;
    font-size:12px;
    line-height:1.35;
}

.employee-form-drawer .employee-main-info-section{
    margin-bottom:0;
}

.employee-form-drawer .employee-photo-row,
.employee-form-drawer .employee-position-inline,
.employee-form-drawer .employee-specialization-inline{
    display:grid;
    gap:8px;
    align-items:start;
}

.employee-form-drawer .employee-specialization-field,
.employee-form-drawer .employee-position-control,
.employee-form-drawer .employee-specialization-inline .employee-multiselect,
.employee-form-drawer .employee-position-hint,
.employee-form-drawer .employee-specialization-hint{
    max-width:none;
    flex:auto;
    margin-bottom:0;
    transform:none;
}

.employee-form-drawer .employee-position-toggle,
.employee-form-drawer .employee-specialization-toggle{
    min-height:0;
    margin:0;
}

.employee-form-drawer .employee-check-grid{
    grid-template-columns:1fr;
}

.employee-form-drawer .employee-check-item{
    min-height:34px;
    padding:7px 9px;
    border-radius:4px;
    font-size:14px;
    font-weight:400;
}

.employee-form-drawer .employee-schedule-section{
    grid-template-columns:1fr;
    gap:12px;
}

.employee-form-drawer .employee-schedule-section .employee-form-section-title{
    margin:0;
}

.employee-form-drawer .employee-schedule-section .employee-toggle-field{
    display:flex;
    align-items:center;
    min-height:28px;
}

.employee-form-drawer .employee-schedule-section .employee-toggle-field label{
    display:inline-flex;
    align-items:center;
    gap:8px;
    margin:0;
}

.employee-form-drawer #employeeScheduleBlock{
    width:100%;
}

.employee-form-drawer .employee-schedule-editor{
    grid-template-columns:1fr;
    gap:8px;
}

.employee-form-drawer .employee-schedule-day{
    grid-template-columns:44px minmax(0, 1fr);
    gap:8px;
    padding:7px 8px;
    border-radius:4px;
    align-items:start;
}

.employee-form-drawer .employee-schedule-slot{
    grid-template-columns:minmax(0, 1fr) 20px minmax(0, 1fr) auto;
    gap:6px;
    min-height:30px;
}

.employee-form-drawer .employee-schedule-slot input{
    min-height:30px;
    padding:4px 7px;
}

.employee-form-drawer .employee-schedule-slot span{
    align-self:center;
    font-size:12px;
    text-align:center;
}

.employee-form-drawer .employee-schedule-slots{
    gap:5px;
}

.employee-form-drawer .employee-schedule-slot .employee-link-action{
    grid-column:auto;
    justify-self:end;
    align-self:center;
    padding:2px 5px;
    font-size:12px;
    line-height:1.2;
}

.employee-form-drawer .employee-schedule-add-slot{
    margin-top:0;
    padding:2px 5px;
    font-size:12px;
}

.employee-access-panel{
    color:#303844;
}

.employee-access-note{
    margin-bottom:18px;
    color:#303844;
    font-size:13px;
    line-height:1.45;
}

.employee-access-filter-title{
    margin-bottom:6px;
    color:#303844;
    font-size:13px;
    font-weight:700;
}

.employee-access-filter{
    display:inline-flex;
    margin-bottom:18px;
    border:1px solid #c9d1dc;
    border-radius:4px;
    overflow:hidden;
    background:#fff;
}

.employee-access-filter button{
    min-width:112px;
    height:33px;
    padding:0 14px;
    border:0;
    border-right:1px solid #c9d1dc;
    border-radius:0;
    background:#fff;
    color:#111827;
    font-size:13px;
    font-weight:400;
}

.employee-access-filter button:last-child{
    border-right:0;
}

.employee-access-filter button.active{
    background:#eef0f2;
    box-shadow:inset 0 1px 4px rgba(15,23,42,0.12);
}

.employee-access-location{
    display:flex;
    align-items:center;
    gap:8px;
    margin:0 0 10px;
    color:#3f4752;
}

.employee-access-location input,
.employee-access-check input{
    width:15px;
    height:15px;
    margin:0;
    accent-color:#1677ff;
}

.employee-access-location strong{
    font-size:18px;
    font-weight:700;
}

.employee-access-location-dot{
    color:#ef4444;
    font-size:18px;
    line-height:1;
}

.employee-access-table{
    min-width:0;
    border-top:1px solid #edf0f4;
    border-bottom:1px solid #edf0f4;
}

.employee-access-head,
.employee-access-row{
    display:grid;
    grid-template-columns:34px minmax(0, 1fr) minmax(210px, 1.3fr);
    align-items:center;
    min-width:0;
}

.employee-access-head{
    height:42px;
    background:#e9ebee;
    color:#111827;
    font-size:13px;
}

.employee-access-check{
    display:flex;
    align-items:center;
    justify-content:center;
}

.employee-access-row{
    min-height:52px;
    margin:0;
    border-top:1px solid #edf0f4;
    color:#4b5563;
    font-size:14px;
}

.employee-access-tree-row{
    position:relative;
    grid-template-columns:calc(34px + var(--tree-indent, 0px)) minmax(0, 1fr) minmax(210px, 1.3fr);
}

.employee-access-tree-root{
    background:#fbfcfe;
    font-weight:600;
}

.employee-access-tree-children.hidden{
    display:none;
}

.employee-access-tree-row:not(.employee-access-tree-root)::before{
    content:"";
    position:absolute;
    left:calc(17px + var(--tree-parent-indent, 0px));
    top:0;
    bottom:0;
    width:1px;
    background:#dbe3ee;
}

.employee-access-tree-row:not(.employee-access-tree-root)::after{
    content:"";
    position:absolute;
    left:calc(17px + var(--tree-parent-indent, 0px));
    top:50%;
    width:18px;
    height:1px;
    background:#dbe3ee;
}

.employee-access-tree-row .employee-access-check{
    justify-content:flex-end;
    padding-right:9px;
    position:relative;
    z-index:1;
}

.employee-access-tree-row .employee-access-object{
    position:relative;
    z-index:1;
}

.employee-access-tree-toggle{
    flex:0 0 18px;
    width:18px;
    height:24px;
    padding:0;
    border:0;
    border-radius:3px;
    background:transparent;
    color:#667085;
    font-size:16px;
    line-height:1;
}

.employee-access-tree-toggle:hover{
    background:#eef4ff;
    color:#1f73ff;
}

.employee-access-tree-toggle.empty{
    pointer-events:none;
}

.employee-access-folder-icon{
    width:18px;
    color:#64748b;
    font-size:13px;
    line-height:1;
    text-align:center;
    flex-shrink:0;
}

.employee-access-object{
    display:flex;
    align-items:center;
    gap:7px;
    min-width:0;
}

.employee-access-object > span:last-child{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
}

.employee-access-object-icon{
    width:18px;
    height:18px;
    border:1px solid #7b8794;
    border-radius:50%;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    color:#303844;
    font-size:11px;
    font-weight:700;
    line-height:1;
    flex-shrink:0;
}

.employee-access-permission{
    min-width:0;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    color:#4b5563;
    font-size:13px;
}

.employee-access-permission.allowed{
    color:#4b5563;
}

.employee-access-permission.allowed::first-letter{
    color:#07984a;
}

.employee-access-permission.blocked{
    color:#4b5563;
}

.employee-access-permission.partial{
    color:#b45309;
}

.employee-access-empty{
    padding:18px 12px;
    color:#667085;
    font-size:13px;
}

@media (max-width: 760px){
    .employee-form-drawer.crm-modal{
        width:100vw;
    }

    .employee-form-drawer .employee-form-section{
        grid-template-columns:1fr;
        gap:10px;
    }

    .employee-form-drawer .employee-schedule-editor{
        grid-template-columns:1fr;
    }
}


/* ── Payroll toggle + hint ── */
.crm-modal:has(.payroll-rule-form) {
    width: min(960px, calc(100vw - 32px));
}

.crm-modal:has(.payroll-rule-form) .crm-modal-body {
    white-space: normal;
}

.payroll-rule-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 18px;
}

.payroll-rule-form > label,
.payroll-rule-form > strong,
.payroll-rule-form > hr,
.payroll-rule-form > .payroll-toggle-row,
.payroll-rule-form > .payroll-rule-form-danger,
.payroll-rule-form > div[style*="display:flex"],
.payroll-rule-form > div[style*="font-size:12px"] {
    grid-column: 1 / -1;
}

.payroll-rule-form > input,
.payroll-rule-form > select,
.payroll-rule-form > .payroll-role-list,
.payroll-rule-form > #prFormulaWrap,
.payroll-rule-form > #prCondWrap {
    grid-column: 1 / -1;
}

.payroll-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.payroll-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.payroll-toggle input { display: none; }
.payroll-toggle-track {
    width: 36px;
    height: 20px;
    background: #ccc;
    border-radius: 10px;
    position: relative;
    transition: background .2s;
    flex-shrink: 0;
}
.payroll-toggle input:checked ~ .payroll-toggle-track { background: #27ae60; }
.payroll-toggle-track::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: left .2s;
}
.payroll-toggle input:checked ~ .payroll-toggle-track::after { left: 19px; }
.payroll-toggle-label { font-size: 14px; color: #333; min-width: 72px; }

.payroll-mode-options {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 0;
    width: min(360px, 100%);
    margin-top: 4px;
    border: 1px solid #cfd8e6;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.payroll-mode-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border-right: 1px solid #e2e8f0;
    color: #36445a;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
}

.payroll-mode-option:last-child {
    border-right: none;
}

.payroll-mode-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.payroll-mode-option:hover {
    background: #f6f9ff;
}

.payroll-mode-option.active {
    background: #eaf2ff;
    color: #1f6eea;
}

.payroll-hint {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #c7d0dc;
    background: #f5f7fb;
    color: #5b687a;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: default;
    flex-shrink: 0;
}

.payroll-hint::before {
    content: "?";
}

.payroll-hint > span:first-child {
    display: none;
}

.payroll-hint-popup {
    display: none;
    position: absolute;
    top: 50%;
    bottom: auto;
    left: calc(100% + 8px);
    right: auto;
    transform: translateY(-50%);
    width: max-content;
    min-width: 280px;
    max-width: min(420px, calc(100vw - 80px));
    background: #333;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    padding: 8px 10px;
    border-radius: 6px;
    white-space: normal;
    z-index: 9999;
    line-height: 1.4;
    pointer-events: none;
}
.payroll-hint:hover .payroll-hint-popup { display: block; }

.payroll-role-list {
    display: flex;
    flex-direction: column;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
}

.payroll-status-list {
    display: flex;
    flex-direction: column;
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
}

.payroll-status-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 10px;
    border-bottom: 1px solid #eef1f5;
    color: #1f2f46;
    font-size: 14px;
    line-height: 1.25;
    cursor: pointer;
}

.payroll-status-check:last-child {
    border-bottom: none;
}

.payroll-status-check:hover {
    background: #f6f9ff;
}

.payroll-status-check input {
    width: 14px;
    height: 14px;
    margin: 0;
    flex: 0 0 auto;
}

.payroll-status-check span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.payroll-role-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 10px;
    border-bottom: 1px solid #eef1f5;
    color: #1f2f46;
    font-size: 14px;
    line-height: 1.25;
    cursor: pointer;
}

.payroll-role-check:last-child {
    border-bottom: none;
}

.payroll-role-check:hover {
    background: #f6f9ff;
}

.payroll-role-check input {
    width: 14px;
    height: 14px;
    margin: 0;
    flex: 0 0 auto;
}

.payroll-role-check span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.payroll-field-note {
    margin-top: 2px;
    color: #7b8494;
    font-size: 12px;
    line-height: 1.4;
}

.payroll-field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.12) !important;
}

.payroll-rule-table-wrap {
    overflow-x: auto;
}

.payroll-rule-table {
    table-layout: fixed;
}

.payroll-rule-table th,
.payroll-rule-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.payroll-rule-resizable-head {
    position: relative;
    user-select: none;
}

.payroll-rule-column-resize {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 1;
}

.payroll-rule-column-resize:hover,
.payroll-rule-column-resize.is-resizing {
    background: #2f80ed55;
}

.payroll-rule-column-resizing,
.payroll-rule-column-resizing * {
    cursor: col-resize !important;
    user-select: none !important;
}

.payroll-rule-row {
    cursor: pointer;
}

.payroll-rule-row:hover {
    background: #f8fbff;
}

.payroll-rule-row.is-inactive {
    opacity: .58;
    background: #fafbfc;
}

.payroll-rule-row.is-inactive:hover {
    opacity: .72;
    background: #f3f6fa;
}

.payroll-rule-form-danger {
    display: flex;
    justify-content: flex-start;
    padding-top: 4px;
}

.payroll-rule-form-danger .btn-danger {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 6px;
}

@media (max-width: 760px) {
    .crm-modal:has(.payroll-rule-form) {
        width: calc(100vw - 20px);
    }

    .payroll-rule-form {
        grid-template-columns: 1fr;
    }
}
