/* --- HAMBURGER MENU TOGGLE & SPANS --- */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 20px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 0;
}

.nav-toggle span {
    display: block;
    width: 100%;
    height: 2.5px;
    background-color: var(--text-primary, #002b29);
    border-radius: 99px;
    transition: var(--transition-fast);
}

.nav-toggle.open span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

.drawer-header,
.drawer-footer {
    display: none !important;
}

.telegram-popup-card {
    display: none !important;
}

/* Explicit Close Button inside Drawer */
.drawer-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(0, 70, 67, 0.08);
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
    line-height: 1;
    padding: 0 0 2px 0;
}

.drawer-close-btn:hover {
    background: rgba(225, 29, 72, 0.15);
    border-color: rgba(225, 29, 72, 0.35);
    color: #e11d48;
}

/* --- BUTTONS --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 11px 22px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: var(--font-family, 'Poppins', sans-serif);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    white-space: nowrap;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #0a5c58 100%);
    color: #F0EDE5;
    box-shadow: 0 4px 16px rgba(0, 70, 67, 0.28);
    border: 1px solid rgba(240, 237, 229, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #003330 0%, #004643 100%);
    box-shadow: 0 6px 20px rgba(0, 70, 67, 0.38);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-secondary {
    background-color: var(--secondary);
    color: #F0EDE5;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(13, 110, 105, 0.24);
}

.btn-secondary:hover {
    background-color: var(--secondary-hover);
    box-shadow: 0 6px 18px rgba(13, 110, 105, 0.35);
    transform: translateY(-1px);
    color: #ffffff;
}

.btn-outline {
    background-color: #ffffff;
    border: 1.5px solid var(--border);
    color: var(--primary);
    box-shadow: 0 2px 6px rgba(0, 43, 41, 0.04);
}

.btn-outline:hover {
    background-color: var(--surface-hover);
    border-color: var(--primary);
    color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #be123c;
    color: #ffffff;
}

.btn-success {
    background-color: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background-color: #047857;
    color: #ffffff;
}

.btn-disabled {
    background-color: var(--surface-secondary) !important;
    border-color: var(--border) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

.btn-loading {
    position: relative;
    color: transparent !important;
    cursor: wait !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- CARDS --- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
}

.card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border);
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* --- FORM FIELDS --- */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    background-color: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 0.95rem;
    font-family: var(--font-family, 'Poppins', sans-serif);
    color: var(--text-primary);
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3.5px rgba(0, 70, 67, 0.14);
    outline: none;
}

/* Password Toggle Wrapper */
.password-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
}

.password-toggle:hover {
    color: var(--text-primary);
}

/* Custom Checkbox */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
    user-select: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-checkbox input {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.form-checkbox input:checked+.checkbox-custom {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-checkbox input:checked+.checkbox-custom::after {
    content: "✓";
    font-size: 11px;
    color: #F0EDE5;
    font-weight: bold;
}

/* Custom Toggle Switch */
.form-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    gap: var(--spacing-md);
}

.form-toggle input {
    display: none;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 22px;
    background-color: var(--border);
    border-radius: 99px;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.toggle-switch::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #ffffff;
    top: 2px;
    left: 2px;
    transition: var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.form-toggle input:checked+.toggle-switch {
    background-color: var(--primary);
}

.form-toggle input:checked+.toggle-switch::after {
    transform: translateX(22px);
}

.form-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

.form-control.is-invalid {
    border-color: var(--danger) !important;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(225, 29, 72, 0.15) !important;
}

/* --- BADGES --- */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1;
}

.badge-success {
    background-color: rgba(13, 130, 92, 0.12);
    color: #0d825c;
    border: 1px solid rgba(13, 130, 92, 0.25);
}

.badge-warning {
    background-color: rgba(217, 119, 6, 0.12);
    color: #d97706;
    border: 1px solid rgba(217, 119, 6, 0.25);
}

.badge-danger {
    background-color: rgba(225, 29, 72, 0.12);
    color: #e11d48;
    border: 1px solid rgba(225, 29, 72, 0.25);
}

.badge-info {
    background-color: rgba(0, 70, 67, 0.12);
    color: var(--primary);
    border: 1px solid rgba(0, 70, 67, 0.25);
}

.badge-neutral {
    background-color: var(--surface-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* --- TABLES --- */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    display: block;
}

.table {
    width: 100%;
    min-width: 700px !important;
    text-align: left;
    border-collapse: collapse;
}

.table th,
.table td {
    white-space: nowrap;
}

.table th:nth-child(2),
.table td:nth-child(2),
.table td.cell-wrap {
    white-space: normal !important;
    min-width: 200px !important;
}

.table th {
    background-color: var(--surface-secondary);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px 20px;
    border-bottom: 1.5px solid var(--border);
}

.table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
    font-size: 0.9rem;
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background-color: var(--surface-hover);
}

/* --- MODALS --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 43, 41, 0.45);
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 550px;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9);
    transition: var(--transition-normal);
    max-height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
    margin: auto;
    overflow: hidden;
}

.modal form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    margin: 0;
}

.modal-backdrop.show .modal {
    transform: scale(1);
}

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

.modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: var(--transition-fast);
}

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

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: var(--spacing-sm);
    background-color: var(--surface-secondary);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    flex-shrink: 0;
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    min-width: 300px;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transform: translateX(120%);
    transition: var(--transition-normal);
}

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

.toast-success {
    border-left-color: var(--success);
}

.toast-error {
    border-left-color: var(--danger);
}

.toast-warning {
    border-left-color: var(--warning);
}

.toast-info {
    border-left-color: var(--primary);
}

.toast-icon {
    font-size: 1.2rem;
    line-height: 1;
}

.toast-content {
    flex-grow: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 2px;
    color: var(--text-primary);
}

.toast-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
}

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

/* --- EMPTY STATE --- */
.empty-state {
    text-align: center;
    padding: var(--spacing-xxl) var(--spacing-lg);
}

.empty-state-icon {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
}

.empty-state-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

.empty-state-description {
    max-width: 400px;
    margin: 0 auto var(--spacing-lg) auto;
}

/* --- SKELETON / LOADERS --- */
.skeleton {
    background: linear-gradient(90deg, var(--surface-secondary) 25%, var(--border) 50%, var(--surface-secondary) 75%);
    background-size: 200% 100%;
    animation: loading-skeleton 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes loading-skeleton {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 14px;
    width: 100%;
    margin-bottom: 8px;
}

.skeleton-text.short {
    width: 60%;
}

.skeleton-rect {
    height: 80px;
    width: 100%;
}

/* --- PASSWORD STRENGTH METER --- */
.password-strength {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    height: 4px;
    width: 100%;
}

.strength-bar {
    flex-grow: 1;
    height: 100%;
    background-color: var(--border);
    border-radius: 99px;
    transition: background-color 0.2s ease;
}

.strength-text {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 4px;
    display: block;
}

/* --- LOGOUT CONFIRMATION MODAL --- */
.logout-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 43, 41, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    animation: logoutModalFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes logoutModalFadeIn {
    to {
        opacity: 1;
    }
}

.logout-modal-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 43, 41, 0.18);
    transform: scale(0.95);
    animation: logoutModalScaleUp 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes logoutModalScaleUp {
    to {
        transform: scale(1);
    }
}

.logout-modal-icon {
    width: 54px;
    height: 54px;
    background: rgba(225, 29, 72, 0.12);
    color: #e11d48;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 16px;
    border: 1px solid rgba(225, 29, 72, 0.25);
}

.logout-modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.logout-modal-text {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.4;
}

.logout-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.logout-modal-actions .btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
}