/* === КНОПКИ === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(45, 80, 22, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(45, 80, 22, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--brand);
    color: var(--brand);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

/* === ГРУППА КНОПОК === */
.btn-group {
    display: flex;
    gap: 8px;
}

.btn-group-right {
    justify-content: flex-end;
}

/* === КАРТОЧКИ === */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 24px;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--brand);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.card-title {
    font-family: var(--font);
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-light);
    line-height: 1.5;
}

.card-actions {
    display: flex;
    gap: 8px;
}

/* === BADGE === */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: var(--radius-full);
    letter-spacing: 0.5px;
}

.badge-primary {
    background: rgba(45, 80, 22, 0.1);
    color: var(--brand);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-accent {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent);
}

/* === МОДАЛЬНОЕ ОКНО === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity var(--transition);
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.3s ease-out;
}

.modal-content.modal-wide {
    max-width: 620px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-family: var(--font);
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    border: none;
    border-radius: 50%;
    font-size: 18px;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--danger);
    color: #ffffff;
}

.modal-body {
    padding: 24px;
}

/* === ПУСТОЙ СПИСОК === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state p:first-child {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

/* === УВЕДОМЛЕНИЯ (TOAST) === */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    animation: toastIn 0.3s ease-out;
    max-width: 360px;
}

.toast-success {
    background: linear-gradient(135deg, var(--success), #059669);
}

.toast-error {
    background: linear-gradient(135deg, var(--danger), #dc2626);
}

.toast-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* === CREDENTIALS BLOCK === */
.credentials-block {
    padding: 8px 0;
}

.credentials-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.credentials-label {
    font-weight: 500;
    color: var(--text-muted);
    min-width: 70px;
}

.credentials-value {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 15px;
    background: var(--bg-white);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.btn-copy {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 16px;
}

.btn-copy:hover {
    background: var(--brand);
    border-color: var(--brand);
}

.text-success {
    color: var(--success);
}

/* === EMPLOYEE CREDENTIALS === */
.employee-credentials {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 24px;
}

.employee-credential {
    display: flex;
    align-items: center;
    gap: 8px;
}

.credential-label {
    font-size: 13px;
    color: var(--text-muted);
}

.employee-credential code {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    background: var(--bg);
    padding: 4px 8px;
    border-radius: 4px;
}

/* === ACCESS LIST === */
.access-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px 0;
}

.access-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.access-item:hover {
    background: rgba(45, 80, 22, 0.1);
}

.access-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.access-item .text-muted {
    margin-left: auto;
    font-size: 12px;
}

/* === MODULE USERS === */
.module-users {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.module-users-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.module-users-label svg {
    flex-shrink: 0;
}

.module-users-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.user-tag {
    font-size: 12px;
    background: rgba(45, 80, 22, 0.1);
    color: var(--brand);
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

/* === CREDENTIAL COPY === */
.credential-copy {
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.credential-copy:hover {
    background: var(--brand);
    color: #ffffff;
}

.credential-hidden {
    letter-spacing: 2px;
}

/* === TOAST COPY === */
.toast-copy {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--brand);
    color: #ffffff;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    animation: toastIn 0.3s ease-out;
}

/* === CARD HEADER ACTIONS === */
.card-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* === BTN ICON DANGER === */
.btn-icon.btn-icon-danger {
    opacity: 0.5;
}

.btn-icon.btn-icon-danger:hover {
    opacity: 1;
    background: var(--danger) !important;
    border-color: var(--danger) !important;
}

.btn-icon.btn-icon-danger:hover svg {
    stroke: #ffffff !important;
}

/* === CARD ACTIONS SPLIT === */
.card-actions-split {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-actions-left {
    display: flex;
    gap: 8px;
}

/* === NOTIFY CONTAINER === */
.notify-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
}

/* === NOTIFY TOAST === */
.notify-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    pointer-events: auto;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 360px;
}

.notify-toast.show {
    transform: translateX(0);
}

.notify-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    flex-shrink: 0;
}

.notify-success .notify-icon { background: var(--success); }
.notify-error .notify-icon { background: var(--danger); }
.notify-warning .notify-icon { background: var(--warning); }
.notify-info .notify-icon { background: var(--brand); }

.notify-message {
    flex: 1;
    font-size: 14px;
    color: var(--text);
}

.notify-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.notify-close:hover {
    color: var(--text);
}

/* === NOTIFY OVERLAY === */
.notify-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.notify-overlay.show {
    opacity: 1;
}

/* === NOTIFY DIALOG === */
.notify-dialog {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 420px;
    width: 90%;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.notify-overlay.show .notify-dialog {
    transform: scale(1);
}

.notify-dialog-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.notify-dialog-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

.notify-dialog-body {
    padding: 20px 24px;
}

.notify-dialog-body p {
    margin: 0 0 16px 0;
    color: var(--text-light);
    line-height: 1.6;
}

.notify-dialog-body p:last-child {
    margin-bottom: 0;
}

.notify-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    margin-top: 8px;
    transition: border-color 0.3s ease;
}

.notify-input:focus {
    outline: none;
    border-color: var(--brand);
}

.notify-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px !important;
}

.notify-dialog-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* === EMPLOYEES GROUP === */
.employees-group {
    margin-bottom: 20px;
}

.employees-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-left: 4px;
}

