/* =========================================
   CRM DESIGN SYSTEM
   ========================================= */

:root {
    --sidebar-bg: #181a1f;
    --sidebar-hover: #25282f;
    --sidebar-active: #2d3138;
    --page-bg: #f6f7f9;
    --card-bg: #ffffff;
    --text-primary: #191c21;
    --text-secondary: #737983;
    --text-light: #a7abb2;
    --border: #e6e8eb;
    --accent: #3f8f68;
    --accent-dark: #327454;
    --accent-light: #eaf5ef;
    --danger: #d9534f;
    --warning: #d99a2b;
    --success: #3f8f68;
    --sidebar-width: 250px;
    --topbar-height: 72px;
    --radius: 10px;
}


/* =========================================
   GLOBAL
   ========================================= */

* {
    box-sizing: border-box;
}

html {
    font-size: 15px;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    background: var(--page-bg);
    color: var(--text-primary);
}

a {
    text-decoration: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
}


/* =========================================
   MAIN WRAPPER
   ========================================= */

.crm-wrapper {
    min-height: 100vh;
    display: flex;
}


/* =========================================
   SIDEBAR
   ========================================= */

.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width 0.25s ease;
}


/* =========================================
   LOGO
   ========================================= */

.sidebar-logo {
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 22px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    margin-right: 11px;
}

.logo-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.logo-subtitle {
    font-size: 10px;
    color: #8e939c;
    margin-top: 2px;
}


/* =========================================
   NAVIGATION
   ========================================= */

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    overflow-y: auto;
}

.nav-section {
    font-size: 10px;
    font-weight: 600;
    color: #777d87;
    letter-spacing: 1px;
    padding: 18px 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    height: 43px;
    padding: 0 12px;
    margin-bottom: 3px;
    color: #aeb3bb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

    .nav-item:hover {
        color: white;
        background: var(--sidebar-hover);
    }

    .nav-item.active {
        color: white;
        background: var(--sidebar-active);
    }

.nav-icon {
    width: 28px;
    font-size: 16px;
    color: #858b95;
    display: flex;
    justify-content: center;
    margin-right: 5px;
}

.nav-item.active .nav-icon {
    color: #72c59b;
}


/* =========================================
   MAIN AREA
   ========================================= */

.main-area {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease, width 0.25s ease;
}


/* =========================================
   TOPBAR
   ========================================= */

.topbar {
    height: var(--topbar-height);
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 18px;
}

.sidebar-toggle {
    border: none;
    background: transparent;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
    display: none;
}

.page-title {
    font-size: 17px;
    font-weight: 600;
}


/* =========================================
   TOPBAR RIGHT
   ========================================= */

.topbar-right {
    display: flex;
    align-items: center;
    gap: 22px;
}


/* =========================================
   NOTIFICATION
   ========================================= */

.notification-btn {
    position: relative;
    border: none;
    background: transparent;
    font-size: 20px;
    color: var(--text-secondary);
    cursor: pointer;
}

    .notification-btn:hover {
        color: var(--text-primary);
    }

.notification-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    background: #d9534f;
    border-radius: 50%;
    top: 1px;
    right: 0;
}


/* =========================================
   USER
   ========================================= */

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
}

.user-role {
    font-size: 10px;
    color: var(--text-secondary);
}


/* =========================================
   HEADER DIVIDER
   ========================================= */

.header-divider {
    width: 1px;
    height: 30px;
    background: var(--border);
}


/* =========================================
   HEADER LOGOUT
   ========================================= */

.logout-form {
    margin: 0;
    padding: 0;
}

.header-logout {
    padding: 7px 3px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
}

    .header-logout:hover {
        color: #c94b47;
    }


/* =========================================
   CONTENT
   ========================================= */

.content-area {
    flex: 1;
    padding: 30px;
}


/* =========================================
   COMMON CARD
   ========================================= */

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    margin-bottom: 20px;
}

.card-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 18px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}


/* =========================================
   DASHBOARD STAT CARDS
   ========================================= */

.dashboard-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    height: 145px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .dashboard-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.05);
    }

.dashboard-card-title {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
}

.dashboard-card-value {
    font-size: 28px;
    font-weight: 700;
    margin-top: 12px;
}

.dashboard-card-change {
    font-size: 11px;
    margin-top: 8px;
    color: var(--success);
}


/* =========================================
   BUTTONS
   ========================================= */

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    border-radius: 7px;
    font-size: 13px;
    padding: 9px 16px;
    font-weight: 500;
}

    .btn-primary:hover {
        background: var(--accent-dark);
        border-color: var(--accent-dark);
        color: white;
    }

.btn-secondary {
    border-radius: 7px;
    font-size: 13px;
}


/* =========================================
   FORMS
   ========================================= */

.form-control,
.form-select {
    border: 1px solid #dfe2e6;
    border-radius: 7px;
    min-height: 40px;
    font-size: 13px;
    padding: 8px 12px;
}

    .form-control:focus,
    .form-select:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(63,143,104,0.10);
    }

.form-label {
    font-size: 12px;
    font-weight: 600;
    color: #4f545c;
    margin-bottom: 7px;
}


/* =========================================
   TABLE
   ========================================= */

.table {
    margin-bottom: 0;
    font-size: 13px;
    vertical-align: middle;
}

    .table thead th {
        background: #fafafa;
        color: #737983;
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.4px;
        border-bottom: 1px solid var(--border);
        padding: 13px 15px;
    }

    .table tbody td {
        padding: 14px 15px;
        border-color: var(--border);
        color: #383c43;
    }

    .table tbody tr:hover {
        background: #fafbfc;
    }


/* =========================================
   STATUS BADGES
   ========================================= */

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
}

.status-success {
    background: #eaf5ef;
    color: #327454;
}

.status-warning {
    background: #fff6df;
    color: #a87413;
}

.status-danger {
    background: #fcebea;
    color: #b8403d;
}

.status-neutral {
    background: #f0f1f3;
    color: #686e77;
}


/* =========================================
   FOOTER
   ========================================= */

.crm-footer {
    min-height: 55px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #9297a0;
    font-size: 11px;
}


/* =========================================
   SIDEBAR COLLAPSE
   ========================================= */

.sidebar-collapsed .sidebar {
    width: 75px;
}

.sidebar-collapsed .main-area {
    margin-left: 75px;
    width: calc(100% - 75px);
}

.sidebar-collapsed .logo-title,
.sidebar-collapsed .logo-subtitle,
.sidebar-collapsed .nav-item span:not(.nav-icon),
.sidebar-collapsed .nav-section {
    display: none;
}

.sidebar-collapsed .sidebar-logo {
    justify-content: center;
    padding: 0;
}

.sidebar-collapsed .logo-icon {
    margin-right: 0;
}

.sidebar-collapsed .nav-item {
    justify-content: center;
}

.sidebar-collapsed .nav-icon {
    margin: 0;
}


/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 900px) {

    .sidebar {
        width: 75px;
    }

    .main-area {
        margin-left: 75px;
        width: calc(100% - 75px);
    }

    .logo-title,
    .logo-subtitle,
    .nav-item span:not(.nav-icon),
    .nav-section {
        display: none;
    }

    .sidebar-logo {
        justify-content: center;
        padding: 0;
    }

    .logo-icon {
        margin-right: 0;
    }

    .nav-item {
        justify-content: center;
    }

    .nav-icon {
        margin: 0;
    }

    .content-area {
        padding: 20px;
    }
}


/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 600px) {

    .sidebar {
        width: 0;
        overflow: hidden;
    }

    .main-area {
        margin-left: 0;
        width: 100%;
    }

    .sidebar-toggle {
        display: block;
    }

    .topbar {
        padding: 0 18px;
    }

    .content-area {
        padding: 15px;
    }

    .user-info {
        display: none;
    }

    .crm-footer {
        padding: 0 15px;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
    }
}

/* =========================================
   PROFESSIONAL DASHBOARD
   ========================================= */

.dashboard-page {
    max-width: 1500px;
    margin: 0 auto;
}

.dashboard-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 25px;
    margin-bottom: 25px;
}

.dashboard-eyebrow {
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.4px;
    margin-bottom: 6px;
}

.dashboard-header h1 {
    margin: 0;
    font-size: 25px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.4px;
}

.dashboard-header p {
    margin: 7px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.dashboard-date {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 9px 13px;
    min-width: 145px;
}

.dashboard-date-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-date small,
.dashboard-date strong {
    display: block;
}

.dashboard-date small {
    color: var(--text-secondary);
    font-size: 10px;
    margin-bottom: 2px;
}

.dashboard-date strong {
    font-size: 12px;
    font-weight: 600;
}

.dashboard-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.dashboard-kpi-card {
    min-height: 126px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform .2s ease, box-shadow .2s ease;
}

    .dashboard-kpi-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, .045);
    }

.dashboard-kpi-icon {
    width: 45px;
    height: 45px;
    flex: 0 0 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

    .dashboard-kpi-icon.green {
        background: #eaf5ef;
        color: #3f8f68;
    }

    .dashboard-kpi-icon.blue {
        background: #edf4fb;
        color: #477da8;
    }

    .dashboard-kpi-icon.purple {
        background: #f2eef9;
        color: #755e9e;
    }

    .dashboard-kpi-icon.orange {
        background: #fff4e8;
        color: #bd7830;
    }

.dashboard-kpi-content {
    min-width: 0;
}

    .dashboard-kpi-content span,
    .dashboard-kpi-content small {
        display: block;
    }

    .dashboard-kpi-content span {
        color: var(--text-secondary);
        font-size: 11px;
        font-weight: 500;
    }

    .dashboard-kpi-content strong {
        display: block;
        margin: 3px 0 2px;
        font-size: 27px;
        line-height: 1.05;
        font-weight: 700;
    }

    .dashboard-kpi-content small {
        color: #9a9fa7;
        font-size: 10px;
    }

.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, .85fr);
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 11px;
    overflow: hidden;
}

.dashboard-panel-header {
    min-height: 72px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

    .dashboard-panel-header h2 {
        margin: 0;
        font-size: 14px;
        font-weight: 650;
    }

    .dashboard-panel-header p {
        margin: 4px 0 0;
        color: var(--text-secondary);
        font-size: 11px;
    }

.dashboard-panel-header-icon {
    color: #a0a6ae;
    font-size: 18px;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 5px;
}

.overview-item {
    min-height: 75px;
    margin: 4px;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--text-primary);
    transition: background .2s ease;
}

    .overview-item:hover {
        background: #f8faf9;
    }

.overview-item-static {
    cursor: default;
}

.overview-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #f0f6f3;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    font-size: 14px;
}

.overview-item > span:nth-child(2) {
    min-width: 0;
    flex: 1;
}

.overview-item strong,
.overview-item small {
    display: block;
}

.overview-item strong {
    font-size: 15px;
    line-height: 1.1;
}

.overview-item small {
    color: var(--text-secondary);
    font-size: 10px;
    margin-top: 3px;
}

.overview-arrow {
    color: #a5abb1;
    font-size: 11px;
}

.quick-actions {
    padding: 8px 12px 12px;
}

.quick-action {
    min-height: 64px;
    padding: 9px 8px;
    display: flex;
    align-items: center;
    gap: 11px;
    color: var(--text-primary);
    border-bottom: 1px solid #f0f1f3;
}

    .quick-action:last-child {
        border-bottom: none;
    }

    .quick-action:hover {
        color: var(--text-primary);
        background: #fafcfb;
    }

.quick-action-icon {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 35px;
}

.quick-action > span:nth-child(2) {
    flex: 1;
    min-width: 0;
}

.quick-action strong,
.quick-action small {
    display: block;
}

.quick-action strong {
    font-size: 12px;
    font-weight: 600;
}

.quick-action small {
    color: var(--text-secondary);
    font-size: 10px;
    margin-top: 3px;
}

.quick-action > i:last-child {
    color: #a6abb1;
    font-size: 12px;
}

.recent-users-panel {
    margin-bottom: 0;
}

.dashboard-view-all {
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

    .dashboard-view-all:hover {
        color: var(--accent-dark);
    }

.dashboard-table-wrap {
    overflow-x: auto;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

    .dashboard-table th {
        padding: 11px 20px;
        background: #fafbfb;
        border-bottom: 1px solid var(--border);
        color: var(--text-secondary);
        font-size: 9px;
        font-weight: 650;
        letter-spacing: .55px;
        text-transform: uppercase;
        text-align: left;
        white-space: nowrap;
    }

    .dashboard-table td {
        padding: 12px 20px;
        border-bottom: 1px solid #f0f1f3;
        color: #4e545c;
        white-space: nowrap;
    }

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

    .dashboard-table tbody tr:hover {
        background: #fcfdfd;
    }

.table-user {
    display: flex;
    align-items: center;
    gap: 9px;
}

.table-user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}

.table-user strong {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
}

.dashboard-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 600;
}

    .dashboard-status > span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
    }

    .dashboard-status.active {
        color: #3f8f68;
    }

    .dashboard-status.inactive {
        color: #a1a5aa;
    }

.dashboard-empty {
    min-height: 170px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--text-secondary);
    text-align: center;
}

.dashboard-empty-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 3px;
    border-radius: 10px;
    background: #f0f6f3;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dashboard-empty strong {
    color: var(--text-primary);
    font-size: 12px;
}

.dashboard-empty span {
    font-size: 10px;
}

