/* =========================================
   Global
========================================= */
body {
    font-family: 'Cairo', sans-serif;
    background-color: #F4F5F7;
    color: #18181B;
    overflow: hidden;
}

/* =========================================
   Cards
========================================= */
.clean-card {
    background: #FFFFFF;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #E5E7EB;
}

/* =========================================
   Scrollbar
========================================= */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

.sidebar-scroll {
    scrollbar-width: thin;
    scrollbar-color: #D1D5DB transparent;
}

/* =========================================
   Loader
========================================= */
.loader {
    border-top-color: #673DE6;
    animation: spinner 1s linear infinite;
}

@keyframes spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* =========================================
   Sidebar Main
========================================= */
.nav-main-link {
    transition: all 0.2s ease;
    border-right: 3px solid transparent;
}

.nav-main-link.active-main {
    color: #673DE6;
    background-color: #F8FAFC;
    border-right-color: #673DE6;
}

/* =========================================
   Sidebar Sub
========================================= */
.nav-sub-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    border-radius: 0.5rem;
    color: #52525B;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
    text-decoration: none;
    user-select: none;
}

.nav-sub-link:hover {
    background-color: #E2E8F0;
    color: #18181B;
}

.nav-sub-link.active-sub {
    background-color: #F3F0FF;
    color: #673DE6;
}

.nav-sub-link svg {
    width: 1.25rem;
    height: 1.25rem;
    margin-left: 0.75rem;
    opacity: 0.8;
    flex-shrink: 0;
}

/* =========================================
   Inputs
========================================= */
input.edit-input,
select.edit-input,
textarea.edit-input {
    width: 100%;
    padding: 0.5rem 0.7rem;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    color: #18181B;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    outline: none;
}

input.edit-input:focus,
select.edit-input:focus,
textarea.edit-input:focus {
    background: #FFFFFF;
    border-color: #673DE6;
    box-shadow: 0 0 0 2px rgba(103, 61, 230, 0.1);
}

textarea.edit-input {
    resize: vertical;
    min-height: 42px;
}

/* =========================================
   Bulk inputs
========================================= */
.bulk-input {
    width: 100%;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 0.8rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bulk-input:focus {
    border-color: #673DE6;
    box-shadow: 0 0 0 2px rgba(103, 61, 230, 0.08);
}

/* =========================================
   Status badges
========================================= */
.badge-success {
    background-color: #D1FAE5;
    color: #059669;
}

.badge-danger {
    background-color: #FEE2E2;
    color: #DC2626;
}

.badge-warning {
    background-color: #FEF3C7;
    color: #D97706;
}

.badge-orange {
    background-color: #FFEDD5;
    color: #EA580C;
}

.badge-gray {
    background-color: #F3F4F6;
    color: #4B5563;
}

.badge-purple {
    background-color: #EDE9FE;
    color: #6D28D9;
}

/* =========================================
   Icons
========================================= */
.action-icon {
    cursor: pointer;
    color: #9CA3AF;
    transition: color 0.2s ease;
}

.action-icon:hover {
    color: #673DE6;
}

/* =========================================
   Tables
========================================= */
table {
    border-collapse: separate;
    border-spacing: 0;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 5;
}

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: #F9FAFB;
}

/* =========================================
   Buttons helpers
========================================= */
button {
    transition: all 0.2s ease;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =========================================
   Modals
========================================= */
#modalsContainer .fixed,
#crmModalsInjected .fixed {
    animation: fadeInModal 0.15s ease;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: scale(0.98);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* =========================================
   Toast container support
========================================= */
#toast-container > div {
    min-width: 220px;
    max-width: 360px;
    word-break: break-word;
}

/* =========================================
   Utility helpers
========================================= */
.font-mono {
    direction: ltr;
    unicode-bidi: plaintext;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}