/* ========== EMPLOYEES MODULE ========== */

.container {
    max-width: none !important;
    width: 100% !important;
}

.field-label.required::after {
    content: ' *';
    color: #c62828;
    font-weight: 700;
}

/* ========== HEADER BADGES ========== */
.registration-badge, .waiting-badge, .error-badge, .stats-badge {
    padding: 8px 18px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.15);
}
.registration-badge { background: #22c55e; color: white; }
.registration-badge:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(34,197,94,0.4); }
.waiting-badge { background: #f59e0b; color: white; }
.waiting-badge:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(245,158,11,0.4); }
.error-badge { background: #ef4444; color: white; }
.error-badge:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(239,68,68,0.4); }
.stats-badge {
    background: rgba(255,255,255,0.12);
    color: white;
    backdrop-filter: blur(8px);
}

/* ========== TABLE ========== */
.table-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 0 28px 20px 28px;
}
.table-container {
    flex: 1;
    overflow: auto;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.05);
}
.table-container::-webkit-scrollbar { width: 8px; height: 8px; }
.table-container::-webkit-scrollbar-track { background: var(--surface-2); margin-top: 46px; }
.table-container::-webkit-scrollbar-thumb { background: var(--text-faint); border-radius: 4px; }

#employeeTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
    min-width: 2400px;
}
#employeeTable thead {
    background: var(--primary);
}
#employeeTable tbody tr {
    cursor: pointer;
    transition: all 0.15s ease;
}
#employeeTable th {
    position: sticky;
    top: 0;
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    padding: 12px 10px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    border-right: none;
    z-index: 10;
    cursor: pointer;
    user-select: none;
    white-space: normal;
    word-break: keep-all;
    text-align: center;
    vertical-align: middle;
    font-size: 0.78rem;
    letter-spacing: 0.3px;
    transition: background 0.2s;
}
#employeeTable th:last-child { border-right: none; }
#employeeTable th:hover { background: var(--primary-dark); }
#employeeTable th.sorted-asc { background: #8a0000; }
#employeeTable th.sorted-asc::after { content: "\f0dd"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 0.75rem; margin-left: 6px; }
#employeeTable th.sorted-desc { background: #8a0000; }
#employeeTable th.sorted-desc::after { content: "\f0de"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 0.75rem; margin-left: 6px; }

#employeeTable td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--surface-2);
    vertical-align: middle;
    white-space: nowrap;
    color: var(--text);
    font-size: 0.82rem;
    transition: background 0.15s;
}
#employeeTable tbody tr:nth-child(even) { background-color: var(--surface-2); }
#employeeTable tbody tr:hover { background: rgba(var(--accent-rgb),0.06) !important; }
#employeeTable th:first-child { background: var(--primary); color: white; }
#employeeTable th:first-child:hover { background: var(--primary-dark); }

/* Sticky first column */
#employeeTable th:first-child,
#employeeTable td:first-child {
    position: sticky;
    left: 0;
    background: var(--surface);
    z-index: 20;
    min-width: 240px;
    box-shadow: 3px 0 12px rgba(0,0,0,0.08);
}
#employeeTable th:first-child { z-index: 25; background: var(--primary); color: white; }
#employeeTable tbody tr:nth-child(even) td:first-child { background-color: var(--surface-2); }
#employeeTable tbody tr:nth-child(odd) td:first-child { background-color: var(--surface); }
#employeeTable tbody tr:hover td:first-child { background: var(--surface-2) !important; }
#employeeTable tbody tr td:first-child { border-left: 3px solid transparent; }
#employeeTable tbody tr:hover td:first-child { border-left-color: var(--accent); }