.employees-group-header svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.employees-group-count {
    margin-left: 4px;
    color: var(--text-muted);
    font-weight: 400;
}

.employees-group-count::before {
    content: '·';
    margin-right: 4px;
}

.employees-group-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-left: 12px;
    border-left: 2px solid var(--brand);
}

.employees-group-unassigned .employees-group-cards {
    border-left-color: var(--border);
}

/* === Бейдж-перемикач статусу === */
.badge-toggle {
    cursor: pointer;
    border: none;
    font-family: inherit;
    transition: all 0.2s ease;
}

.badge-toggle:hover {
    opacity: 0.7;
    transform: scale(1.05);
}

.badge-muted {
    background: rgba(150, 150, 150, 0.15);
    color: #999;
}

/* Неактивна картка */
.card-inactive {
    opacity: 0.6;
}

.card-inactive:hover {
    opacity: 0.8;
}

/* Деактивовані група */
.employees-group-deactivated .employees-group-header {
    color: var(--text-muted);
}

.employees-group-deactivated .employees-group-cards {
    border-left-color: var(--text-muted);
}

.employees-deact-module {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.employees-deact-module:last-child {
    margin-bottom: 0;
}

.employees-deact-module-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}

/* File upload area */
.file-upload-wrapper {
    position: relative;
}

.file-upload-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
}

.file-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 20px;
    border: 2px dashed var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--brand);
    background: rgba(139, 92, 246, 0.05);
}

.file-upload-icon {
    font-size: 24px;
}

.file-upload-text {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

.file-upload-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.file-upload-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--brand);
    border-radius: 8px;
}

.file-upload-name {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}

.file-upload-remove {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.file-upload-remove:hover {
    color: var(--danger);
}

/* Report source modules */
.report-source-modules {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* Access management */
.access-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    gap: 8px;
}

.access-item-row:last-child {
    border-bottom: none;
}

.access-type-toggle {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.manager-config-block {
    padding: 10px 12px;
    background: var(--bg);
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

/* Manager tag */
.user-tag-manager {
    background: rgba(139, 92, 246, 0.1) !important;
    color: #7c3aed !important;
    border-color: rgba(139, 92, 246, 0.3) !important;
    font-weight: 600;
}

/* Manager block in module card */
.manager-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 4px;
}
.manager-subs {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 16px;
    border-left: 2px solid rgba(139, 92, 246, 0.3);
    margin-left: 8px;
    margin-top: 4px;
}

.user-tag-sm {
    font-size: 11px !important;
    padding: 2px 8px !important;
}

.badge-manager {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    vertical-align: middle;
}