@media (max-width: 1100px) {
    .dashboard-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .content-area {
        padding: 20px 15px;
    }

    .dashboard-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .dashboard-date {
        width: 100%;
    }

    .dashboard-kpi-grid {
        grid-template-columns: 1fr;
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   ROLE DASHBOARD PLACEHOLDER
   ========================================================= */

.role-dashboard-placeholder {
    min-height: 260px;
    background: #ffffff;
    border: 1px solid #e2e7e4;
    border-radius: 18px;
    padding: 45px;
    display: flex;
    align-items: center;
    gap: 25px;
}

.role-dashboard-placeholder-icon {
    width: 72px;
    height: 72px;
    min-width: 72px;
    border-radius: 20px;
    background: #e8f5ee;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .role-dashboard-placeholder-icon i {
        color: #32835d;
        font-size: 30px;
    }

.role-dashboard-placeholder h1 {
    margin: 5px 0 8px;
    color: #17251f;
    font-size: 28px;
    font-weight: 700;
}

.role-dashboard-placeholder p {
    margin: 0;
    color: #718078;
    font-size: 14px;
    max-width: 650px;
}

@media (max-width: 600px) {
    .role-dashboard-placeholder {
        padding: 30px;
        align-items: flex-start;
        flex-direction: column;
    }
}

/* =========================================================
   CRUD PAGES
   ========================================================= */

.crud-page {
    max-width: 1500px;
    margin: 0 auto;
}

.crud-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.crud-eyebrow {
    color: var(--accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.3px;
    margin-bottom: 6px;
}

.crud-page-header h1 {
    margin: 0;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.crud-page-header p {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}


/* CREATE BUTTON */

.crud-create-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 15px;
    background: var(--accent);
    color: white;
    border: 1px solid var(--accent);
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    transition: all .2s ease;
}

    .crud-create-btn:hover {
        background: var(--accent-dark);
        border-color: var(--accent-dark);
        color: white;
        transform: translateY(-1px);
    }


/* CARD */

.crud-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 11px;
    overflow: hidden;
}

.crud-card-header {
    min-height: 68px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

    .crud-card-header h2 {
        margin: 0;
        font-size: 14px;
        font-weight: 650;
    }

    .crud-card-header span {
        display: block;
        margin-top: 4px;
        color: var(--text-secondary);
        font-size: 10px;
    }


/* TABLE */

.crud-table {
    margin: 0;
}

    .crud-table thead th {
        background: #fafbfb;
        padding: 12px 20px;
        color: var(--text-secondary);
        font-size: 10px;
        font-weight: 650;
        text-transform: uppercase;
        letter-spacing: .5px;
        border-bottom: 1px solid var(--border);
    }

    .crud-table tbody td {
        padding: 14px 20px;
        border-bottom: 1px solid #f0f1f3;
        vertical-align: middle;
    }

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

    .crud-table tbody tr {
        transition: background .15s ease;
    }

        .crud-table tbody tr:hover {
            background: #fafcfb;
        }


/* NAME */

.crud-name {
    display: flex;
    align-items: center;
    gap: 11px;
}

.crud-row-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
}

.crud-name strong,
.crud-name small {
    display: block;
}

.crud-name strong {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 600;
}

.crud-name small {
    color: var(--text-secondary);
    font-size: 10px;
    margin-top: 2px;
}


/* DESCRIPTION */

.crud-description {
    color: #646a72;
    font-size: 12px;
}


/* ACTIONS */

.actions-column {
    width: 180px;
    text-align: right !important;
}

.crud-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
}

.delete-form {
    display: inline;
    margin: 0;
}


/* ACTION BUTTON BASE */

.crud-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 68px;
    height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s ease;
}


/* EDIT */

.crud-edit-btn {
    background: #f0f7f3;
    color: #327454;
    border: 1px solid #d8ebdf;
}

    .crud-edit-btn:hover {
        background: var(--accent);
        color: white;
        border-color: var(--accent);
    }


/* DELETE */

.crud-delete-btn {
    background: #fff4f3;
    color: #c94b47;
    border: 1px solid #f2d8d6;
}

    .crud-delete-btn:hover {
        background: #d9534f;
        color: white;
        border-color: #d9534f;
    }


/* EMPTY STATE */

.crud-empty {
    min-height: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 5px;
    color: var(--text-secondary);
}

.crud-empty-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 5px;
    border-radius: 12px;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.crud-empty strong {
    color: var(--text-primary);
    font-size: 13px;
}

.crud-empty span {
    font-size: 11px;
}

.crud-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 7px 12px;
    background: var(--accent-light);
    color: var(--accent-dark);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

    .crud-empty-btn:hover {
        background: var(--accent);
        color: white;
    }


/* ERROR */

.crud-page .alert {
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 8px;
    font-size: 12px;
    margin-bottom: 18px;
}


/* RESPONSIVE */

@media (max-width: 700px) {

    .crud-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .crud-create-btn {
        width: 100%;
        justify-content: center;
    }

    .actions-column {
        width: auto;
    }

    .crud-action-btn {
        min-width: 34px;
        width: 34px;
        padding: 0;
    }

        .crud-action-btn span {
            display: none;
        }
}

/* =========================================================
   USERS PAGE
   ========================================================= */

.users-card-header {
    gap: 20px;
}

.user-list-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.user-search-form {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
}

.user-search-box {
    width: 245px;
    height: 34px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 11px;
    background: #fafbfb;
    border: 1px solid var(--border);
    border-radius: 6px;
}

    .user-search-box i {
        color: #9298a0;
        font-size: 13px;
    }

    .user-search-box input {
        width: 100%;
        border: none;
        outline: none;
        background: transparent;
        color: var(--text-primary);
        font-size: 11px;
    }

        .user-search-box input::placeholder {
            color: #a2a7ad;
        }

.user-search-btn {
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    color: #555c64;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s ease;
}

    .user-search-btn:hover {
        background: #f5f8f6;
        border-color: #cbded3;
        color: var(--accent-dark);
    }

.crud-export-btn {
    height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    color: #555c64;
    font-size: 11px;
    font-weight: 600;
    transition: all .18s ease;
}

    .crud-export-btn:hover {
        background: #f5f8f6;
        border-color: #cbded3;
        color: var(--accent-dark);
    }


/* USER AVATAR */

.user-row-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}


/* USER INFORMATION */

.user-email {
    color: #5e646c;
    font-size: 11px;
}

.user-username {
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 500;
}


/* ROLE */

.user-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    background: #f2f6fb;
    color: #55718b;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 600;
}

    .user-role-badge i {
        font-size: 10px;
    }


/* STATUS */

.user-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 600;
}

    .user-status > span {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
    }

    .user-status.active {
        color: #3f8f68;
    }

    .user-status.inactive {
        color: #969ba2;
    }


/* USERS TABLE */

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



/* =========================================================
   EMPLOYEES TABLE — COLUMN ALIGNMENT / READABILITY
   Keep the existing CRM design; give each column a stable
   minimum width so headers and action buttons never overlap.
   Horizontal scrolling stays inside the table container.
   ========================================================= */

.users-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.users-table {
    width: 100%;
    min-width: 1380px;
    table-layout: auto;
}

    .users-table th,
    .users-table td {
        white-space: nowrap;
        vertical-align: middle;
    }

    .users-table .col-employee-id {
        min-width: 125px;
    }

    .users-table .col-employee {
        min-width: 255px;
    }

    .users-table .col-role {
        min-width: 135px;
    }

    .users-table .col-tenant {
        min-width: 155px;
    }

    .users-table .col-department {
        min-width: 150px;
    }

    .users-table .col-business-unit {
        min-width: 165px;
    }

    .users-table .col-status {
        min-width: 105px;
    }

    .users-table .col-last-login {
        min-width: 155px;
        width: 155px;
    }

    .users-table .col-actions {
        min-width: 285px;
        width: 285px;
        padding-right: 20px;
    }

        .users-table .col-actions .crud-actions {
            display: flex;
            align-items: center;
            justify-content: flex-start;
            gap: 7px;
            flex-wrap: nowrap;
            white-space: nowrap;
        }

            .users-table .col-actions .crud-actions form {
                display: inline-flex;
                flex: 0 0 auto;
                margin: 0;
                padding: 0;
            }

        .users-table .col-actions .crud-action-btn {
            flex: 0 0 auto;
            white-space: nowrap;
        }

@media (max-width: 1200px) {
    .users-table {
        min-width: 1380px;
    }
}

@media (max-width: 700px) {
    .users-table-wrap {
        margin-left: 0;
        margin-right: 0;
    }

    .users-table {
        min-width: 1180px;
    }

        .users-table .col-actions {
            min-width: 250px;
            width: 250px;
        }
}


/* RESPONSIVE */

@media (max-width: 1100px) {

    .users-card-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-list-actions {
        width: 100%;
        flex-wrap: wrap;
    }
}

@media (max-width: 650px) {

    .user-list-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .user-search-form {
        width: 100%;
    }

    .user-search-box {
        flex: 1;
        width: auto;
    }

    .crud-export-btn,
    .user-search-btn {
        justify-content: center;
    }
}
/* =========================================================
   DELETE CONFIRMATION MODAL
   ========================================================= */

.delete-modal {
    border: none;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

    .delete-modal .modal-body {
        padding: 30px;
        text-align: center;
    }

.delete-modal-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 15px;
    border-radius: 12px;
    background: #fff1f0;
    color: #d9534f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.delete-modal h4 {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 700;
}

.delete-modal p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
}

    .delete-modal p strong {
        color: var(--text-primary);
        font-weight: 600;
    }

.delete-modal small {
    display: block;
    margin-top: 7px;
    color: #a0a5ab;
    font-size: 10px;
}

.delete-modal-actions {
    display: flex;
    justify-content: center;
    gap: 9px;
    margin-top: 24px;
}

.delete-cancel-btn {
    height: 36px;
    padding: 0 17px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: white;
    color: #5f656c;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

    .delete-cancel-btn:hover {
        background: #f7f8f9;
    }

.delete-confirm-btn {
    height: 36px;
    padding: 0 17px;
    border: 1px solid #d9534f;
    border-radius: 7px;
    background: #d9534f;
    color: white;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

    .delete-confirm-btn:hover {
        background: #c74743;
        border-color: #c74743;
    }

/* =========================================================
   CRM ALERT
   ========================================================= */

.crud-page .alert-danger {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    margin-bottom: 18px;
    padding: 12px 15px;
    background: #fff5f4;
    border: 1px solid #f2cfcc;
    border-radius: 8px;
    color: #b8403d;
    font-size: 12px;
}

    .crud-page .alert-danger i {
        font-size: 15px;
        flex-shrink: 0;
    }

/* VIEW ACTION */

.crud-view-btn {
    background: #f3f6f8;
    color: #566873;
    border: 1px solid #dce3e7;
}

    .crud-view-btn:hover {
        background: #e8eef1;
        color: #3f525d;
        border-color: #ccd7dc;
    }

/* Super Admin internal-page enhancements — preserves the existing CRM theme. */
.sa-toolbar {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap
}

    .sa-toolbar form {
        align-items: center
    }

.sa-report-nav {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    margin: 0 0 1rem
}

    .sa-report-nav a {
        display: inline-flex;
        align-items: center;
        padding: .55rem .8rem;
        border: 1px solid #e5e7eb;
        border-radius: .6rem;
        text-decoration: none;
        color: inherit;
        background: #fff
    }

        .sa-report-nav a:hover, .sa-report-nav a.active {
            background: #f4f7fb;
            border-color: #cfd8e3
        }

@media (max-width: 900px) {
    .sa-toolbar {
        width: 100%
    }

        .sa-toolbar form {
            width: 100%
        }

            .sa-toolbar form .form-control, .sa-toolbar form .form-select {
                min-width: 150px;
                flex: 1
            }

    .crud-actions {
        flex-wrap: wrap
    }
}

@media print {
    .sidebar, .topbar, .crm-footer, .crud-page-header .btn, .crud-create-btn, .sa-toolbar, .sa-report-nav, .crud-actions {
        display: none !important
    }

    .main-area {
        margin: 0 !important
    }

    .content-area {
        padding: 0 !important
    }

    .crud-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important
    }
}


/* =========================================================
   SUPER ADMIN DESIGN SYSTEM — BALANCED SAAS LAYOUT
   Existing green/white/light-gray CRM identity preserved.
   ========================================================= */

:root {
    --sa-page-max: 1500px;
    --sa-border: #e4e8e6;
    --sa-muted: #707780;
    --sa-surface: #ffffff;
    --sa-soft: #f7faf8;
}

/* Content width and rhythm */
.content-area {
    padding: 28px 30px 24px;
    min-width: 0;
}

.crud-page, .dashboard-page {
    width: 100%;
    max-width: var(--sa-page-max);
    margin: 0 auto;
}

.crud-page-header {
    margin-bottom: 26px;
}

    .crud-page-header h1 {
        font-size: 26px;
        line-height: 1.2;
    }

    .crud-page-header p {
        max-width: 760px;
        line-height: 1.55;
    }

/* Consistent cards */
.crud-card, .dashboard-panel {
    border: 1px solid var(--sa-border);
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(22,34,28,.025);
}

.crud-card-header {
    min-height: 72px;
    padding: 16px 20px;
    gap: 20px;
}

    .crud-card-header > div:first-child {
        min-width: 180px;
    }

    .crud-card-header h2 {
        font-size: 14px;
        line-height: 1.35;
    }

    .crud-card-header span {
        line-height: 1.4;
    }

/* Filter/export area: never force everything into one crowded row */
.sa-toolbar {
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

    .sa-toolbar form {
        flex: 1 1 760px;
        display: grid !important;
        grid-template-columns: repeat(3,minmax(160px,1fr));
        gap: 12px !important;
        align-items: end !important;
        margin: 0;
    }

        .sa-toolbar form .form-control,
        .sa-toolbar form .form-select {
            width: 100%;
            min-width: 0;
        }

        .sa-toolbar form button,
        .sa-toolbar form > a {
            align-self: end;
        }

.sa-export-toolbar {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    flex-wrap: wrap;
    padding: 2px 0;
}

.sa-export-label {
    color: #8a9097;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .65px;
    text-transform: uppercase;
    margin-right: 2px;
}

.sa-export-btn {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid #dfe5e2;
    border-radius: 7px;
    background: #fff;
    color: #4f5752;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    transition: .18s ease;
}

    .sa-export-btn:hover {
        background: #f5f9f6;
        border-color: #cbdcd2;
        color: #2f6e50;
    }

.sa-filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

    .sa-filter-actions .btn {
        min-height: 40px;
    }

/* Responsive tables: scroll the table, not the browser */
.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.crud-table {
    width: 100%;
    min-width: 1410px;
    table-layout: fixed;
}

    .crud-table th, .crud-table td {
        padding: 14px 16px;
        vertical-align: middle;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .crud-table th {
        height: 46px;
    }

    .crud-table tbody td {
        height: 60px;
    }

    .crud-table th:first-child, .crud-table td:first-child {
        min-width: 230px;
    }

    .crud-table .actions-column,
    .crud-table th:last-child, .crud-table td:last-child {
        min-width: 330px;
        width: 330px;
        white-space: nowrap;
    }

.crud-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    flex-wrap: nowrap;
    white-space: nowrap;
}

    .crud-actions form {
        margin: 0;
        display: inline-flex;
    }

.crud-action-btn {
    min-width: 70px;
    height: 34px;
    padding: 0 11px;
    border-radius: 7px;
}

.crud-table tbody tr:hover {
    background: #f9fcfa;
}

/* User identity block — name and username are always separated */
.user-info-block, .user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name, .user-username, .user-email {
    display: block;
}

.user-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
}

.user-username {
    font-size: 10px;
    color: #8a9097;
    font-weight: 500;
    margin-top: 3px;
    line-height: 1.35;
}

.user-email {
    font-size: 10px;
    color: #697078;
    margin-top: 2px;
    line-height: 1.35;
}

.user-row-avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
}

