/* ── CRM System Custom Styles ── */

:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --primary-color: #3b82f6;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1040;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar .nav-link {
    border-radius: 0.5rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    transition: background-color 0.15s;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: var(--sidebar-hover);
}

#page-content-wrapper {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    background: #f1f5f9;
}

/* Module cards on dashboard */
.module-card {
    transition: transform 0.15s, box-shadow 0.15s;
    border-radius: 0.75rem;
}

.module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

/* Record rows */
.record-row:hover {
    background-color: #e8f0fe !important;
}

.status-pill {
    display: inline-flex;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.78rem;
}

.record-row.status-row--default {
    background-color: #ffffff;
}

.record-row.status-row--custom {
    background-color: var(--status-row-color, #ffffff);
}

.table > tbody > tr.record-row.status-row--default > td {
    background-color: #ffffff;
}

.table > tbody > tr.record-row.status-row--custom > td {
    background-color: var(--status-row-color, #ffffff) !important;
}

.record-row:hover.status-row--custom,
.record-row:hover.status-row--default {
    filter: brightness(0.98);
}

.table.table-hover > tbody > tr.record-row.status-row--custom:hover > td,
.table.table-hover > tbody > tr.record-row.status-row--default:hover > td {
    filter: brightness(0.98);
}

.js-status-select {
    min-width: 130px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Record cards (mobile) */
.record-card {
    cursor: pointer;
    border-radius: 0.75rem;
    transition: box-shadow 0.15s;
}

.record-card:hover {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Login page */
.login-page .card {
    border-radius: 1rem;
}

/* Table improvements */
.table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    font-weight: 600;
}

.table td {
    font-size: 0.9rem;
    vertical-align: middle;
}

/* Modal */
.modal-content {
    border: 0;
    border-radius: 1rem;
}

/* Cards */
.card {
    border-radius: 0.75rem;
}

/* Badges */
.badge {
    font-weight: 500;
}

/* Pagination */
.pagination .page-link {
    border-radius: 0.5rem;
    margin: 0 2px;
    border: none;
    color: #475569;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
}

/* ── MOBILE RESPONSIVE ── */
@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    #page-content-wrapper {
        margin-left: 0;
    }

    /* Table -> card transform handled via d-none d-md-block classes in template */
}

@media (min-width: 768px) {
    .d-md-none .navbar {
        display: none !important;
    }
}

/* Scrollbar styling (webkit) */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

/* Form controls in modals */
.modal .form-control-plaintext {
    border: 1px solid #e2e8f0;
}

/* Smooth transitions */
* {
    scroll-behavior: smooth;
}