/* ========== BADGES ========== */
.badge-goodt-added, .badge-goodt-error, .badge-goodt-waiting,
.badge-status-gph, .badge-status-cash, .badge-status-self,
.badge-status-contract, .badge-status-notwork, .badge-status-labour,
.badge-status-noshift, .badge-status-forbid,
.badge-consent-received, .badge-consent-sent, .badge-consent-no,
.badge-medbook-active, .badge-medbook-missing, .badge-medbook-expired, .badge-medbook-working,
.badge-account-registration, .badge-account-active, .badge-account-disabled {
    padding: 5px 12px;
    border-radius: 20px;
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.badge-goodt-added { background: rgba(34,197,94,0.14); color: #166534; }
.badge-goodt-error { background: #fce4ec; color: #b71c1c; }
.badge-goodt-waiting { background: rgba(245,158,11,0.12); color: #e65100; }
.badge-status-gph { background: rgba(59,130,246,0.12); color: #0d47a1; }
.badge-status-cash { background: rgba(245,158,11,0.12); color: #e65100; }
.badge-status-self { background: #fffde7; color: #92400e; }
.badge-status-contract { background: #f1f8e9; color: #33691e; }
.badge-status-notwork { background: #fce4ec; color: #880e4f; }
.badge-status-labour { background: var(--surface); color: var(--text); border: 2px solid var(--text-faint); }
.badge-status-noshift { background: #f3e5f5; color: #6a1b9a; }
.badge-status-forbid { background: #e0e0e0; color: #424242; }
.badge-consent-received { background: rgba(34,197,94,0.14); color: #166534; }
.badge-consent-sent { background: rgba(245,158,11,0.12); color: #e65100; }
.badge-consent-no { background: #fce4ec; color: #b71c1c; }
.badge-medbook-active { background: rgba(34,197,94,0.14); color: #166534; }
.badge-medbook-missing { background: #fce4ec; color: #b71c1c; }
.badge-medbook-expired { background: rgba(245,158,11,0.12); color: #e65100; }
.badge-medbook-working { background: var(--surface); color: var(--text); border: 2px solid var(--text-faint); }

/* ========== ACCOUNT STATUS BADGES ========== */
.badge-account-registration { background: rgba(250,204,21,0.14); color: #854d0e; }
.badge-account-active { background: rgba(34,197,94,0.14); color: #166534; }
.badge-account-disabled { background: #fce4ec; color: #b71c1c; }

/* ========== DADATA ========== */
.autocomplete-container { position: relative; display: flex; flex-direction: column; width: 100%; }
.autocomplete-container .form-control { z-index: 1; position: relative; }
.autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-top: 6px;
    max-height: 280px;
    overflow-y: auto;
    z-index: 10001 !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    display: none;
}
.autocomplete-list.show { display: block; animation: slideDown 0.2s ease; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--surface-2);
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    transition: all 0.15s;
    border-radius: 8px;
    margin: 4px;
}
.autocomplete-item:hover { background: var(--surface-2); transform: translateX(4px); }
.autocomplete-item:last-child { border-bottom: none; margin-bottom: 4px; }

/* ========== TABLE LOADER ========== */
.table-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    gap: 20px;
}
.table-loader .spinner {
    width: 70px;
    height: 70px;
    border: 6px solid var(--surface-2);
    border-top: 6px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.table-loader span { font-size: 1.2rem; color: var(--text); font-weight: 600; letter-spacing: 0.5px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* ========== EXPORT / TEMPLATE BUTTONS ========== */
.filters-card .export-btn,
.filters-card .template-btn,
.filters-card .download-template-btn {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
    height: 34px;
    padding: 0 16px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.filters-card .export-btn:hover,
.filters-card .template-btn:hover,
.filters-card .download-template-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.15);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* ========== FILTER DROPDOWNS ========== */
.filter-dropdown {
    z-index: 10001 !important;
    position: absolute;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.04);
    border-radius: 16px;
    background: var(--surface);
    max-height: 320px;
    overflow-y: auto;
    display: none;
    animation: fadeIn 0.15s ease;
    min-width: 220px;
    padding: 8px;
}
.filter-dropdown.show { display: block; }
.filter-option {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--surface-2);
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 0.85rem;
}
.filter-option:hover { background: var(--surface-2); padding-left: 18px; }
.filter-option input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; margin: 0; }

/* ========== SIDEBAR BUTTONS ========== */
.sidebar .btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 12px;
    width: 100%;
    box-shadow: 0 4px 12px rgba(var(--accent-rgb),0.2);
}
.sidebar .btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(var(--accent-rgb),0.3); }
.sidebar .btn-primary:active { transform: translateY(0); }
.sidebar .btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.sidebar .btn-secondary {
    background: var(--surface);
    color: var(--accent);
    border: 2px solid var(--primary);
    border-radius: 12px;
    padding: 11px 22px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
    transition: all 0.25s;
    margin-top: 10px;
}
.sidebar .btn-secondary:hover { background: var(--surface-2); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(var(--accent-rgb),0.1); }
.sidebar .btn-small { padding: 8px 16px; font-size: 0.8rem; border-radius: 10px; }

/* ========== ADD SIDEBAR ========== */
#addSidebar .sidebar-header {
    background: var(--primary);
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
#addSidebar .sidebar-content { padding: 20px; background: var(--surface-2); }
#addSidebarTitle { font-size: 1.3rem; font-weight: 700; }
#addSidebarTitle span { font-size: 0.85rem; font-weight: 500; opacity: 0.9; }

/* ========== FIELD GROUPS ========== */
.field-group {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.field-group:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.07);
    border-color: var(--border);
    transform: translateY(-1px);
}
.field-group h4 {
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.field-group .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.field-group .field-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: block;
}
.field-group .field-label.required::after { content: ' *'; color: #ef4444; font-weight: 700; }
.field-group .form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.5;
    height: auto;
    min-height: 42px;
    background: var(--surface);
    transition: all 0.2s;
    box-sizing: border-box;
    font-weight: 500;
}
.field-group .form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(var(--accent-rgb),0.1); }
.field-group .form-control:disabled { background: var(--surface-2); color: var(--text-muted); cursor: not-allowed; border-color: var(--surface-2); }
.field-group .form-control::placeholder { color: var(--text-faint); }
.field-group select.form-control { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.field-group .checkbox-wrapper { margin-top: 8px; font-size: 0.8rem; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; cursor: pointer; }
.field-group .checkbox-wrapper input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; margin: 0; }
.field-group .checkbox-wrapper label { margin: 0; cursor: pointer; }

.field-group .field-value {
    font-weight: 500;
    color: var(--text);
    word-break: break-word;
    background: var(--surface-2);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    border: 1px solid var(--border);
}
.field-group .field-value a { color: var(--accent); text-decoration: none; font-weight: 600; transition: all 0.2s; }
.field-group .field-value a:hover { color: var(--primary-dark); text-decoration: underline; }

/* ========== DOCUMENTS TAB ========== */
@keyframes docFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes docSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.doc-tab {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Filter chips ── */
.df-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 0;
}
.df-chip {
    padding: 6px 14px;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.df-chip i { font-size: 0.72rem; color: var(--text-muted); transition: color 0.15s; }
.df-chip:hover { background: var(--surface-2); border-color: var(--text-faint); }
.df-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(var(--accent-rgb),0.25);
}
.df-chip.active i { color: rgba(255,255,255,0.85); }

/* ── Upload + Create bar ── */
.df-bar {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.df-upload {
    flex: 0 0 auto;
    border: 2px dashed #d0d5dd;
    border-radius: 12px;
    padding: 12px 18px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 220px;
}
.df-upload i { font-size: 1.15rem; color: var(--text-muted); transition: color 0.15s; }
.df-upload:hover { border-color: var(--accent); color: var(--accent); background: var(--surface-2); }
.df-upload:hover i { color: var(--accent); }
.doc-zone-dragover { border-color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.12); }

.df-create {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow-x: auto;
    flex-wrap: nowrap;
}
.df-create-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-right: 4px;
    padding-right: 8px;
    border-right: 1px solid var(--border);
}
.df-create-label i { color: #22c55e; font-size: 0.76rem; }
.df-create-btn {
    padding: 5px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.df-create-btn i { font-size: 0.7rem; color: var(--accent); }
.df-create-btn:hover { background: var(--primary); color: white; border-color: var(--accent); }
.df-create-btn:hover i { color: white; }
.df-create-btn.loading { opacity: 0.6; pointer-events: none; }
.df-create-btn.loading .btn-text { display: none !important; }
.df-create-btn.loading .btn-spinner { display: inline-flex !important; animation: docSpin 0.7s linear infinite; }
.df-create-btn.loading i:first-child { display: none; }
.df-create-btn.success { background: #22c55e; color: white; border-color: #22c55e; }
.df-create-btn.success .btn-text { display: none !important; }
.df-create-btn.success .btn-check { display: inline-flex !important; }
.df-create-btn.success i:first-child { display: none; }
.df-create-btn.success i { color: white; }
.df-create-sep {
    width: 1px;
    height: 22px;
    background: var(--border);
    flex-shrink: 0;
    margin: 0 2px;
}

/* ── Toolbar ── */
.df-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}
.df-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}
.df-toolbar-btn:hover { background: var(--surface-2); border-color: var(--text-faint); }
.df-toolbar-btn i { font-size: 0.8rem; }
.df-count { margin-left: auto; font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

/* ── Document list ── */
.df-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.df-empty {
    padding: 44px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 500;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
}
.df-empty i { display: block; font-size: 2rem; color: var(--text-faint); margin-bottom: 10px; }

/* ── Doc row ── */
.df-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface);
    border-radius: 10px;
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    transition: all 0.15s ease;
    cursor: default;
}
.df-row:hover { border-left-color: var(--accent); background: var(--surface-2); box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.dfr-icon { font-size: 1.15rem; width: 30px; text-align: center; flex-shrink: 0; color: var(--accent); }
.dfr-name {
    flex: 1;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-size: 0.82rem; font-weight: 600; color: var(--text); min-width: 0;
    padding-right: 8px;
}
.dfr-type { display: flex; align-items: center; gap: 5px; flex-shrink: 0; width: 170px; }
.dfr-sel {
    font-size: 0.7rem;
    padding: 3px 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    max-width: 110px;
    transition: border-color 0.15s;
}
.dfr-sel:hover { border-color: var(--text-faint); }
.dfr-sel:focus { outline: none; border-color: var(--accent); }
.dfr-size { width: 70px; text-align: right; font-size: 0.74rem; color: var(--text-muted); flex-shrink: 0; }
.dfr-sign { width: 100px; text-align: center; font-size: 0.74rem; flex-shrink: 0; }
.dfr-review { width: 24px; text-align: center; flex-shrink: 0; font-size: 0.85rem; }

/* ── Action buttons container ── */
.dfr-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    margin-left: auto;
}
.dfr-btn {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.78rem; color: var(--text-muted);
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.dfr-btn:active { transform: scale(0.9); }
.dfr-btn:hover { background: var(--surface-2); border-color: var(--text-faint); color: var(--text); }
.dfr-btn i { transition: color 0.15s; }

/* Download */
.dfr-btn[title="Скачать"] { color: #3b82f6; }
.dfr-btn[title="Скачать"]:hover { background: var(--surface-2); border-color: #93c5fd; color: #2563eb; }
.dfr-btn[title="Скачать"]:hover i { color: #2563eb; }

/* Preview */
.dfr-btn[title="Просмотр"] { color: #8b5cf6; }
.dfr-btn[title="Просмотр"]:hover { background: rgba(168,85,247,0.10); border-color: #c4b5fd; color: #7c3aed; }
.dfr-btn[title="Просмотр"]:hover i { color: #7c3aed; }

/* Rename */
.dfr-btn.dfr-rename { color: #f59e0b; }
.dfr-btn.dfr-rename:hover { background: rgba(245,158,11,0.10); border-color: rgba(245,158,11,0.20); color: #d97706; }
.dfr-btn.dfr-rename:hover i { color: #d97706; }

/* Delete */
.dfr-btn.dfr-del { color: var(--text-muted); }
.dfr-btn.dfr-del:hover { background: rgba(239,68,68,0.07); border-color: rgba(239,68,68,0.18); color: #dc2626; }

/* Review approve */
.dfr-btn.dfr-review-ok { color: #16a34a; }
.dfr-btn.dfr-review-ok:hover { background: rgba(34,197,94,0.10); border-color: rgba(34,197,94,0.22); }
.dfr-btn.dfr-review-ok:disabled { opacity: 0.35; cursor: default; background: transparent; }

/* Review reject */
.dfr-btn.dfr-review-no { color: #dc2626; }
.dfr-btn.dfr-review-no:hover { background: rgba(239,68,68,0.07); border-color: rgba(239,68,68,0.18); }
.dfr-btn.dfr-review-no:disabled { opacity: 0.35; cursor: default; background: transparent; }

/* Inline rename */
.dfr-name {
    flex: 1;
    min-width: 0;
    font-size: 0.82rem; font-weight: 600; color: var(--text);
    padding-right: 8px;
    position: relative;
}
.dfr-name-text {
    display: inline;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 100%;
    cursor: default;
}
.doc-sign-inline {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    font-size: 0.75rem;
    vertical-align: middle;
}
.doc-sign-inline.doc-signed { color: #16a34a; }
.doc-sign-inline.doc-pending { color: #f59e0b; }
.doc-sign-inline { gap: 4px; }

.df-row-signed { background: rgba(34,197,94,0.10) !important; border-left-color: #16a34a !important; }
.df-row-signed:hover { background: rgba(34,197,94,0.14) !important; }
.df-row-pending { background: rgba(245,158,11,0.10) !important; border-left-color: #f59e0b !important; }
.df-row-pending:hover { background: rgba(245,158,11,0.10) !important; }
.dfr-rename-wrap {
    display: none;
    align-items: center;
    gap: 4px;
    width: 100%;
}
.dfr-name-input {
    flex: 1;
    min-width: 0;
    border: 1.5px solid var(--primary);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    outline: none;
    box-sizing: border-box;
}
.dfr-name-input:focus { box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.15); }
.dfr-rename-ok, .dfr-rename-no {
    width: 26px; height: 26px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.7rem;
    transition: all 0.12s;
    flex-shrink: 0;
}
.dfr-rename-ok { color: #059669; }
.dfr-rename-ok:hover { background: rgba(34,197,94,0.10); border-color: #a7f3d0; color: #047857; }
.dfr-rename-no { color: #dc2626; }
.dfr-rename-no:hover { background: rgba(239,68,68,0.07); border-color: rgba(239,68,68,0.18); color: #b91c1c; }

/* Preview modal */
.doc-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15,23,42,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: docFadeIn 0.15s ease;
}
.doc-preview-modal {
    background: var(--surface);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: 90vw;
    height: 85vh;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: docFadeIn 0.2s ease;
}
.doc-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.doc-preview-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.doc-preview-close {
    width: 32px; height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: all 0.12s;
    flex-shrink: 0;
}
.doc-preview-close:hover { background: var(--surface-2); color: var(--text); }
.doc-preview-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 12px;
    background: var(--surface-2);
}
.doc-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}
.doc-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}
.doc-preview-info {
    text-align: center;
    padding: 24px;
}
.doc-preview-loading {
    display: flex;
    align-items: center; justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    width: 100%; height: 100%;
}

/* Sign (pill) */
.doc-act {
    height: 32px;
    border-radius: 8px;
    border: 1px solid #059669;
    background: #059669;
    color: white;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 0 12px;
    font-size: 0.74rem; font-weight: 600;
    transition: all 0.15s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.doc-act i { font-size: 0.78rem; }
.doc-act:hover { background: #047857; border-color: #047857; box-shadow: 0 2px 8px rgba(5,150,105,0.25); }
.doc-act:active { transform: scale(0.95); }

/* ── Type badge ── */
.doc-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ── Signing statuses ── */
.doc-sign-none { color: var(--text-muted); font-size: 0.74rem; }
.doc-sign-pending { color: #d97706; font-weight: 600; font-size: 0.74rem; }
.doc-sign-pending i { margin-right: 3px; }
.doc-sign-signed { color: #059669; font-weight: 600; font-size: 0.74rem; }
.doc-sign-signed i { margin-right: 3px; }

/* ========== BUTTONS ========== */
.btn-doc {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    cursor: pointer;
    border: none;
}
.btn-doc-primary { background: var(--primary); color: white; box-shadow: 0 2px 8px rgba(var(--accent-rgb),0.2); }
.btn-doc-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(var(--accent-rgb),0.3); }
.btn-doc-secondary { background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-doc-secondary:hover { background: var(--border); }
.btn-doc-folder { background: rgba(34,197,94,0.14); color: #166534; border: 1px solid rgba(34,197,94,0.22); }
.btn-doc-folder:hover { background: rgba(34,197,94,0.22); }

/* ========== FILE ROW ========== */
.file-row {
    cursor: default;
    transition: all 0.15s;
}
.file-row:hover { background: var(--surface-2) !important; }
.file-row button { transition: all 0.15s; }

/* ========== HISTORY TABLE ========== */
.field-group table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.field-group table thead th { padding: 8px 6px; text-align: left; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid var(--border); white-space: nowrap; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; }
.field-group table tbody td { padding: 7px 6px; border-bottom: 1px solid var(--surface-2); color: var(--text); }
.field-group table tbody tr:last-child td { border-bottom: none; }

/* ========== GOODT TIME BUTTON ========== */
.field-value .btn-doc { font-size: 0.72rem; padding: 4px 10px; }

/* ========== FILE LIST SCROLLBAR ========== */
#employeeFilesList::-webkit-scrollbar { width: 6px; }
#employeeFilesList::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 3px; }
#employeeFilesList::-webkit-scrollbar-thumb { background: var(--text-faint); border-radius: 3px; }

/* ========== EMPLOYEE SUBINFO ========== */
.employee-subinfo { font-size: 0.72rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.employee-subinfo span { background: var(--surface-2); padding: 2px 8px; border-radius: 10px; font-weight: 500; }

/* ========== PAGINATION ========== */
.pagination {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 300;
    display: flex;
    justify-content: flex-end;
}

.pagination-inner {
    display: flex;
    align-items: center;
    gap: 3px;
    background: var(--surface);
    padding: 5px 10px;
    border-radius: 10px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    font-size: 12px;
}

.pagination-inner button {
    padding: 4px 9px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.15s;
    color: var(--text-secondary);
    min-width: 28px;
    text-align: center;
    line-height: 1.3;
}

.pagination-inner button:hover {
    background: var(--surface-2);
    border-color: var(--border);
}

.pagination-inner button.active {
    background: var(--primary);
    color: white;
    border-color: var(--accent);
    font-weight: 700;
}

.pagination-inner button:disabled {
    opacity: 0.3;
    cursor: default;
    background: transparent;
}

.pagination-inner .page-dots {
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 1px;
    padding: 0 1px;
}

.pagination-inner .page-info {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    margin: 0 2px;
    white-space: nowrap;
}

.pagination-inner .page-size-select {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 4px;
    padding-left: 6px;
    border-left: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
}

.pagination-inner .page-size-select i {
    font-size: 10px;
}

.pagination-inner .page-size-select select {
    padding: 2px 4px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 11px;
    background: var(--surface);
    cursor: pointer;
    color: var(--text);
    font-weight: 500;
}

.pagination-inner .page-size-select select:focus {
    outline: none;
    border-color: var(--accent);
}

/* ========== DOCUMENT REVIEW ========== */
.doc-card .review-comment {
    font-size: 0.72rem;
    color: #991b1b;
    background: rgba(239,68,68,0.07);
    padding: 6px 10px;
    border-radius: 8px;
    margin-top: 6px;
    border: 1px solid rgba(239,68,68,0.18);
}
.doc-card .review-btn {
    flex: 1;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
    min-width: 0;
}
.doc-card .review-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.doc-card .review-btn-ok { background: rgba(34,197,94,0.14); color: #166534; border-color: rgba(34,197,94,0.22); }
.doc-card .review-btn-ok:hover:not(:disabled) { background: rgba(34,197,94,0.22); }
.doc-card .review-btn-no { background: rgba(239,68,68,0.07); color: #991b1b; border-color: rgba(239,68,68,0.18); }
.doc-card .review-btn-no:hover:not(:disabled) { background: rgba(239,68,68,0.18); }

/* ==================== EMPLOYEE DETAIL PAGE ==================== */
/* ========== EMPLOYEE DETAIL PAGE ========== */
.employee-detail {
    position: fixed; top: 0; left: 54px; right: 0; bottom: 0;
    z-index: 4000;
    background: var(--surface-2);
    display: flex; flex-direction: column;
    animation: edSlideIn 0.3s cubic-bezier(0.22,0.61,0.36,1);
}
.nav-open .employee-detail {
    left: 0;
}
@keyframes edSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Hero header */
.ed-hero {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    flex-shrink: 0;
    box-shadow: 0 4px 20px rgba(var(--accent-rgb),0.25);
    position: relative;
    z-index: 5;
}
.ed-hero-avatar {
    width: 48px; height: 48px;
    border-radius: 14px;
    background: rgba(255,255,255,0.18);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.3rem;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.2);
}
.ed-hero-info { flex: 1; min-width: 0; }
.ed-hero-info h2 {
    margin: 0; font-size: 1.15rem; font-weight: 800;
    color: white; letter-spacing: 0.2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ed-hero-meta {
    font-size: 0.75rem; color: rgba(255,255,255,0.7);
    display: flex; align-items: center; gap: 8px; margin-top: 2px;
}
.ed-hero-actions {
    display: flex; gap: 6px; flex-shrink: 0;
}
.ed-btn-icon {
    width: 34px; height: 34px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.85);
    cursor: pointer; font-size: 0.85rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}
.ed-btn-icon:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    transform: translateY(-1px);
}
.ed-btn-icon.danger:hover { background: rgba(239,68,68,0.4); border-color: rgba(239,68,68,0.3); }
.ed-btn-back {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 9999px;
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    font-size: 0.8rem; font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}
.ed-btn-back:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    transform: translateY(-1px);
}

/* Tabs — chip style on white bg */
.ed-tabs-wrap {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    flex-shrink: 0;
    display: flex;
}
.ed-tabs {
    display: flex; gap: 4px; padding: 10px 0;
}
.ed-tab {
    background: none; border: none;
    padding: 8px 16px;
    font-size: 0.8rem; font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 9999px;
    display: flex; align-items: center; gap: 7px;
    transition: all 0.2s;
    white-space: nowrap;
}
.ed-tab:hover { background: var(--surface-2); color: var(--text); }
.ed-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb),0.2);
}
.ed-tab i { font-size: 0.85rem; }

/* Content area */
.ed-content {
    flex: 1; overflow-y: auto;
    padding: 20px 24px;
}
.ed-content::-webkit-scrollbar { width: 6px; }
.ed-content::-webkit-scrollbar-track { background: transparent; }
.ed-content::-webkit-scrollbar-thumb { background: var(--text-faint); border-radius: 3px; }
.ed-panel { display: none; }
.ed-panel.active { display: block; }

/* Info tab — key info strip */
.ed-info-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 14px 18px;
    background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface));
    border-radius: 14px;
    border: 1px solid var(--border);
}
.ed-info-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
}
.ed-info-chip i { font-size: 0.75rem; color: var(--text-muted); }
.ed-info-chip .chip-label {
    color: var(--text-muted);
    font-weight: 500;
    margin-right: 2px;
}
.ed-info-chip a { color: inherit; text-decoration: none; }
.ed-info-chip a:hover { color: var(--accent); }

/* Status badge colors */
.ed-chip-green { background: rgba(34,197,94,0.14); border-color: rgba(34,197,94,0.22); color: #166534; }
.ed-chip-green i { color: #16a34a; }
.ed-chip-yellow { background: rgba(250,204,21,0.14); border-color: rgba(245,158,11,0.20); color: #854d0e; }
.ed-chip-yellow i { color: #ca8a04; }
.ed-chip-red { background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.18); color: #991b1b; }
.ed-chip-red i { color: #dc2626; }
.ed-chip-blue { background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.22); color: #1e40af; }
.ed-chip-blue i { color: #2563eb; }
.ed-chip-gray { background: var(--surface-2); border-color: var(--border); color: var(--text-muted); }
.ed-chip-gray i { color: var(--text-muted); }
.ed-chip-purple { background: rgba(168,85,247,0.10); border-color: #e9d5ff; color: #6b21a8; }
.ed-chip-purple i { color: #9333ea; }

/* Chip with count dot */
.ed-chip-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.ed-chip-dot.green { background: #22c55e; }
.ed-chip-dot.yellow { background: #eab308; }
.ed-chip-dot.red { background: #ef4444; }
.ed-chip-dot.blue { background: #3b82f6; }
.ed-chip-dot.gray { background: var(--text-muted); }

/* Edit mode banner */
.ed-edit-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}
.ed-edit-banner i { font-size: 1rem; }

/* Self-employment check card */
.ed-self-card {
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    margin-bottom: 20px;
    overflow: hidden;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.ed-self-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.ed-self-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px 0 18px;
}
.ed-self-icon-round {
    width: 44px; height: 44px;
    background: var(--surface-2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: background 0.3s, color 0.3s;
}
.ed-self-info { flex: 1; }
.ed-self-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
}
.ed-self-subtitle {
    font-size: 0.73rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 1px;
    transition: color 0.3s;
}
.ed-self-btn {
    padding: 7px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ed-self-btn:hover { background: var(--surface-2); border-color: var(--text-faint); color: var(--text); }
.ed-self-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.ed-self-body {
    padding: 12px 18px 14px 76px;
}
.ed-self-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 0;
}
.ed-self-status i { font-size: 0.85rem; width: 16px; text-align: center; }
.ed-self-idle i { color: var(--text-muted); }
.ed-self-idle span { color: var(--text-muted); }
.ed-self-loading i { color: #eab308; }
.ed-self-loading span { color: #a16207; }
.ed-self-ok i { color: #16a34a; }
.ed-self-ok span { color: #166534; }
.ed-self-no i { color: #ef4444; }
.ed-self-no span { color: #dc2626; }
.ed-self-error i { color: #ef4444; }
.ed-self-error span { color: #dc2626; }
.ed-self-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px 14px 18px;
    border-top: 1px solid var(--surface-2);
}
.ed-self-inn-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ed-self-stale i { color: #eab308; }
.ed-self-stale span { color: #92400e; }
.ed-self-stale-label {
    color: #d97706 !important;
}
.ed-self-stale-label i {
    font-size: 0.65rem;
    margin-right: 2px;
}
.ed-self-inn-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    letter-spacing: 0.3px;
}
.ed-self-checked-at {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.ed-btn-icon.editing { background: var(--primary); color: white; border-color: var(--accent); }
.ed-btn-icon.editing:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.ed-hours-chip { min-width: 80px; justify-content: center; }

/* Field value enhancements */
.ed-field-value .ed-val-phone a {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
}
.ed-field-value .ed-val-phone a:hover { text-decoration: underline; }
.ed-field-value .ed-val-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* Shift filter bar labels */
.ed-filter-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: block;
    margin-bottom: 3px;
}

/* Editable value hover indicator */
.ed-field-value.editable {
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}
.ed-field-value.editable:hover {
    border-color: var(--accent);
    background: var(--surface-2);
}

/* Field cards */
.ed-field-card {
    background: var(--surface);
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.2s, transform 0.2s;
}
.ed-field-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.07);
    transform: translateY(-1px);
}
.ed-field-card-title {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}
.ed-field-card-title i { color: var(--accent); font-size: 0.75rem; }
.ed-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
}
.ed-field {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ed-field.full { grid-column: span 2; }
.ed-field-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.ed-field-value {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    padding: 8px 12px;
    background: var(--surface-2);
    border-radius: 10px;
    border: 1px solid var(--surface-2);
    word-break: break-word;
    transition: border-color 0.2s, background 0.2s;
    line-height: 1.4;
    min-height: 24px;
}
.ed-field-value:hover { border-color: var(--border); background: var(--surface); }
.ed-field-value.ed-empty {
    color: var(--text-faint);
    font-style: italic;
    font-weight: 400;
}
.ed-field-input {
    width: 100%; padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    font-size: 0.88rem;
    background: var(--surface-2);
    color: var(--text);
    font-weight: 500;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    min-height: 38px;
}
.ed-field-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb),0.08);
    background: var(--surface);
}
.ed-field-input[readonly] {
    background: var(--surface-2);
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: var(--surface-2);
}
select.ed-field-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* Save button in info tab */
.ed-save-bar {
    display: flex; gap: 10px;
    margin-top: 16px;
    align-items: center;
}
.ed-btn-save {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white; border: none;
    border-radius: 12px;
    padding: 11px 28px;
    font-size: 0.9rem; font-weight: 700;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(var(--accent-rgb),0.25);
    font-family: inherit;
}
.ed-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(var(--accent-rgb),0.35);
}
.ed-btn-save:active { transform: translateY(0); }
.ed-btn-save:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.ed-btn-cancel {
    background: var(--surface);
    color: var(--text-muted); border: 1px solid var(--border);
    border-radius: 12px;
    padding: 11px 24px;
    font-size: 0.85rem; font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}
.ed-btn-cancel:hover { background: var(--surface-2); border-color: var(--text-faint); color: var(--text); }
.ed-save-spinner {
    width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

/* ========== INFO PANEL ========== */

.ed-info-panel {
    background: var(--surface);
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    padding: 10px 18px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.ed-info-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    font-size: 0.82rem;
}
.ed-info-stat-icon {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.ed-info-stat-label {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
}
.ed-info-stat-value {
    color: var(--text);
    font-weight: 700;
    font-size: 0.82rem;
}
.ed-info-stat-value.empty {
    color: var(--text-faint);
    font-weight: 400;
}
.ed-info-divider {
    width: 1px;
    height: 22px;
    background: var(--border);
    flex-shrink: 0;
}
.ed-info-locations {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.ed-info-loc-chips {
    display: inline-flex;
    gap: 5px;
    flex-wrap: wrap;
    max-width: 100%;
}
.ed-info-loc-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
}
.ed-info-loc-empty {
    color: var(--text-faint);
    font-style: italic;
    font-size: 0.75rem;
    font-weight: 400;
}

/* Section header with icon */
#tabInfo > * + * {
    margin-top: 18px;
}

.ed-section {
    background: var(--surface);
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.ed-section:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
.ed-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid transparent;
    transition: background 0.15s;
}
.ed-section-header:hover {
    background: var(--surface-2);
}
.ed-section-header.open {
    border-bottom-color: var(--border);
}
.ed-section-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ed-section-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    flex-shrink: 0;
}
.ed-section-icon.blue { background: rgba(59,130,246,0.12); color: #2563eb; }
.ed-section-icon.green { background: rgba(34,197,94,0.14); color: #16a34a; }
.ed-section-icon.purple { background: rgba(168,85,247,0.10); color: #9333ea; }
.ed-section-icon.orange { background: #ffedd5; color: #ea580c; }
.ed-section-icon.red { background: rgba(239,68,68,0.10); color: #dc2626; }
.ed-section-icon.teal { background: rgba(20,184,166,0.14); color: #0d9488; }
.ed-section-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
}
.ed-section-chevron {
    color: var(--text-muted);
    font-size: 0.7rem;
    transition: transform 0.2s;
}
.ed-section-header.open .ed-section-chevron {
    transform: rotate(180deg);
}
.ed-section-body {
    padding: 16px 20px;
}
.ed-section-body.collapsed {
    display: none;
}

/* Edit mode indicator */
.ed-edit-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(245,158,11,0.10);
    color: #92400e;
    font-size: 0.68rem;
    font-weight: 700;
    margin-left: 8px;
}

/* Sticky save bar */
.ed-sticky-save {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
    animation: slideUp 0.2s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.ed-sticky-save .ed-btn-save {
    flex: 0 0 auto;
}
.ed-sticky-save .ed-save-hint {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Comments section */
.ed-comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ed-comment-item {
    background: var(--surface-2);
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid var(--surface-2);
    position: relative;
    transition: border-color 0.2s;
}
.ed-comment-item:hover {
    border-color: var(--border);
}
.ed-comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.ed-comment-category {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
}
.ed-comment-category.cat-problem { background: rgba(239,68,68,0.10); color: #991b1b; }
.ed-comment-category.cat-feature { background: rgba(59,130,246,0.12); color: #1e40af; }
.ed-comment-category.cat-note { background: var(--surface-2); color: var(--text-secondary); }
.ed-comment-category.cat-warning { background: rgba(245,158,11,0.10); color: #92400e; }
.ed-comment-delete {
    width: 24px; height: 24px;
    border: none; background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: all 0.15s;
}
.ed-comment-delete:hover {
    background: rgba(239,68,68,0.10);
    color: #dc2626;
}
.ed-comment-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.ed-comment-date {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 6px;
}
.ed-add-comment {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.ed-add-comment select,
.ed-add-comment input {
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.2s;
}
.ed-add-comment select { width: 140px; flex-shrink: 0; cursor: pointer; }
.ed-add-comment input { flex: 1; }
.ed-add-comment select:focus,
.ed-add-comment input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb),0.08);
}
.ed-add-comment button {
    padding: 8px 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.ed-add-comment button:hover { background: var(--primary-dark); }

/* Mobile responsive */
@media (max-width: 900px) {
    .ed-sf-view-toggle { display: none; }
}
@media (max-width: 600px) {
    .ed-shifts-filter-bar { gap: 8px; padding: 8px 10px; }
}

/* Documents tab */
.ed-doc-section {
    background: var(--surface);
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 12px;
    overflow: hidden;
}
.ed-doc-section-title {
    padding: 14px 20px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text);
    border-bottom: 1px solid var(--surface-2);
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface-2);
}
.ed-doc-section-title i { color: var(--accent); font-size: 0.8rem; }
.ed-doc-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.ed-shifts-top-bar {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    margin-top: 18px;
}
.ed-shifts-filter-bar {
    margin: 0;
    background: var(--primary);
    border-radius: 16px;
    padding: 10px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
    color: white;
}
.ed-sf-group {
    flex: 0 0 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.ed-sf-group label {
    display: block;
    font-size: 0.58rem;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-left: 6px;
}
.ed-sf-input {
    background: rgba(255,255,255,0.12) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    color: rgba(255,255,255,0.9) !important;
    height: 34px !important;
    padding: 0 14px !important;
    border-radius: 10px !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    min-height: 0 !important;
    width: 140px !important;
    outline: none !important;
    font-family: inherit !important;
}
.ed-sf-input:hover { background: rgba(255,255,255,0.2) !important; border-color: rgba(255,255,255,0.15) !important; }
.ed-sf-input:focus {
    background: rgba(255,255,255,0.15) !important;
    border-color: rgba(255,255,255,0.3) !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.2) !important;
}
.ed-sf-input option { color: var(--text); background: var(--surface); }
select.ed-sf-input {
    padding-right: 30px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='rgba(255,255,255,0.5)' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-position: right 10px center !important;
    background-repeat: no-repeat !important;
    appearance: none !important;
}
.ed-sf-input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; filter: invert(1); opacity: 0.5; }
.ed-sf-view-toggle {
    margin-left: auto;
}
.ed-view-btns {
    display: flex;
    gap: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    padding: 2px;
}
.ed-view-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.2s;
}
.ed-view-btn:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.1); }
.ed-view-btn.active { color: white; background: rgba(255,255,255,0.2); }

/* Shifts content container */
.ed-shifts-content {
    flex: 1;
    overflow: auto;
    min-height: 0;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.ed-shifts-content::-webkit-scrollbar { width: 6px; height: 6px; }
.ed-shifts-content::-webkit-scrollbar-track { background: var(--surface-2); }
.ed-shifts-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.ed-shifts-content::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* Skeleton loading */
.ed-shifts-skeleton {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 16px;
}
.ed-skeleton-card {
    height: 80px;
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: 12px;
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Enhanced table */
.ed-shifts-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.82rem;
    min-width: 850px;
}
.ed-shifts-table th {
    text-align: left;
    padding: 10px 12px;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    position: sticky;
    top: 0;
    z-index: 10;
    white-space: nowrap;
}
.ed-shifts-table th:hover { background: var(--primary-dark); }
.ed-shifts-table th:first-child { border-radius: 12px 0 0 0; }
.ed-shifts-table th:last-child { border-radius: 0 12px 0 0; }
.ed-shifts-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--surface-2);
    color: var(--text-secondary);
    font-size: 0.82rem;
    vertical-align: middle;
    transition: background 0.15s;
}
.ed-shifts-table tbody tr { cursor: pointer; transition: background 0.15s; }
.ed-shifts-table tbody tr:hover td { background: var(--surface-2); }
.ed-shifts-table tbody tr:last-child td:first-child { border-radius: 0 0 0 12px; }
.ed-shifts-table tbody tr:last-child td:last-child { border-radius: 0 0 12px 0; }
.ed-shifts-table .ed-s-date {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}
.ed-shifts-table .ed-s-shop {
    font-weight: 500;
}
.ed-shifts-table .ed-s-amount {
    font-weight: 700;
    text-align: right;
    color: var(--text);
    white-space: nowrap;
}
.ed-shifts-table .ed-s-hours {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.ed-shifts-table .ed-s-comment {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* Status badges */
.ed-s-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.ed-s-status.paid { background: rgba(34,197,94,0.14); color: #166534; }
.ed-s-status.paid::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }
.ed-s-status.unpaid { background: #fce4ec; color: #b71c1c; }
.ed-s-status.unpaid::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #ef4444; }
.ed-s-status.waiting { background: rgba(250,204,21,0.14); color: #854d0e; }
.ed-s-status.waiting::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #eab308; }

/* Shop badges */
.shop-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.shop-badge-mm { background: rgba(34,197,94,0.14); color: #166534; }
.shop-badge-mk { background: #fce7f3; color: #9d174d; }
.shop-badge-gm { background: rgba(59,130,246,0.12); color: #1e40af; }
.shop-badge-other { background: var(--surface-2); color: var(--text-secondary); }

/* Payment badges */
.pay-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.pay-jf { background: rgba(59,130,246,0.12); color: #1e40af; }
.pay-card { background: rgba(168,85,247,0.10); color: #7c3aed; }
.pay-gph { background: #d1fae5; color: #065f46; }
.pay-cash { background: rgba(245,158,11,0.10); color: #92400e; }
.pay-self { background: #cffafe; color: #155e75; }

/* Cards view */
.ed-shifts-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px;
}
.ed-shift-card {
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.ed-shift-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 4px 0 0 4px;
}
.ed-shift-card.card-paid::before { background: #22c55e; }
.ed-shift-card.card-unpaid::before { background: #ef4444; }
.ed-shift-card.card-waiting::before { background: #eab308; }
.ed-shift-card:hover {
    border-color: var(--border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    transform: translateY(-1px);
}
.ed-shift-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.ed-shift-card-date {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
}
.ed-shift-card-shop {
    flex: 1;
}
.ed-shift-card-status {
    margin-left: auto;
}
.ed-shift-card-body {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.ed-shift-card-item {
    display: flex;
    align-items: center;
    gap: 5px;
}
.ed-shift-card-item i {
    color: var(--text-muted);
    font-size: 0.7rem;
    width: 14px;
    text-align: center;
}
.ed-shift-card-item span {
    font-weight: 500;
    color: var(--text-secondary);
}
.ed-shift-card-amount {
    font-weight: 700;
    color: var(--text);
    font-size: 0.88rem;
}
.ed-shift-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--surface-2);
    font-size: 0.72rem;
    color: var(--text-muted);
}
.ed-shift-card-comment {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-style: italic;
}

/* Empty state */
.ed-shifts-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
    color: var(--text-muted);
}
.ed-shifts-empty i {
    font-size: 2.5rem;
    opacity: 0.4;
}
.ed-shifts-empty-text {
    font-size: 0.9rem;
    font-weight: 500;
}
.ed-shifts-empty-sub {
    font-size: 0.78rem;
    opacity: 0.7;
}

/* Shifts tab panel override */
.ed-content:has(#tabShifts.active) { overflow: hidden; padding-top: 0; display: flex; flex-direction: column; }
.ed-panel#tabShifts { display: none; }
.ed-panel#tabShifts.active { display: flex; flex-direction: column; height: 100%; min-height: 0; gap: 18px; }

/* Requests tab panel override */
.ed-content:has(#tabRequests.active) { overflow: hidden; padding-top: 0; display: flex; flex-direction: column; }
.ed-panel#tabRequests { display: none; }
.ed-panel#tabRequests.active { display: flex; flex-direction: column; height: 100%; min-height: 0; gap: 12px; }

/* History tab */
.ed-history-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.ed-history-table th {
    text-align: left; padding: 8px 10px;
    background: var(--surface-2); color: var(--text-muted);
    font-weight: 600; border-bottom: 2px solid var(--border);
}
.ed-history-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--surface-2);
    color: var(--text);
}
.ed-history-table tr:hover td { background: var(--surface-2); }
.ed-history-empty { text-align: center; padding: 40px; color: var(--text-muted); }

/* ========== DOCUMENT CARDS ========== */
.doc-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 16px 20px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}
.doc-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--surface);
    border-radius: 14px;
    border: 1.5px solid var(--border);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.22,0.61,0.36,1);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
}
.doc-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 3px 0 0 3px;
    transition: background 0.2s;
}
.doc-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 16px rgba(var(--accent-rgb),0.1);
    transform: translateY(-2px);
}
.doc-card:hover::before {
    background: var(--primary);
}
.doc-card-icon {
    width: 40px;
    height: 40px;
    background: var(--surface-2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--accent);
    flex-shrink: 0;
    transition: all 0.2s;
}
.doc-card:hover .doc-card-icon {
    background: var(--primary);
    color: white;
}
.doc-card-body {
    flex: 1;
    min-width: 0;
}
.doc-card-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1px;
}
.doc-card-desc {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
}
.doc-card-btn {
    padding: 7px 16px;
    border: 1px solid var(--primary);
    border-radius: 8px;
    background: var(--surface);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.22,0.61,0.36,1);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    min-width: 72px;
    justify-content: center;
    font-family: inherit;
    flex-shrink: 0;
}
.doc-card-btn:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--accent-rgb),0.25);
}
.doc-card-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}
.doc-card-btn.loading {
    background: var(--primary);
    color: white;
    border-color: var(--accent);
    animation: btnPulse 1s ease-in-out infinite;
}
.doc-card-btn.success {
    background: #16a34a;
    color: white;
    border-color: #16a34a;
    animation: btnSuccessPop 0.35s cubic-bezier(0.22,0.61,0.36,1);
}
@keyframes btnPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
@keyframes btnSuccessPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

/* Card entrance animation */
.doc-card {
    opacity: 0;
    transform: translateY(12px);
    animation: docCardIn 0.35s cubic-bezier(0.22,0.61,0.36,1) forwards;
}
.doc-card:nth-child(1) { animation-delay: 0.05s; }
.doc-card:nth-child(2) { animation-delay: 0.1s; }
.doc-card:nth-child(3) { animation-delay: 0.15s; }
@keyframes docCardIn {
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 700px) {
    .doc-cards { grid-template-columns: 1fr; }
}