.crud-name {
    gap: 12px;
    min-width: 0;
}

    .crud-name > div:last-child {
        min-width: 0;
    }

/* Buttons */
.crud-create-btn, .btn-primary {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 7px;
    font-weight: 650;
}

.btn-secondary, .btn-outline-secondary, .btn-outline-primary, .btn-outline-success {
    min-height: 40px;
    border-radius: 7px;
}

.crud-action-btn:focus, .sa-export-btn:focus, .btn:focus,
.form-control:focus, .form-select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(63,143,104,.12);
}

.crud-delete-btn {
    min-width: 92px;
}

/* Status */
.status-badge, .user-status {
    white-space: nowrap;
}

.user-status {
    padding: 5px 9px;
    border-radius: 999px;
    background: #f1f7f3;
}

    .user-status.inactive {
        background: #f1f2f3;
    }

/* Empty states should be compact, not giant */
.crud-empty {
    min-height: 185px;
    padding: 28px 20px;
}

.dashboard-empty {
    min-height: 150px;
}

/* Forms */
.crud-form-card {
    width: 100%;
    max-width: 1050px;
    margin: 0 auto;
}

.form-section {
    padding: 4px 0 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid #edf0ee;
}

    .form-section:last-of-type {
        border-bottom: 0;
        margin-bottom: 0;
    }

.form-section-title {
    margin: 0 0 16px;
    font-size: 14px;
    font-weight: 700;
    color: #242a27;
}

.form-section-subtitle {
    margin: -9px 0 16px;
    color: #7a817c;
    font-size: 11px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 18px 20px;
}

.form-group {
    min-width: 0;
}

    .form-group.span-2 {
        grid-column: 1 / -1;
    }

.form-label {
    display: block;
    margin-bottom: 7px;
    font-size: 11px;
    font-weight: 650;
}

.form-control, .form-select {
    min-height: 42px;
    border-radius: 7px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    padding-top: 4px;
}

/* Permission cards */
.permission-grid {
    display: grid;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 12px;
}

.permission-card {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 13px;
    border: 1px solid #e4e9e6;
    border-radius: 9px;
    background: #fbfdfc;
    transition: .18s ease;
}

    .permission-card:hover {
        border-color: #cfe0d6;
        background: #f7fbf8;
    }

.permission-group-title {
    grid-column: 1 / -1;
    margin: 10px 0 -3px;
    color: #6d756f;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .75px;
    text-transform: uppercase;
}

.permission-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

/* Dashboard balance */
.dashboard-main-grid {
    grid-template-columns: minmax(0,1.35fr) minmax(330px,.65fr);
    gap: 20px;
}

.dashboard-kpi-grid {
    grid-template-columns: repeat(5,minmax(0,1fr));
    gap: 16px;
}

.dashboard-kpi-card {
    min-height: 122px;
}

.dashboard-table-wrap {
    overflow-x: auto;
}

.dashboard-table {
    min-width: 720px;
}

    .dashboard-table th, .dashboard-table td {
        padding-left: 18px;
        padding-right: 18px;
    }

.dashboard-section-gap {
    margin-top: 20px;
}

/* Reports */
.sa-report-nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 0 0 18px;
    padding: 5px;
    border: 1px solid var(--sa-border);
    border-radius: 10px;
    background: #fff;
}

    .sa-report-nav a {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        padding: 0 12px;
        border: 1px solid transparent;
        border-radius: 7px;
        color: #5c645f;
        font-size: 11px;
        font-weight: 600;
    }

        .sa-report-nav a:hover, .sa-report-nav a.active {
            background: #eef7f1;
            border-color: #d4e7dc;
            color: #327454;
        }

.report-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.report-kpi {
    min-height: 108px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--sa-border);
    border-radius: 11px;
}

    .report-kpi span {
        display: block;
        color: #727a74;
        font-size: 11px;
        font-weight: 600;
    }

    .report-kpi strong {
        display: block;
        margin-top: 8px;
        font-size: 25px;
        line-height: 1;
        font-weight: 750;
    }

.report-grid-2 {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 20px;
}

/* Notifications */
.notification-list {
    padding: 8px;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 15px 14px;
    border-bottom: 1px solid #edf0ee;
    border-radius: 8px;
}

    .notification-item:last-child {
        border-bottom: 0;
    }

    .notification-item.unread {
        background: #f4faf6;
    }

.notification-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eaf5ef;
    color: #327454;
}

.notification-content {
    min-width: 0;
    flex: 1;
}

    .notification-content strong {
        display: block;
        font-size: 12px;
    }

    .notification-content p {
        margin: 4px 0;
        color: #565e58;
        font-size: 12px;
        line-height: 1.45;
    }

    .notification-content small {
        color: #929892;
        font-size: 10px;
    }

/* Chat */
.chat-layout {
    display: grid;
    grid-template-columns: minmax(250px,320px) minmax(0,1fr);
    gap: 18px;
    min-height: 560px;
}

.chat-card {
    height: 100%;
    overflow: hidden;
}

.chat-contacts {
    padding: 8px;
}

.chat-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px;
    border-radius: 8px;
    color: #303732;
}

    .chat-contact:hover {
        background: #f6faf7;
    }

    .chat-contact.active {
        background: #edf7f1;
        color: #2f6f50;
    }

.chat-contact-avatar {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eaf5ef;
    color: #327454;
    font-weight: 700;
    font-size: 11px;
}

.chat-contact-info {
    min-width: 0;
    flex: 1;
}

    .chat-contact-info strong, .chat-contact-info small {
        display: block;
    }

    .chat-contact-info strong {
        font-size: 12px;
    }

    .chat-contact-info small {
        margin-top: 3px;
        color: #89908a;
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.chat-window {
    min-height: 410px;
    max-height: 500px;
    overflow: auto;
    padding: 18px !important;
    background: #fbfcfb;
    border: 1px solid #e4e9e6 !important;
    border-radius: 9px !important;
}

.chat-bubble {
    max-width: min(75%,620px);
    padding: 10px 12px;
    border-radius: 10px;
}

    .chat-bubble.mine {
        background: #3f8f68;
        color: #fff;
    }

    .chat-bubble.theirs {
        background: #fff;
        border: 1px solid #e3e8e5;
    }

    .chat-bubble small {
        display: block;
        margin-top: 5px;
        opacity: .7;
        font-size: 9px;
    }

/* Tenant/settings detail cards */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 18px;
}

.detail-list {
    margin: 0;
}

    .detail-list > div {
        display: grid;
        grid-template-columns: 150px minmax(0,1fr);
        gap: 14px;
        padding: 11px 0;
        border-bottom: 1px solid #eef1ef;
    }

        .detail-list > div:last-child {
            border-bottom: 0;
        }

.detail-label {
    color: #7b827d;
    font-size: 11px;
    font-weight: 600;
}

.detail-value {
    color: #303632;
    font-size: 12px;
    min-width: 0;
    word-break: break-word;
}

/* Print */
@media print {
    @page {
        margin: 14mm;
    }

    body {
        background: #fff !important;
        color: #111 !important;
    }

    .sidebar, .topbar, .crm-footer, .sidebar-toggle,
    .crud-page-header .crud-create-btn, .crud-page-header form,
    .sa-toolbar, .sa-report-nav, .sa-export-toolbar, .crud-actions,
    .no-print, .btn {
        display: none !important;
    }

    .main-area {
        width: 100% !important;
        margin: 0 !important;
    }

    .content-area {
        padding: 0 !important;
    }

    .crud-page, .dashboard-page {
        max-width: none !important;
    }

    .crud-card, .dashboard-panel, .report-kpi {
        box-shadow: none !important;
        border: 1px solid #cfcfcf !important;
        break-inside: avoid;
    }

    .table-responsive {
        overflow: visible !important;
    }

    .crud-table, .dashboard-table {
        min-width: 0 !important;
        width: 100% !important;
    }

        .crud-table th, .crud-table td, .dashboard-table th, .dashboard-table td {
            white-space: normal !important;
            color: #111 !important;
        }

            .crud-table th:last-child, .crud-table td:last-child {
                display: none !important;
            }

    a {
        color: #111 !important;
        text-decoration: none !important;
    }
}

/* Responsive balance */
@media (max-width:1200px) {
    .sa-toolbar form {
        grid-template-columns: repeat(2,minmax(180px,1fr));
    }

    .dashboard-kpi-grid, .report-kpi-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .permission-grid {
        grid-template-columns: repeat(2,minmax(0,1fr));
    }
}

@media (max-width:900px) {
    .content-area {
        padding: 22px 20px;
    }

    .sa-toolbar form {
        grid-template-columns: repeat(2,minmax(0,1fr));
        flex-basis: 100%;
    }

    .sa-export-toolbar {
        width: 100%;
    }

    .report-grid-2, .detail-grid {
        grid-template-columns: 1fr;
    }

    .chat-layout {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .chat-card {
        height: auto;
    }
}

@media (max-width:650px) {
    .content-area {
        padding: 18px 15px;
    }

    .crud-page-header {
        align-items: flex-start;
        gap: 14px;
    }

        .crud-page-header .crud-create-btn {
            width: 100%;
        }

    .sa-toolbar form {
        grid-template-columns: 1fr;
    }

    .sa-export-toolbar {
        display: grid;
        grid-template-columns: repeat(2,minmax(0,1fr));
    }

    .sa-export-label {
        grid-column: 1 / -1;
    }

    .sa-export-btn {
        width: 100%;
    }

    .dashboard-kpi-grid, .report-kpi-grid, .permission-grid {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-group.span-2 {
        grid-column: auto;
    }

    .detail-list > div {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .crud-table {
        min-width: 980px;
    }

    .crud-actions {
        justify-content: flex-start;
    }

    .chat-layout {
        grid-template-columns: 1fr;
    }

    .chat-window {
        min-height: 320px;
    }
}


/* =========================================================
   SUPER ADMIN / TENANT REGISTRATION POLISH
   ========================================================= */
.sa-page-shell {
    padding-bottom: 20px;
}

.tenant-table-wrapper {
    border-radius: 0 0 12px 12px;
}

.sa-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    background: #f1f4f2;
    color: #56615b;
}

    .sa-status-badge.pending {
        background: #fff6df;
        color: #80651f;
    }

    .sa-status-badge.active {
        background: #edf7f1;
        color: #327454;
    }

    .sa-status-badge.inactive, .sa-status-badge.rejected {
        background: #f3f3f3;
        color: #686e6a;
    }

    .sa-status-badge.suspended {
        background: #f8eeee;
        color: #7a4a4a;
    }

.tenant-code-value {
    font-size: 18px !important;
    letter-spacing: .2px;
}

.detail-status {
    font-size: 18px !important;
}

.public-registration-page {
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px;
}

.registration-card {
    width: 100%;
    max-width: 620px;
    background: #fff;
    border: 1px solid #e4e8e6;
    border-radius: 16px;
    box-shadow: 0 12px 35px rgba(25,40,32,.07);
    padding: 30px;
}

.registration-card-wide {
    max-width: 900px;
}

.registration-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

    .registration-brand .logo-icon {
        width: 36px;
        height: 36px;
        border-radius: 9px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #3f8f68;
        color: #fff;
        font-weight: 800;
    }

    .registration-brand strong, .registration-brand span {
        display: block;
    }

    .registration-brand strong {
        font-size: 15px;
    }

    .registration-brand span {
        font-size: 10px;
        color: #7b837e;
        margin-top: 2px;
    }

.registration-steps {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 6px;
    margin-bottom: 28px;
}

    .registration-steps span {
        padding: 9px 6px;
        text-align: center;
        border: 1px solid #e5eae7;
        border-radius: 8px;
        color: #8a918c;
        font-size: 9px;
        font-weight: 700;
    }

        .registration-steps span.active {
            background: #edf7f1;
            border-color: #cfe3d6;
            color: #327454;
        }

        .registration-steps span.done {
            background: #f7faf8;
            color: #4d6b5b;
        }

.registration-heading {
    margin-bottom: 22px;
}

    .registration-heading h1 {
        margin: 5px 0 7px;
        font-size: 26px;
        line-height: 1.2;
        color: #252b28;
    }

    .registration-heading p {
        margin: 0;
        color: #727a74;
        font-size: 12px;
        line-height: 1.55;
    }

.registration-note {
    margin: 16px 0 0;
    padding: 11px 12px;
    border: 1px solid #e7ece9;
    border-radius: 9px;
    background: #f8faf9;
    color: #68716b;
    font-size: 10px;
    line-height: 1.5;
}

    .registration-note i {
        margin-right: 5px;
        color: #327454;
    }

.verification-input {
    text-align: center;
    letter-spacing: 8px;
    font-size: 22px;
    font-weight: 700;
}

.verified-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 7px;
    border-radius: 999px;
    background: #edf7f1;
    color: #327454;
    font-size: 9px;
    font-weight: 700;
}

.review-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

    .review-grid section {
        border: 1px solid #e6ebe8;
        border-radius: 11px;
        padding: 18px;
    }

    .review-grid h2 {
        font-size: 13px;
        margin: 0 0 10px;
    }

.terms-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 13px;
    border: 1px solid #e4e9e6;
    border-radius: 9px;
    background: #fbfdfc;
}

    .terms-box label {
        font-size: 11px;
        color: #4e5651;
    }

.success-registration-card {
    max-width: 620px;
    text-align: center;
}

.success-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #edf7f1;
    color: #327454;
    font-size: 28px;
}

.success-summary {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 10px;
    margin: 20px 0;
    text-align: left;
}

    .success-summary div {
        padding: 13px;
        border: 1px solid #e5eae7;
        border-radius: 9px;
    }

    .success-summary span, .success-summary strong {
        display: block;
    }

    .success-summary span {
        font-size: 9px;
        color: #8a918c;
        text-transform: uppercase;
        letter-spacing: .5px;
        font-weight: 700;
    }

    .success-summary strong {
        margin-top: 5px;
        font-size: 12px;
        color: #303732;
    }

@media(max-width:700px) {
    .registration-card {
        padding: 22px 18px;
    }

    .registration-steps {
        grid-template-columns: 1fr 1fr;
    }

    .review-grid, .success-summary {
        grid-template-columns: 1fr;
    }

    .public-registration-page {
        align-items: flex-start;
        padding-top: 18px;
    }

    .registration-heading h1 {
        font-size: 22px;
    }
}

.user-code {
    display: block;
    font-size: 9px;
    color: #6d756f;
    font-weight: 700;
    margin-top: 2px;
    letter-spacing: .3px;
}
/* =========================================================
   FINAL GLOBAL POLISH
   Professional buttons, forms, page alignment and spacing
   ========================================================= */

/* ---------- Shared page alignment ---------- */

.content-area {
    width: 100%;
    min-width: 0;
}

.dashboard-page,
.crud-page {
    width: 100%;
    max-width: 1500px;
    margin-left: auto;
    margin-right: auto;
}

.crud-form-card {
    width: 100%;
    max-width: 1050px;
    margin-left: auto;
    margin-right: auto;
}


/* ---------- Professional button foundation ---------- */

.btn,
button.btn,
input[type="submit"].btn,
input[type="button"].btn {
    min-height: 42px;
    padding: 0 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .15s ease;
}

    .btn:hover {
        text-decoration: none;
    }

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

    .btn:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(63, 143, 104, .14);
    }


/* ---------- Primary: Save / Create / Update / Submit ---------- */

.btn-primary,
.btn-create,
.btn-save,
.btn-update,
.crud-create-btn {
    background: #3f8f68;
    color: #ffffff;
    border: 1px solid #3f8f68;
    box-shadow: 0 2px 5px rgba(63, 143, 104, .14);
}

    .btn-primary:hover,
    .btn-create:hover,
    .btn-save:hover,
    .btn-update:hover,
    .crud-create-btn:hover {
        background: #327454;
        color: #ffffff;
        border-color: #327454;
        box-shadow: 0 4px 10px rgba(63, 143, 104, .20);
        transform: translateY(-1px);
    }


/* ---------- Cancel / Back / Close ---------- */

.btn-secondary,
.btn-cancel,
.btn-back,
.btn-outline-secondary {
    background: #ffffff;
    color: #4d565f;
    border: 1px solid #cfd5da;
    box-shadow: 0 1px 2px rgba(20, 30, 25, .03);
}

    .btn-secondary:hover,
    .btn-cancel:hover,
    .btn-back:hover,
    .btn-outline-secondary:hover {
        background: #f8faf9;
        color: #283039;
        border-color: #aeb7be;
        box-shadow: 0 4px 9px rgba(20, 30, 25, .07);
        transform: translateY(-1px);
    }


/* ---------- Reset ---------- */

.btn-reset {
    background: #f5f6f7;
    color: #59626b;
    border: 1px solid #d7dce0;
}

    .btn-reset:hover {
        background: #eceff1;
        color: #303840;
        border-color: #c0c7cd;
        box-shadow: 0 3px 8px rgba(20, 30, 25, .06);
        transform: translateY(-1px);
    }


/* ---------- Success / Approve / Confirm ---------- */

.btn-success {
    background: #3f8f68;
    color: #ffffff;
    border: 1px solid #3f8f68;
    box-shadow: 0 2px 5px rgba(63, 143, 104, .14);
}

    .btn-success:hover {
        background: #327454;
        color: #ffffff;
        border-color: #327454;
        box-shadow: 0 4px 10px rgba(63, 143, 104, .20);
        transform: translateY(-1px);
    }


/* ---------- Danger / Delete / Reject ---------- */

.btn-danger {
    background: #d9534f;
    color: #ffffff;
    border: 1px solid #d9534f;
    box-shadow: 0 2px 5px rgba(217, 83, 79, .12);
}

    .btn-danger:hover {
        background: #c74743;
        color: #ffffff;
        border-color: #c74743;
        box-shadow: 0 4px 10px rgba(217, 83, 79, .18);
        transform: translateY(-1px);
    }

.btn-outline-danger {
    background: #ffffff;
    color: #c94b47;
    border: 1px solid #e2b9b7;
}

    .btn-outline-danger:hover {
        background: #fff5f4;
        color: #b8403d;
        border-color: #d9534f;
    }


/* ---------- Search / Filter ---------- */

.btn-search,
.user-search-btn {
    min-height: 40px;
    background: #3f8f68;
    color: #ffffff;
    border: 1px solid #3f8f68;
    border-radius: 8px;
    font-weight: 600;
}

    .btn-search:hover,
    .user-search-btn:hover {
        background: #327454;
        color: #ffffff;
        border-color: #327454;
    }


/* ---------- Export ---------- */

.btn-export,
.crud-export-btn,
.sa-export-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 13px;
    background: #ffffff;
    color: #4f5752;
    border: 1px solid #d7dfdb;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

    .btn-export:hover,
    .crud-export-btn:hover,
    .sa-export-btn:hover {
        background: #f5f9f6;
        color: #2f6e50;
        border-color: #bfd3c7;
        box-shadow: 0 3px 8px rgba(30, 60, 45, .06);
    }


/* ---------- View ---------- */

.btn-view,
.crud-view-btn {
    background: #f3f6f8;
    color: #566873;
    border: 1px solid #dce3e7;
}

    .btn-view:hover,
    .crud-view-btn:hover {
        background: #e8eef1;
        color: #3f525d;
        border-color: #ccd7dc;
        transform: translateY(-1px);
    }


/* ---------- CRUD action buttons ---------- */

.crud-action-btn {
    min-width: 72px;
    min-height: 35px;
    height: 35px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 7px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .15s ease;
}

.crud-edit-btn {
    background: #f0f7f3;
    color: #327454;
    border: 1px solid #d2e7da;
}

    .crud-edit-btn:hover {
        background: #3f8f68;
        color: #ffffff;
        border-color: #3f8f68;
        transform: translateY(-1px);
    }

.crud-delete-btn {
    min-width: 82px;
    background: #fff4f3;
    color: #c94b47;
    border: 1px solid #f0d2d0;
}

    .crud-delete-btn:hover {
        background: #d9534f;
        color: #ffffff;
        border-color: #d9534f;
        transform: translateY(-1px);
    }


/* ---------- Form action area ---------- */

.form-actions,
.button-group,
.btn-group-custom {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.form-actions {
    padding-top: 20px;
    border-top: 1px solid #edf0ee;
}


/* ---------- Back button placement ---------- */

.page-back {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

    .page-back .btn-back {
        min-height: 40px;
        padding: 0 15px;
    }


/* ---------- Forms ---------- */

.form-control,
.form-select {
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid #dfe3e7;
    border-radius: 8px;
    background: #ffffff;
    color: #191c21;
    font-size: 13px;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

    .form-control:hover,
    .form-select:hover {
        border-color: #c8ced3;
    }

    .form-control:focus,
    .form-select:focus {
        border-color: #3f8f68;
        outline: none;
        background: #ffffff;
        box-shadow: 0 0 0 3px rgba(63, 143, 104, .10);
    }

.form-label {
    display: block;
    margin-bottom: 7px;
    color: #4f545c;
    font-size: 12px;
    font-weight: 600;
}


/* ---------- Disabled ---------- */

.btn:disabled,
button:disabled,
.crud-action-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}


/* ---------- Mobile ---------- */

@media (max-width: 700px) {

    .content-area {
        padding: 20px 15px;
    }

    .crud-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .crud-create-btn {
        width: auto;
    }

    .form-actions,
    .button-group,
    .btn-group-custom {
        justify-content: stretch;
    }

        .form-actions .btn,
        .button-group .btn,
        .btn-group-custom .btn {
            flex: 1 1 auto;
        }

    .crud-actions {
        flex-wrap: wrap;
    }
}


@media (max-width: 450px) {

    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }

        .form-actions .btn {
            width: 100%;
        }

    .page-back {
        margin-bottom: 16px;
    }

        .page-back .btn-back {
            width: auto;
        }
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: auto;
    border-radius: 9px;
    background: #d9534f;
    color: #fff;
    font-size: 9px;
    font-weight: 700
}

.crud-page {
    max-width: 1500px;
    margin: 0 auto
}

.table-responsive {
    overflow-x: auto
}

.chat-layout {
    display: grid;
    grid-template-columns: minmax(240px,.55fr) minmax(0,1.45fr);
    gap: 20px
}

.chat-window {
    min-height: 420px;
    max-height: 60vh;
    overflow: auto;
    padding: 10px 4px;
    background: #fafbfc;
    border: 1px solid var(--border);
    border-radius: 9px
}

@media(max-width:900px) {
    .chat-layout {
        grid-template-columns: 1fr
    }
}


/* =========================================================
   CRM-16 UI HARDENING
   ========================================================= */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

.main-area,
.content-area,
.crm-wrapper {
    min-width: 0;
}

.content-area {
    width: 100%;
}

.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    border-radius: 10px;
}

.crud-card:has(.table-responsive) {
    overflow: hidden;
}

.crud-table,
.dashboard-table {
    min-width: 1100px;
    width: 100%;
    table-layout: auto;
}

    .crud-table th,
    .crud-table td,
    .dashboard-table th,
    .dashboard-table td {
        vertical-align: middle;
        white-space: nowrap;
    }

        .crud-table th:first-child,
        .crud-table td:first-child {
            min-width: 180px;
        }

        .crud-table th:last-child,
        .crud-table td:last-child,
        .crud-table .actions-column {
            min-width: 240px;
            width: 240px;
        }

        .crud-table td:nth-child(2) {
            min-width: 160px;
        }

        .crud-table td:nth-child(3) {
            min-width: 150px;
        }

.crud-actions {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

    .crud-actions form {
        margin: 0;
        display: inline-flex;
    }

    .crud-action-btn,
    .crud-actions .btn,
    .crud-table .btn {
        min-height: 34px;
        white-space: nowrap;
        flex: 0 0 auto;
    }

.user-status {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

    .user-status > span {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        display: inline-block;
        flex: 0 0 7px;
    }

    .user-status.active > span {
        background: #3f8f68;
    }

    .user-status.inactive > span {
        background: #d9534f;
    }

.crud-name,
.user-info-block {
    min-width: 0;
}

    .crud-name strong,
    .crud-name small,
    .crud-table .cell-truncate {
        max-width: 320px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.crud-page-header,
.sa-toolbar,
.sa-filter-actions {
    gap: 12px;
}

/* International phone field: country code is a separate UI field while
   the existing server Phone property remains backward-compatible. */
.phone-input-group {
    display: grid;
    grid-template-columns: minmax(155px, 0.42fr) minmax(0, 1fr);
    gap: 8px;
    width: 100%;
}

    .phone-input-group .phone-country-code,
    .phone-input-group .form-control {
        min-width: 0;
        min-height: 40px;
    }

.phone-country-code {
    font-size: 13px;
}

@media (max-width: 700px) {
    .phone-input-group {
        grid-template-columns: 1fr;
    }

    .crud-table,
    .dashboard-table {
        min-width: 1000px;
    }

    .content-area {
        padding: 15px;
    }
}

/* =========================================================
   COMPANY REGISTRATION - FINAL UI REFINEMENT
   ========================================================= */

.public-registration-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 42px 24px 60px;
    background: #f5f7f8;
    box-sizing: border-box;
}


    /* =========================================================
   MAIN CARD
   ========================================================= */

    .public-registration-page .registration-card {
        width: 100%;
        max-width: 920px;
        margin: 0 auto;
        padding: 42px 48px 46px;
        background: #ffffff;
        border: 1px solid #e3e8e5;
        border-radius: 24px;
        box-shadow: 0 12px 35px rgba(28, 44, 37, 0.07);
        box-sizing: border-box;
    }


    /* =========================================================
   BACK BUTTON
   ========================================================= */

    .public-registration-page .page-back {
        margin-bottom: 34px;
    }

    .public-registration-page .btn-back {
        display: inline-flex;
        align-items: center;
        gap: 9px;
        min-height: 44px;
        padding: 0 18px;
        border: 1px solid #d7dfdb;
        border-radius: 10px;
        background: #ffffff;
        color: #263832;
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
        transition: all 0.2s ease;
    }

        .public-registration-page .btn-back:hover {
            border-color: #3f936d;
            color: #327454;
            background: #f7fbf9;
        }

        .public-registration-page .btn-back i {
            font-size: 16px;
        }


    /* =========================================================
   BRAND
   ========================================================= */

    .public-registration-page .registration-brand {
        display: flex;
        align-items: center;
        gap: 15px;
        margin-bottom: 34px;
    }

        .public-registration-page .registration-brand .logo-icon {
            width: 52px;
            height: 52px;
            flex: 0 0 52px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 13px;
            background: #3f936d;
            color: #ffffff;
            font-size: 25px;
            font-weight: 800;
        }

        .public-registration-page .registration-brand strong {
            display: block;
            color: #182a23;
            font-size: 22px;
            line-height: 1.2;
        }

        .public-registration-page .registration-brand span {
            display: block;
            margin-top: 3px;
            color: #7b8581;
            font-size: 12px;
        }


    /* =========================================================
   STEPS
   ========================================================= */

    .public-registration-page .registration-steps {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        margin-bottom: 44px;
    }

        .public-registration-page .registration-steps span {
            min-height: 46px;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 0 12px;
            border: 1px solid #e0e6e3;
            border-radius: 11px;
            background: #ffffff;
            color: #7a8580;
            font-size: 12px;
            font-weight: 600;
            text-align: center;
        }

            .public-registration-page .registration-steps span.active {
                border-color: #c9e3d5;
                background: #eef8f2;
                color: #327454;
            }


    /* =========================================================
   HEADING
   ========================================================= */

    .public-registration-page .registration-heading {
        margin-bottom: 34px;
    }

        .public-registration-page .registration-heading h1 {
            margin: 8px 0 10px;
            color: #172923;
            font-size: 34px;
            line-height: 1.2;
            font-weight: 750;
            letter-spacing: -0.7px;
        }

        .public-registration-page .registration-heading p {
            margin: 0;
            color: #718079;
            font-size: 15px;
            line-height: 1.7;
        }


    /* =========================================================
   FORM
   ========================================================= */

    .public-registration-page form {
        width: 100%;
        max-width: 700px;
    }


    /* =========================================================
   FORM GROUP
   ========================================================= */

    .public-registration-page .mb-3 {
        margin-bottom: 28px !important;
    }

    .public-registration-page .form-label {
        display: block;
        margin-bottom: 9px;
        color: #31443b;
        font-size: 14px;
        font-weight: 650;
    }


    /* =========================================================
   EMAIL INPUT
   ========================================================= */

    .public-registration-page .form-control {
        display: block;
        width: 100%;
        height: 52px;
        padding: 0 16px;
        border: 1px solid #cfd9d4;
        border-radius: 11px;
        background: #ffffff;
        color: #263832;
        font-size: 14px;
        box-sizing: border-box;
        outline: none;
        transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    }

        .public-registration-page .form-control::placeholder {
            color: #9aa49f;
        }

        .public-registration-page .form-control:focus {
            border-color: #3f936d;
            box-shadow: 0 0 0 3px rgba(63, 147, 109, 0.12);
            background: #ffffff;
        }

        .public-registration-page .form-control.is-invalid {
            border-color: #dc5a5a;
        }


    /* =========================================================
   EMAIL HELP TEXT
   ========================================================= */

    .public-registration-page .text-muted {
        display: block;
        margin-top: 9px !important;
        color: #7b8581 !important;
        font-size: 12px !important;
        line-height: 1.5;
    }


    /* =========================================================
   SEND VERIFICATION BUTTON
   ========================================================= */

    .public-registration-page form > .btn-success {
        width: 100%;
        min-height: 52px !important;
        margin-top: 2px;
        border: none;
        border-radius: 11px;
        background: #3f936d;
        color: #ffffff;
        font-size: 14px;
        font-weight: 650;
        box-shadow: 0 5px 14px rgba(63, 147, 109, 0.16);
        transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    }

        .public-registration-page form > .btn-success:hover {
            background: #327b5b;
            box-shadow: 0 7px 18px rgba(63, 147, 109, 0.21);
            transform: translateY(-1px);
        }

        .public-registration-page form > .btn-success:active {
            transform: translateY(0);
        }

        .public-registration-page form > .btn-success i {
            font-size: 16px;
        }


    /* =========================================================
   VERIFICATION INFORMATION CARD
   ========================================================= */

    .public-registration-page .registration-note {
        width: 100%;
        margin-top: 28px;
        padding: 20px 22px;
        border: 1px solid #dce7e2;
        border-radius: 14px;
        background: #f8fbf9;
        color: #61716a;
        font-size: 12px;
        line-height: 1.65;
        box-sizing: border-box;
    }

        .public-registration-page .registration-note > i {
            margin-right: 7px;
            color: #3f936d;
            font-size: 14px;
        }

        .public-registration-page .registration-note strong {
            color: #34483f;
            font-weight: 650;
        }


    /* =========================================================
   REQUIRED FIELD
   ========================================================= */

    .public-registration-page form > div:last-child {
        margin-top: 20px !important;
        color: #89938e !important;
        font-size: 11px !important;
    }


    /* =========================================================
   VALIDATION
   ========================================================= */

    .public-registration-page .text-danger {
        color: #c94d4d !important;
        font-size: 12px;
    }

    .public-registration-page .field-validation-error {
        display: block;
        margin-top: 7px;
    }


    /* =========================================================
   ALERTS
   ========================================================= */

    .public-registration-page .alert {
        margin-bottom: 25px;
        padding: 13px 16px;
        border-radius: 10px;
        font-size: 13px;
    }

    .public-registration-page .alert-danger {
        border: 1px solid #f0cccc;
        background: #fff6f6;
        color: #9d4040;
    }


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 768px) {

    .public-registration-page {
        padding: 24px 16px 40px;
    }

        .public-registration-page .registration-card {
            padding: 30px 24px 34px;
            border-radius: 18px;
        }

        .public-registration-page .registration-steps {
            grid-template-columns: repeat(2, 1fr);
            margin-bottom: 34px;
        }

        .public-registration-page .registration-heading h1 {
            font-size: 29px;
        }

        .public-registration-page form {
            max-width: none;
        }
}


@media (max-width: 480px) {

    .public-registration-page {
        padding: 14px 10px 30px;
    }

        .public-registration-page .registration-card {
            padding: 24px 18px 28px;
            border-radius: 16px;
        }

        .public-registration-page .page-back {
            margin-bottom: 27px;
        }

        .public-registration-page .registration-brand {
            margin-bottom: 28px;
        }

        .public-registration-page .registration-steps {
            gap: 7px;
            margin-bottom: 30px;
        }

            .public-registration-page .registration-steps span {
                min-height: 42px;
                font-size: 10px;
                padding: 0 6px;
            }

        .public-registration-page .registration-heading {
            margin-bottom: 27px;
        }

            .public-registration-page .registration-heading h1 {
                font-size: 26px;
            }

            .public-registration-page .registration-heading p {
                font-size: 13px;
            }

        .public-registration-page .registration-note {
            padding: 17px;
        }
}
/* =========================================================
   LEAD MANAGEMENT - BULK / KANBAN POLISH
   ========================================================= */
.lead-management-page .crud-page-header,
.crud-page.lead-management-page .crud-page-header {
    align-items: center;
}

.lead-tool-card {
    border: 1px solid #e7ebf2;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(25,35,55,.06);
    overflow: hidden;
    height: 100%;
}

    .lead-tool-card .tool-card-head {
        padding: 18px 20px 12px;
        display: flex;
        align-items: flex-start;
        gap: 12px;
    }

    .lead-tool-card .tool-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 42px;
        font-size: 18px;
    }

        .lead-tool-card .tool-icon.import {
            background: #eaf7ef;
            color: #16834b;
        }

        .lead-tool-card .tool-icon.assign {
            background: #edf3ff;
            color: #2f65d5;
        }

    .lead-tool-card .tool-card-body {
        padding: 0 20px 20px;
    }

    .lead-tool-card h5 {
        margin: 0;
        font-weight: 700;
        color: #1f2937;
    }

    .lead-tool-card .tool-help {
        color: #6b7280;
        font-size: 13px;
        line-height: 1.55;
        margin: 4px 0 14px;
    }

    .lead-tool-card .form-label {
        font-size: 12px;
        font-weight: 700;
        color: #4b5563;
        margin-bottom: 6px;
    }

    .lead-tool-card .form-select,
    .lead-tool-card .form-control {
        min-height: 44px;
        border-color: #dce2ea;
        border-radius: 10px;
    }

        .lead-tool-card .form-select:focus,
        .lead-tool-card .form-control:focus {
            border-color: #7aa2f7;
            box-shadow: 0 0 0 3px rgba(47,101,213,.10);
        }

.lead-file-input {
    padding: 9px 12px;
    background: #f8fafc;
}

.lead-csv-note {
    background: #f8fafc;
    border: 1px dashed #d7dee8;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    color: #64748b;
}

    .lead-csv-note code {
        color: #334155;
        font-size: 11px;
    }

.lead-action-btn {
    min-height: 44px;
    border-radius: 10px;
    font-weight: 700;
}

.lead-toolbar {
    border: 1px solid #e7ebf2;
    border-radius: 14px;
    background: #fff;
    padding: 14px;
    box-shadow: 0 4px 14px rgba(25,35,55,.04);
}

    .lead-toolbar .form-control, .lead-toolbar .form-select {
        min-height: 42px;
        border-radius: 10px;
    }

.lead-table-wrap {
    border: 1px solid #e7ebf2;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 5px 18px rgba(25,35,55,.05);
}

    .lead-table-wrap .table {
        margin-bottom: 0;
    }

        .lead-table-wrap .table thead th {
            background: #f8fafc;
            color: #475569;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: .04em;
            font-weight: 800;
            border-bottom: 1px solid #e5eaf0;
            white-space: nowrap;
        }

        .lead-table-wrap .table td {
            padding: 13px 14px;
            vertical-align: middle;
            border-color: #eef1f5;
        }

        .lead-table-wrap .table tbody tr:hover {
            background: #fafcff;
        }

.lead-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

    .lead-status-badge::before {
        content: "";
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #94a3b8;
    }

.lead-check {
    width: 17px;
    height: 17px;
    accent-color: #2f65d5;
}

.lead-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    border-radius: 14px;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

/* Kanban */
.lead-kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 4px 2px 18px;
    align-items: flex-start;
    scrollbar-width: thin;
}

.lead-kanban-column {
    min-width: 290px;
    max-width: 320px;
    flex: 0 0 300px;
    border: 1px solid #e4e9f0;
    border-radius: 16px;
    background: #f8fafc;
    box-shadow: 0 4px 14px rgba(25,35,55,.04);
    overflow: hidden;
}

.lead-kanban-column-head {
    padding: 14px 15px;
    background: #fff;
    border-bottom: 1px solid #e7ebf0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lead-kanban-column-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: #263244;
}

.lead-kanban-count {
    min-width: 26px;
    height: 24px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eef2f7;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}

.lead-kanban-dropzone {
    min-height: 360px;
    padding: 10px;
    transition: background .15s ease, box-shadow .15s ease;
}

    .lead-kanban-dropzone.drag-over {
        background: #eef5ff;
        box-shadow: inset 0 0 0 2px rgba(47,101,213,.18);
    }

.lead-kanban-card {
    display: block;
    background: #fff;
    border: 1px solid #e5e9ef;
    border-radius: 12px;
    padding: 13px;
    margin-bottom: 10px;
    box-shadow: 0 3px 10px rgba(25,35,55,.05);
    cursor: grab;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

    .lead-kanban-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 7px 18px rgba(25,35,55,.09);
        border-color: #cfd8e5;
    }

    .lead-kanban-card:active {
        cursor: grabbing;
    }

    .lead-kanban-card .lead-card-name {
        font-size: 13px;
        font-weight: 800;
        color: #1f2937;
    }

    .lead-kanban-card .lead-card-company {
        font-size: 12px;
        color: #64748b;
        margin-top: 2px;
    }

    .lead-kanban-card .lead-card-meta {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-top: 10px;
        font-size: 11px;
        color: #64748b;
    }

        .lead-kanban-card .lead-card-meta i {
            color: #94a3b8;
        }

    .lead-kanban-card .lead-view {
        display: inline-flex;
        margin-top: 10px;
        font-size: 11px;
        font-weight: 700;
        text-decoration: none;
        color: #2f65d5;
    }

    .lead-kanban-card.dragging {
        opacity: .45;
        transform: rotate(1deg);
    }

/* Friendly alerts */
.lead-management-page .alert {
    border-radius: 12px;
    border-width: 1px;
    font-size: 13px;
}

    .lead-management-page .alert .alert-heading {
        font-size: 13px;
        font-weight: 800;
    }

@media (max-width: 768px) {
    .lead-tool-card .tool-card-head, .lead-tool-card .tool-card-body {
        padding-left: 16px;
        padding-right: 16px;
    }

    .lead-kanban-column {
        min-width: 280px;
    }

    .lead-toolbar {
        padding: 10px;
    }
}

/* =========================================================
   LEAD MANAGEMENT - BULK / KANBAN POLISH
   ========================================================= */
.lead-management-page .crud-page-header {
    align-items: center;
}

.lead-tool-card {
    border: 1px solid #e7ebf2;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(25,35,55,.06);
    overflow: hidden;
    height: 100%;
}

    .lead-tool-card .tool-card-head {
        padding: 18px 20px 12px;
        display: flex;
        align-items: flex-start;
        gap: 12px;
    }

    .lead-tool-card .tool-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 42px;
        font-size: 18px;
    }

        .lead-tool-card .tool-icon.import {
            background: #eaf7ef;
            color: #16834b;
        }

        .lead-tool-card .tool-icon.assign {
            background: #edf3ff;
            color: #2f65d5;
        }

    .lead-tool-card .tool-card-body {
        padding: 0 20px 20px;
    }

    .lead-tool-card h5 {
        margin: 0;
        font-weight: 700;
        color: #1f2937;
    }

    .lead-tool-card .tool-help {
        color: #6b7280;
        font-size: 13px;
        line-height: 1.55;
        margin: 4px 0 14px;
    }

    .lead-tool-card .form-label {
        font-size: 12px;
        font-weight: 700;
        color: #4b5563;
        margin-bottom: 6px;
    }

    .lead-tool-card .form-select, .lead-tool-card .form-control {
        min-height: 44px;
        border-color: #dce2ea;
        border-radius: 10px;
    }

        .lead-tool-card .form-select:focus, .lead-tool-card .form-control:focus {
            border-color: #7aa2f7;
            box-shadow: 0 0 0 3px rgba(47,101,213,.10);
        }

.lead-file-input {
    padding: 9px 12px;
    background: #f8fafc;
}

.lead-csv-note {
    background: #f8fafc;
    border: 1px dashed #d7dee8;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    color: #64748b;
}

    .lead-csv-note code {
        color: #334155;
        font-size: 11px;
    }

.lead-action-btn {
    min-height: 44px;
    border-radius: 10px;
    font-weight: 700;
}

.lead-toolbar {
    border: 1px solid #e7ebf2;
    border-radius: 14px;
    background: #fff;
    padding: 14px;
    box-shadow: 0 4px 14px rgba(25,35,55,.04);
}

    .lead-toolbar .form-control, .lead-toolbar .form-select {
        min-height: 42px;
        border-radius: 10px;
    }

.lead-table-wrap {
    border: 1px solid #e7ebf2;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 5px 18px rgba(25,35,55,.05);
}

    .lead-table-wrap .table {
        margin-bottom: 0;
    }

        .lead-table-wrap .table thead th {
            background: #f8fafc;
            color: #475569;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: .04em;
            font-weight: 800;
            border-bottom: 1px solid #e5eaf0;
            white-space: nowrap;
        }

        .lead-table-wrap .table td {
            padding: 13px 14px;
            vertical-align: middle;
            border-color: #eef1f5;
        }

        .lead-table-wrap .table tbody tr:hover {
            background: #fafcff;
        }

.lead-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

    .lead-status-badge::before {
        content: "";
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #94a3b8;
    }

.lead-check {
    width: 17px;
    height: 17px;
    accent-color: #2f65d5;
}

.lead-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 10px;
    border-radius: 14px;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.lead-kanban-board {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding: 4px 2px 18px;
    align-items: flex-start;
    scrollbar-width: thin;
}

.lead-kanban-column {
    min-width: 290px;
    max-width: 320px;
    flex: 0 0 300px;
    border: 1px solid #e4e9f0;
    border-radius: 16px;
    background: #f8fafc;
    box-shadow: 0 4px 14px rgba(25,35,55,.04);
    overflow: hidden;
}

.lead-kanban-column-head {
    padding: 14px 15px;
    background: #fff;
    border-bottom: 1px solid #e7ebf0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lead-kanban-column-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 800;
    color: #263244;
}

.lead-kanban-count {
    min-width: 26px;
    height: 24px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #eef2f7;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}

.lead-kanban-dropzone {
    min-height: 360px;
    padding: 10px;
    transition: background .15s ease, box-shadow .15s ease;
}

    .lead-kanban-dropzone.drag-over {
        background: #eef5ff;
        box-shadow: inset 0 0 0 2px rgba(47,101,213,.18);
    }

.lead-kanban-card {
    display: block;
    background: #fff;
    border: 1px solid #e5e9ef;
    border-radius: 12px;
    padding: 13px;
    margin-bottom: 10px;
    box-shadow: 0 3px 10px rgba(25,35,55,.05);
    cursor: grab;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

    .lead-kanban-card:hover {
        transform: translateY(-1px);
        box-shadow: 0 7px 18px rgba(25,35,55,.09);
        border-color: #cfd8e5;
    }

    .lead-kanban-card:active {
        cursor: grabbing;
    }

    .lead-kanban-card .lead-card-name {
        font-size: 13px;
        font-weight: 800;
        color: #1f2937;
    }

    .lead-kanban-card .lead-card-company {
        font-size: 12px;
        color: #64748b;
        margin-top: 2px;
    }

    .lead-kanban-card .lead-card-meta {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-top: 10px;
        font-size: 11px;
        color: #64748b;
    }

        .lead-kanban-card .lead-card-meta i {
            color: #94a3b8;
        }

    .lead-kanban-card .lead-view {
        display: inline-flex;
        margin-top: 10px;
        font-size: 11px;
        font-weight: 700;
        text-decoration: none;
        color: #2f65d5;
    }

    .lead-kanban-card.dragging {
        opacity: .45;
        transform: rotate(1deg);
    }

.lead-management-page .alert {
    border-radius: 12px;
    border-width: 1px;
    font-size: 13px;
}

@media (max-width:768px) {
    .lead-tool-card .tool-card-head, .lead-tool-card .tool-card-body {
        padding-left: 16px;
        padding-right: 16px
    }

    .lead-kanban-column {
        min-width: 280px
    }

    .lead-toolbar {
        padding: 10px
    }
}


/* =========================================================
   ROLE / TENANT NAVIGATION POLISH
   ========================================================= */
.sidebar {
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav {
    padding-bottom: 24px;
}

.user-info {
    min-width: 0;
}

.user-role, .user-tenant {
    display: block;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-tenant {
    font-size: 11px;
    color: #64748b;
    margin-top: 1px;
}

.content-area {
    min-width: 0;
    overflow-x: hidden;
}

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

.crud-actions {
    flex-wrap: wrap;
    min-width: max-content;
}

/* ---------- Live notifications ---------- */
.notification-live-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    text-decoration: none;
}

.notification-badge {
    position: absolute;
    top: -2px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #d9534f;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    border: 2px solid #fff;
}

.crm-live-toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1080;
    width: min(360px,calc(100vw - 32px));
    padding: 14px 16px;
    border: 1px solid #dce5df;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 35px rgba(20,30,25,.16);
    opacity: 0;
    transform: translateY(18px);
    pointer-events: none;
    transition: opacity .2s ease,transform .2s ease;
}

    .crm-live-toast.show {
        opacity: 1;
        transform: translateY(0);
    }

.crm-live-toast-title {
    font-weight: 700;
    color: #26312b;
    margin-bottom: 4px;
}

    .crm-live-toast-title i {
        color: #3f8f68;
        margin-right: 5px;
    }

.crm-live-toast-message {
    color: #66716b;
    font-size: 13px;
    line-height: 1.45;
}

/* ---------- Import / bulk communication ---------- */
.lead-import-dropzone {
    position: relative;
    min-height: 145px;
    border: 2px dashed #cbd9d0;
    border-radius: 12px;
    background: #f8fbf9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #607068;
    cursor: pointer;
    text-align: center;
    padding: 20px;
}

    .lead-import-dropzone:hover, .lead-import-dropzone.dragging {
        border-color: #3f8f68;
        background: #f1f8f4;
    }

    .lead-import-dropzone i {
        font-size: 28px;
        color: #3f8f68;
    }

    .lead-import-dropzone strong {
        color: #2f4037;
    }

    .lead-import-dropzone input[type=file] {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
    }

.import-preview-table td, .import-preview-table th {
    vertical-align: middle;
}

.actions-column {
    min-width: 150px;
}

.actions-cell {
    white-space: nowrap;
}

.metric-card {
    padding: 18px;
    border: 1px solid #e2e9e5;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(20,30,25,.04);
}

    .metric-card span {
        display: block;
        color: #718078;
        font-size: 12px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: .05em;
    }

    .metric-card strong {
        display: block;
        margin-top: 4px;
        font-size: 25px;
        color: #243029;
    }

.bulk-recipient-list {
    max-height: 480px;
    overflow: auto;
}

.bulk-recipient {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #edf1ee;
}

    .bulk-recipient small {
        display: block;
        color: #77827c;
        margin-top: 2px;
    }

.message-preview {
    white-space: pre-wrap;
    border: 1px solid #e1e8e4;
    border-radius: 10px;
    background: #f8faf9;
    padding: 18px;
    min-height: 110px;
    color: #2b352f;
}

.spin {
    animation: crm-spin .9s linear infinite;
}

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

@media (max-width:700px) {
    .crm-live-toast {
        right: 16px;
        bottom: 16px;
    }

    .actions-cell {
        white-space: nowrap;
    }
}

.notification-menu-wrap {
    position: relative;
}

.notification-live-list {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border: 1px solid #e1e7e3;
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(20,30,25,.13);
    padding: 7px;
    display: none;
    z-index: 1100;
}

.notification-menu-wrap:hover .notification-live-list, .notification-menu-wrap:focus-within .notification-live-list {
    display: block;
}

.notification-live-item {
    display: flex;
    gap: 9px;
    align-items: flex-start;
    padding: 10px;
    border-radius: 9px;
    text-decoration: none;
    color: #303a34;
}

    .notification-live-item:hover, .notification-live-item.unread {
        background: #f5faf7;
    }

    .notification-live-item strong {
        display: block;
        font-size: 12px;
    }

    .notification-live-item small {
        display: block;
        margin-top: 2px;
        color: #727d76;
        line-height: 1.35;
    }

.notification-live-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #eef7f1;
    color: #3f8f68;
}

.notification-live-footer {
    display: block;
    padding: 9px 10px 6px;
    border-top: 1px solid #edf1ee;
    margin-top: 4px;
    color: #3f8f68;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}


/* =========================================
   FOLLOW-UP STATUS MANAGEMENT
   ========================================= */
.followup-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(63,143,104,0.10);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.status-state {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
}

.status-state-active {
    color: var(--accent-dark);
}

.status-state-inactive {
    color: #8a8f98;
}

.followup-status-help {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 15px 17px;
    background: #f8faf9;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
}

.followup-status-help-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(63,143,104,0.10);
    color: var(--accent);
}

.followup-status-help strong {
    display: block;
    margin-bottom: 3px;
    color: var(--text-primary);
    font-size: 13px;
}

.followup-status-help p {
    margin: 0;
    font-size: 12px;
    line-height: 1.55;
}

.followup-notes-cell {
    max-width: 320px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =========================================================
   BUSINESS UNIT TABLE — FINAL OVERRIDES
   ========================================================= */
.business-unit-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.business-unit-table {
    width: 100%;
    min-width: 1510px;
    table-layout: fixed;
}

    .business-unit-table th,
    .business-unit-table td {
        vertical-align: middle;
    }

        .business-unit-table th:nth-child(1), .business-unit-table td:nth-child(1) {
            width: 230px;
        }

        .business-unit-table th:nth-child(2), .business-unit-table td:nth-child(2) {
            width: 180px;
        }

        .business-unit-table th:nth-child(3), .business-unit-table td:nth-child(3) {
            width: 220px;
        }

        .business-unit-table th:nth-child(4), .business-unit-table td:nth-child(4) {
            width: 110px;
            text-align: center;
        }

        .business-unit-table th:nth-child(5), .business-unit-table td:nth-child(5) {
            width: 100px;
            text-align: center;
        }

        .business-unit-table th:nth-child(6), .business-unit-table td:nth-child(6) {
            width: 110px;
            text-align: center;
        }

        .business-unit-table th:nth-child(7), .business-unit-table td:nth-child(7) {
            width: 130px;
        }

        .business-unit-table th:nth-child(8), .business-unit-table td:nth-child(8) {
            width: 430px;
            min-width: 430px;
            white-space: nowrap;
        }

    .business-unit-table .crud-actions {
        display: flex;
        align-items: center;
        gap: 7px;
        flex-wrap: nowrap;
        white-space: nowrap;
    }

        .business-unit-table .crud-actions form {
            margin: 0;
            padding: 0;
            display: inline-flex;
        }

    .business-unit-table .crud-action-btn {
        flex: 0 0 auto;
        white-space: nowrap;
    }

@media (max-width: 700px) {
    .business-unit-table {
        min-width: 1410px;
    }
}

/* Standard CRM pagination */
.crm-pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-color,#e5e7eb);
}

.crm-pagination-summary {
    font-size: .875rem;
    color: var(--text-muted,#6b7280);
}

.crm-pagination-controls {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.crm-page-size {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: .875rem;
    color: var(--text-muted,#6b7280);
}

    .crm-page-size .form-select {
        min-width: 72px;
    }

.crm-pagination-controls nav {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.crm-pagination-controls .btn.disabled {
    pointer-events: none;
    opacity: .5;
}

@media (max-width:767.98px) {
    .crm-pagination-wrap {
        align-items: flex-start
    }

    .crm-pagination-controls {
        width: 100%;
        justify-content: space-between
    }

        .crm-pagination-controls nav {
            width: 100%;
            overflow-x: auto;
            padding-bottom: 4px
        }

            .crm-pagination-controls nav .btn {
                flex: 0 0 auto;
            }
}


/* =========================================================
   CRM-WIDE RESPONSIVE TABLE SYSTEM
   =========================================================
   Tables own their horizontal scrolling. The page/layout never
   expands because a data table is wider than the viewport.
   ========================================================= */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.main-area,
.content-area,
.crud-page,
.dashboard-page,
.crud-card,
.dashboard-panel {
    min-width: 0;
}

.content-area {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

/* Common reusable table wrapper */
.crm-table-wrapper,
.table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    overscroll-behavior-x: contain;
}

/* Keep the scrollbar attached to the table area */
.crm-card-table,
.crud-card:has(.crm-table-wrapper),
.crud-card:has(.table-responsive) {
    min-width: 0;
    max-width: 100%;
}

/* Common reusable data-table class */
.crm-data-table,
.crud-table,
.dashboard-table {
    width: max-content;
    min-width: 100%;
    max-width: none;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
}

    /* Header and cell readability */
    .crm-data-table th,
    .crm-data-table td,
    .crud-table th,
    .crud-table td,
    .dashboard-table th,
    .dashboard-table td {
        vertical-align: middle;
        box-sizing: border-box;
    }

    .crm-data-table th,
    .crud-table th,
    .dashboard-table th {
        white-space: nowrap;
        padding: 12px 16px;
    }

    .crm-data-table td,
    .crud-table td,
    .dashboard-table td {
        padding: 12px 16px;
        white-space: nowrap;
        overflow-wrap: normal;
    }

    /* Columns that intentionally contain longer text may wrap. */
    .crm-data-table .crud-description,
    .crud-table .crud-description,
    .crm-data-table .text-wrap,
    .crud-table .text-wrap {
        white-space: normal;
        overflow-wrap: anywhere;
    }

    /* Reusable action column */
    .crm-data-table .actions-column,
    .crm-data-table .actions-cell,
    .crm-data-table .col-actions,
    .crud-table .actions-column,
    .crud-table .actions-cell,
    .crud-table .col-actions,
    .dashboard-table .actions-column,
    .dashboard-table .actions-cell,
    .dashboard-table .col-actions {
        min-width: 240px;
        width: 240px;
        white-space: nowrap;
        text-align: right;
    }

    /* Tables that actually have an Actions header get a safe minimum. */
    .crm-data-table.crm-has-actions th:last-child,
    .crm-data-table.crm-has-actions td:last-child,
    .crud-table.crm-has-actions th:last-child,
    .crud-table.crm-has-actions td:last-child {
        min-width: 240px;
        width: 240px;
        white-space: nowrap;
    }

    /* Reusable action-button row */
    .crm-action-buttons,
    .crm-table-actions,
    .crm-data-table .crud-actions,
    .crud-table .crud-actions,
    .dashboard-table .crud-actions {
        display: inline-flex;
        align-items: center;
        justify-content: flex-start;
        gap: 7px;
        flex-wrap: nowrap;
        white-space: nowrap;
        min-width: max-content;
    }

        .crm-action-buttons > *,
        .crm-table-actions > *,
        .crm-data-table .crud-actions > *,
        .crud-table .crud-actions > *,
        .dashboard-table .crud-actions > * {
            flex: 0 0 auto;
        }

        .crm-data-table .crud-actions form,
        .crud-table .crud-actions form,
        .dashboard-table .crud-actions form {
            display: inline-flex;
            flex: 0 0 auto;
            margin: 0;
            padding: 0;
        }

        .crm-data-table .crud-action-btn,
        .crud-table .crud-action-btn,
        .dashboard-table .crud-action-btn,
        .crm-action-buttons .btn,
        .crm-table-actions .btn {
            flex: 0 0 auto;
            white-space: nowrap;
            min-height: 34px;
        }

/* Employee/user table: preserve the deliberate column widths while
   allowing the wrapper to scroll internally. */
.users-table {
    width: max-content;
    min-width: 1380px;
    max-width: none;
    table-layout: auto;
}

.users-table-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto !important;
}

/* Filter/export toolbars must shrink inside the content area. */
.sa-toolbar,
.sa-toolbar > form,
.sa-export-toolbar,
.button-group,
.form-actions {
    min-width: 0;
    max-width: 100%;
}

    .sa-toolbar > form {
        min-width: 0;
    }

/* Pagination is a sibling of the table/card and must never widen
   the browser viewport. */
.crm-pagination-wrap {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.crm-pagination-controls {
    min-width: 0;
    max-width: 100%;
}

    .crm-pagination-controls nav {
        min-width: 0;
        max-width: 100%;
    }

/* Green CRM primary action; no Bootstrap-blue replacement. */
.btn-crm-primary {
    background-color: #42966D;
    border-color: #42966D;
    color: #ffffff;
    font-weight: 600;
    border-radius: 8px;
}

    .btn-crm-primary:hover,
    .btn-crm-primary:focus,
    .btn-crm-primary:active {
        background-color: #37835E;
        border-color: #37835E;
        color: #ffffff;
    }

    .btn-crm-primary:focus,
    .btn-crm-primary:active {
        box-shadow: 0 0 0 0.2rem rgba(66, 150, 109, 0.25);
    }

    .btn-crm-primary:disabled {
        background-color: #a9cdbb;
        border-color: #a9cdbb;
        color: #ffffff;
    }

/* Narrow screens: keep scrolling inside the table and do not shrink
   action buttons into clipped/icon-only controls. */
@media (max-width: 1200px) {
    .crm-data-table,
    .crud-table,
    .dashboard-table {
        min-width: max-content;
    }

        .crm-data-table th,
        .crm-data-table td,
        .crud-table th,
        .crud-table td,
        .dashboard-table th,
        .dashboard-table td {
            padding-left: 12px;
            padding-right: 12px;
        }
}

@media (max-width: 700px) {
    .crm-table-wrapper,
    .table-responsive,
    .users-table-wrap {
        max-width: 100%;
    }

    .crm-data-table .actions-column,
    .crm-data-table .actions-cell,
    .crm-data-table .col-actions,
    .crud-table .actions-column,
    .crud-table .actions-cell,
    .crud-table .col-actions,
    .dashboard-table .actions-column,
    .dashboard-table .actions-cell,
    .dashboard-table .col-actions {
        min-width: 220px;
        width: 220px;
    }

    .crm-data-table .crud-actions,
    .crud-table .crud-actions,
    .dashboard-table .crud-actions {
        flex-wrap: nowrap;
    }
}

/* =========================================================
   GLOBAL CRM BUTTON CONSISTENCY
   Keep every primary action aligned with the CRM green design.
   ========================================================= */
.btn-primary,
.btn-crm-primary,
.btn-create,
.btn-save,
.btn-update,
.crud-create-btn {
    background-color: #42966D;
    border-color: #42966D;
    color: #ffffff;
    font-weight: 600;
}

    .btn-primary:hover,
    .btn-primary:focus,
    .btn-primary:active,
    .btn-crm-primary:hover,
    .btn-crm-primary:focus,
    .btn-crm-primary:active,
    .btn-create:hover,
    .btn-save:hover,
    .btn-update:hover,
    .crud-create-btn:hover {
        background-color: #37835E;
        border-color: #37835E;
        color: #ffffff;
    }

.btn-outline-primary {
    color: #495057;
    border-color: #6c757d;
}

    .btn-outline-primary:hover,
    .btn-outline-primary:focus,
    .btn-outline-primary:active {
        color: #212529;
        background-color: #e9ecef;
        border-color: #6c757d;
    }


/* =========================================================
   HANDOVER REQUESTS TABLE — FINAL UI FIX
   Keeps the existing CRM design and green buttons.
   Horizontal scrolling stays inside the table wrapper.
   ========================================================= */

.handover-table {
    width: max-content !important;
    min-width: 1180px !important;
    max-width: none !important;
    table-layout: auto !important;
    margin-bottom: 0 !important;
}

    .handover-table th,
    .handover-table td {
        vertical-align: middle !important;
        box-sizing: border-box;
    }

        /* Lead */
        .handover-table th:nth-child(1),
        .handover-table td:nth-child(1) {
            min-width: 180px !important;
        }

        /* Requested By */
        .handover-table th:nth-child(2),
        .handover-table td:nth-child(2) {
            min-width: 180px !important;
        }

        /* Reason */
        .handover-table th:nth-child(3),
        .handover-table td:nth-child(3) {
            min-width: 240px !important;
            max-width: 340px !important;
            white-space: normal !important;
            overflow-wrap: anywhere !important;
            word-break: break-word;
            line-height: 1.45;
        }

        /* Status */
        .handover-table th:nth-child(4),
        .handover-table td:nth-child(4) {
            min-width: 120px !important;
        }

        /* Date */
        .handover-table th:nth-child(5),
        .handover-table td:nth-child(5) {
            min-width: 150px !important;
        }

        /* Manager Action */
        .handover-table th:nth-child(6),
        .handover-table td:nth-child(6),
        .handover-table .handover-action-cell {
            min-width: 470px !important;
            width: 470px !important;
            white-space: normal !important;
            padding: 16px !important;
        }

    /* Approval row */
    .handover-table .handover-approve-form {
        display: grid !important;
        grid-template-columns: 155px minmax(130px, 1fr) max-content;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        margin: 0 !important;
    }

    /* Reassign select */
    .handover-table .handover-reassign {
        width: 155px !important;
        min-width: 155px !important;
        height: 40px !important;
    }

    /* Optional comment */
    .handover-table .handover-comment {
        width: 100% !important;
        min-width: 0 !important;
        height: 40px !important;
    }

    /* Approve button */
    .handover-table .handover-approve-form .btn-crm-primary {
        min-width: 145px !important;
        height: 40px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    /* Rejection row */
    .handover-table .handover-reject-form {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) max-content;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        margin: 10px 0 0 !important;
    }

    /* Rejection reason */
    .handover-table .handover-reject-reason {
        width: 100% !important;
        min-width: 0 !important;
        height: 40px !important;
    }

    /* Reject button */
    .handover-table .handover-reject-form .btn-outline-danger {
        min-width: 80px !important;
        height: 40px !important;
        white-space: nowrap !important;
    }

    /* Completed review comment */
    .handover-table .handover-review-comment {
        display: block;
        max-width: 430px;
        white-space: normal !important;
        overflow-wrap: anywhere;
        line-height: 1.45;
    }

    /* Keep the table itself wider than the viewport when necessary,
   but let the existing .table-responsive/.crm-table-wrapper
   handle the horizontal scrollbar. */
    .handover-table-wrapper,
    .handover-table.crm-data-table {
        max-width: none;
    }

/* Do not allow global mobile action-column rules to squeeze this table. */
@media (max-width: 1200px) {
    .handover-table {
        min-width: 1120px !important;
    }

        .handover-table th:nth-child(6),
        .handover-table td:nth-child(6),
        .handover-table .handover-action-cell {
            min-width: 450px !important;
            width: 450px !important;
        }
}

@media (max-width: 700px) {
    .handover-table {
        min-width: 1050px !important;
    }

        .handover-table th:nth-child(6),
        .handover-table td:nth-child(6),
        .handover-table .handover-action-cell {
            min-width: 420px !important;
            width: 420px !important;
        }

        .handover-table .handover-approve-form {
            grid-template-columns: 135px minmax(110px, 1fr) max-content;
        }

        .handover-table .handover-reassign {
            width: 135px !important;
            min-width: 135px !important;
        }

        .handover-table .handover-approve-form .btn-crm-primary {
            min-width: 135px !important;
        }
}

/* =========================================================
   EMPLOYEES TABLE - FINAL ACTION BUTTON FIX
   ========================================================= */

.users-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.users-table {
    width: max-content !important;
    min-width: 1380px !important;
    max-width: none !important;
    table-layout: auto !important;
}

    /* Actions column */
    .users-table .col-actions {
        min-width: 315px !important;
        width: 315px !important;
        white-space: nowrap !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

        /* Action row */
        .users-table .col-actions .crud-actions {
            display: flex !important;
            align-items: center;
            justify-content: flex-start !important;
            gap: 8px !important;
            flex-wrap: nowrap !important;
            width: max-content !important;
            min-width: max-content !important;
            white-space: nowrap !important;
        }

            /* Forms inside Actions */
            .users-table .col-actions .crud-actions form {
                display: inline-flex !important;
                align-items: center;
                flex: 0 0 auto !important;
                width: auto !important;
                margin: 0 !important;
                padding: 0 !important;
            }

        /* All action buttons */
        .users-table .col-actions .crud-action-btn {
            display: inline-flex !important;
            align-items: center;
            justify-content: center;
            flex: 0 0 auto !important;
            height: 40px !important;
            min-height: 40px !important;
            min-width: 0 !important;
            width: auto !important;
            padding: 0 14px !important;
            gap: 7px !important;
            border-radius: 9px !important;
            white-space: nowrap !important;
            box-sizing: border-box !important;
        }

        /* View */
        .users-table .col-actions .crud-view-btn {
            min-width: 88px !important;
        }

        /* Edit */
        .users-table .col-actions .crud-edit-btn {
            min-width: 82px !important;
        }

        /* Deactivate / Activate */
        .users-table .col-actions .crud-delete-btn {
            min-width: 118px !important;
        }

        /* Never clip the button text or icon */
        .users-table .col-actions .crud-action-btn i {
            flex: 0 0 auto;
        }

        .users-table .col-actions .crud-action-btn {
            overflow: visible !important;
        }

/* Keep table scrolling inside the card */
.crud-card:has(.users-table-wrap) {
    overflow: hidden !important;
}

/* =========================================================
   CRM TABLE FINAL LAYOUT SYSTEM
   ========================================================= */

/* ---------------------------------------------------------
   TABLE WRAPPERS
   --------------------------------------------------------- */

.crm-table-wrapper,
.table-responsive,
.users-table-wrap,
.business-unit-table-wrapper,
.handover-table-wrapper {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto !important;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}


/* ---------------------------------------------------------
   CARD / PAGE CONTAINERS
   Prevent wide tables from expanding the whole page
   --------------------------------------------------------- */

.crud-card,
.crm-card-table,
.crud-page,
.content-area,
.main-area {
    min-width: 0;
    max-width: 100%;
}


/* ---------------------------------------------------------
   STANDARD CRM TABLES
   --------------------------------------------------------- */

.crm-data-table,
.crud-table,
.dashboard-table {
    width: max-content !important;
    min-width: 100%;
    max-width: none !important;
    table-layout: auto !important;
    border-collapse: separate;
    border-spacing: 0;
}


    /* ---------------------------------------------------------
   CELLS
   --------------------------------------------------------- */

    .crm-data-table th,
    .crm-data-table td,
    .crud-table th,
    .crud-table td,
    .dashboard-table th,
    .dashboard-table td {
        box-sizing: border-box;
        vertical-align: middle;
    }

    .crm-data-table th,
    .crud-table th,
    .dashboard-table th {
        white-space: nowrap;
    }

    .crm-data-table td,
    .crud-table td,
    .dashboard-table td {
        white-space: nowrap;
    }


    /* ---------------------------------------------------------
   DESCRIPTION / LONG TEXT
   --------------------------------------------------------- */

    .crm-data-table .crud-description,
    .crud-table .crud-description,
    .crm-data-table .text-wrap,
    .crud-table .text-wrap {
        white-space: normal !important;
        overflow-wrap: anywhere;
    }


    /* ---------------------------------------------------------
   ACTION COLUMNS
   --------------------------------------------------------- */

    .crm-data-table .actions-column,
    .crm-data-table .actions-cell,
    .crm-data-table .col-actions,
    .crud-table .actions-column,
    .crud-table .actions-cell,
    .crud-table .col-actions,
    .dashboard-table .actions-column,
    .dashboard-table .actions-cell,
    .dashboard-table .col-actions {
        min-width: 250px !important;
        width: 250px !important;
        max-width: none !important;
        white-space: nowrap !important;
    }


    /* Tables with an Actions column but without a specific
   actions-column class */

    .crm-data-table.crm-has-actions th:last-child,
    .crm-data-table.crm-has-actions td:last-child,
    .crud-table.crm-has-actions th:last-child,
    .crud-table.crm-has-actions td:last-child {
        min-width: 250px !important;
        width: 250px !important;
        max-width: none !important;
        white-space: nowrap !important;
    }


    /* ---------------------------------------------------------
   ACTION BUTTON ROW
   --------------------------------------------------------- */

    .crm-data-table .crud-actions,
    .crud-table .crud-actions,
    .dashboard-table .crud-actions,
    .crm-action-buttons,
    .crm-table-actions {
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        flex-wrap: nowrap !important;
        width: max-content;
        min-width: max-content;
        white-space: nowrap;
    }


        /* Forms inside action area */

        .crm-data-table .crud-actions form,
        .crud-table .crud-actions form,
        .dashboard-table .crud-actions form {
            display: inline-flex !important;
            align-items: center;
            flex: 0 0 auto !important;
            width: auto !important;
            min-width: auto !important;
            margin: 0 !important;
            padding: 0 !important;
        }


        /* ---------------------------------------------------------
   ACTION BUTTONS
   --------------------------------------------------------- */

        .crm-data-table .crud-action-btn,
        .crud-table .crud-action-btn,
        .dashboard-table .crud-action-btn,
        .crm-action-buttons .btn,
        .crm-table-actions .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            flex: 0 0 auto !important;
            min-width: 68px;
            min-height: 34px;
            height: 34px;
            padding: 0 11px;
            white-space: nowrap !important;
            overflow: visible !important;
        }


    /* ---------------------------------------------------------
   NAME COLUMNS
   --------------------------------------------------------- */

    .crm-data-table .crud-name,
    .crud-table .crud-name {
        display: flex;
        align-items: center;
        gap: 11px;
        min-width: 220px;
    }

        .crm-data-table .crud-name > div:last-child,
        .crud-table .crud-name > div:last-child {
            min-width: 0;
        }

        .crm-data-table .crud-name strong,
        .crud-table .crud-name strong {
            display: block;
            max-width: none !important;
            overflow: visible !important;
            text-overflow: clip !important;
            white-space: nowrap !important;
        }

        .crm-data-table .crud-name small,
        .crud-table .crud-name small {
            display: block;
            white-space: nowrap;
        }


/* ---------------------------------------------------------
   PREVENT PAGE-LEVEL HORIZONTAL SCROLLING
   --------------------------------------------------------- */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.content-area {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}


/* ---------------------------------------------------------
   BUSINESS UNIT TABLE
   --------------------------------------------------------- */

.business-unit-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
}

.business-unit-table {
    width: max-content !important;
    min-width: 1510px !important;
    max-width: none !important;
    table-layout: fixed !important;
}

    .business-unit-table th.actions-column,
    .business-unit-table td.actions-column {
        width: 430px !important;
        min-width: 430px !important;
        max-width: 430px !important;
        white-space: nowrap !important;
    }

    .business-unit-table .crud-actions {
        display: flex !important;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap !important;
        width: max-content;
        min-width: max-content;
    }

    .business-unit-table .crud-action-btn {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
    }


/* ---------------------------------------------------------
   EMPLOYEE TABLE
   --------------------------------------------------------- */

.users-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
}

.users-table {
    width: max-content !important;
    min-width: 1380px !important;
    max-width: none !important;
    table-layout: auto !important;
}

    .users-table .col-actions {
        min-width: 315px !important;
        width: 315px !important;
        white-space: nowrap !important;
    }

        .users-table .col-actions .crud-actions {
            display: flex !important;
            align-items: center;
            justify-content: flex-start !important;
            gap: 8px !important;
            flex-wrap: nowrap !important;
            width: max-content !important;
            min-width: max-content !important;
        }


/* ---------------------------------------------------------
   HANDOVER TABLE
   --------------------------------------------------------- */

.handover-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
}

.handover-table {
    width: max-content !important;
    min-width: 1180px !important;
    max-width: none !important;
    table-layout: auto !important;
}


/* ---------------------------------------------------------
   SCROLLBAR
   --------------------------------------------------------- */

.crm-table-wrapper::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
.users-table-wrap::-webkit-scrollbar,
.business-unit-table-wrapper::-webkit-scrollbar,
.handover-table-wrapper::-webkit-scrollbar {
    height: 8px;
}

.crm-table-wrapper::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track,
.users-table-wrap::-webkit-scrollbar-track,
.business-unit-table-wrapper::-webkit-scrollbar-track,
.handover-table-wrapper::-webkit-scrollbar-track {
    background: #eef1f3;
    border-radius: 10px;
}

.crm-table-wrapper::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
.users-table-wrap::-webkit-scrollbar-thumb,
.business-unit-table-wrapper::-webkit-scrollbar-thumb,
.handover-table-wrapper::-webkit-scrollbar-thumb {
    background: #b3bac1;
    border-radius: 10px;
}

    .crm-table-wrapper::-webkit-scrollbar-thumb:hover,
    .table-responsive::-webkit-scrollbar-thumb:hover,
    .users-table-wrap::-webkit-scrollbar-thumb:hover,
    .business-unit-table-wrapper::-webkit-scrollbar-thumb:hover,
    .handover-table-wrapper::-webkit-scrollbar-thumb:hover {
        background: #929ba4;
    }


/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 1200px) {

    .crm-data-table,
    .crud-table,
    .dashboard-table {
        min-width: max-content;
    }

        .crm-data-table th,
        .crm-data-table td,
        .crud-table th,
        .crud-table td,
        .dashboard-table th,
        .dashboard-table td {
            padding-left: 12px;
            padding-right: 12px;
        }
}


@media (max-width: 700px) {

    .crm-table-wrapper,
    .table-responsive,
    .users-table-wrap,
    .business-unit-table-wrapper,
    .handover-table-wrapper {
        max-width: 100%;
    }

    .crm-data-table .actions-column,
    .crm-data-table .actions-cell,
    .crm-data-table .col-actions,
    .crud-table .actions-column,
    .crud-table .actions-cell,
    .crud-table .col-actions,
    .dashboard-table .actions-column,
    .dashboard-table .actions-cell,
    .dashboard-table .col-actions {
        min-width: 230px !important;
        width: 230px !important;
    }

    .crm-data-table.crm-has-actions th:last-child,
    .crm-data-table.crm-has-actions td:last-child,
    .crud-table.crm-has-actions th:last-child,
    .crud-table.crm-has-actions td:last-child {
        min-width: 230px !important;
        width: 230px !important;
    }

    .crm-data-table .crud-actions,
    .crud-table .crud-actions,
    .dashboard-table .crud-actions {
        flex-wrap: nowrap !important;
    }
}

/* =========================================================
   TABLE ACTION HEADER ALIGNMENT
   Keep Actions heading aligned with action buttons
   ========================================================= */

.crm-data-table .actions-column,
.crm-data-table .actions-cell,
.crm-data-table .col-actions,
.crud-table .actions-column,
.crud-table .actions-cell,
.crud-table .col-actions,
.dashboard-table .actions-column,
.dashboard-table .actions-cell,
.dashboard-table .col-actions {
    text-align: left !important;
}


/* Tables where Actions is simply the last column */
.crm-data-table.crm-has-actions th:last-child,
.crud-table.crm-has-actions th:last-child {
    text-align: left !important;
}


/* Keep the actual buttons aligned to the same left edge */
.crm-data-table .crud-actions,
.crud-table .crud-actions,
.dashboard-table .crud-actions {
    justify-content: flex-start !important;
    margin-left: 0 !important;
}

/* =========================================================
   ROLE PERMISSION ASSIGNMENT UI
   ========================================================= */
.permission-group-card{border:1px solid #e5e9e7;border-radius:12px;background:#fff;overflow:hidden}.permission-group-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 16px;background:#f7faf8;border-bottom:1px solid #e8ecea}.permission-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:14px}.permission-card{display:flex;align-items:flex-start;gap:10px;padding:11px 12px;border:1px solid #e8ecea;border-radius:9px;cursor:pointer;transition:.15s ease}.permission-card:hover{background:#f8fbf9;border-color:#cfe0d7}.permission-card input{margin-top:3px}.permission-card strong{font-size:12px}.permission-card small{font-size:10px}@media(max-width:900px){.permission-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.permission-grid{grid-template-columns:1fr}}
