/* =========================================================
   HiPaws CRM - Global Styles
   ========================================================= */

:root {
    --primary: #720E0B;
    --primary-dark: #570A08;
    --primary-hover: #620C09;
    --primary-light: #F5E9E8;
    --primary-soft: #FBF5F4;

    --accent: #F7C01D;
    --accent-dark: #D9A40A;
    --accent-light: #FFF4CC;
    --accent-soft: #FFFAEB;

    --white: #FFFFFF;
    --background: #F7F8FA;

    --text: #292929;
    --text-dark: #1F2937;
    --muted: #6B7280;

    --border: #E5E7EB;
    --border-dark: #D1D5DB;

    --success: #16803C;
    --success-bg: #ECFDF3;

    --danger: #B42318;
    --danger-bg: #FFF1F0;

    --radius-sm: 7px;
    --radius: 10px;
    --radius-lg: 16px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, .04);
    --shadow: 0 8px 24px rgba(0, 0, 0, .06);
    --shadow-lg: 0 22px 55px rgba(64, 32, 29, .10);

    --sidebar-width: 250px;
}


/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        sans-serif;

    color: var(--text);
    background: var(--background);
}

a {
    color: inherit;
}


/* =========================================================
   LOGIN PAGE
   ========================================================= */

.login-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 25px;

    background:
        radial-gradient(
            circle at top left,
            var(--accent-light) 0,
            transparent 32%
        ),
        linear-gradient(
            135deg,
            #FBF7F6 0%,
            #F7F8FA 50%,
            #FFFDF6 100%
        );
}

.login-wrapper {
    width: 100%;
    max-width: 440px;
}

.login-card {
    position: relative;

    width: 100%;

    padding: 38px 38px 32px;

    background: rgba(255, 255, 255, .97);

    border: 1px solid rgba(114, 14, 11, .09);
    border-radius: 18px;

    box-shadow: var(--shadow-lg);

    overflow: hidden;
}

.login-card::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 5px;

    background:
        linear-gradient(
            90deg,
            var(--primary),
            var(--accent)
        );
}


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

.login-brand {
    margin-bottom: 31px;
    text-align: center;
}

.login-logo {
    width: 100px;
    height: 100px;

    margin: 0 auto 17px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 8px;

    background: var(--white);

    border: 1px solid #F0E5E4;
    border-radius: 18px;

    box-shadow:
        0 8px 22px rgba(114, 14, 11, .08);
}

.login-logo img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    border-radius: 11px;
}

.login-brand h1 {
    margin: 0 0 7px;

    color: var(--primary);

    font-size: 27px;
    line-height: 1.2;
    font-weight: 750;

    letter-spacing: -.4px;
}

.login-brand p {
    margin: 0;

    color: var(--muted);

    font-size: 13.5px;
    line-height: 1.5;
}


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

.form-group {
    margin-bottom: 19px;
}

.form-label {
    display: block;

    margin-bottom: 7px;

    color: #3B3332;

    font-size: 13px;
    font-weight: 650;
}

.form-control {
    width: 100%;
    height: 49px;

    padding: 0 14px;

    color: var(--text);
    background: var(--white);

    border: 1px solid #DCDDDD;
    border-radius: 9px;

    outline: none;

    font-family: inherit;
    font-size: 14px;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    height: auto;
    min-height: 110px;

    padding-top: 12px;
    padding-bottom: 12px;

    resize: vertical;
}

.form-control:hover {
    border-color: #CFC5C4;
}

.form-control:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 3px rgba(114, 14, 11, .08);
}


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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;

    padding: 0 16px;

    border: 0;
    border-radius: var(--radius-sm);

    font-family: inherit;
    font-size: 14px;
    font-weight: 650;

    text-decoration: none;

    cursor: pointer;

    transition:
        background .2s ease,
        transform .15s ease,
        box-shadow .2s ease;
}

.btn-primary {
    color: var(--white);
    background: var(--primary);
}

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

    box-shadow:
        0 6px 15px rgba(114, 14, 11, .18);
}

.btn-accent {
    color: #342600;
    background: var(--accent);
}

.btn-accent:hover {
    background: var(--accent-dark);
}

.btn-secondary {
    color: var(--text-dark);

    background: #F3F4F6;

    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #E9EAEC;
}

.btn-block {
    width: 100%;
}

.login-button {
    height: 50px;
    margin-top: 4px;
}


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

.alert {
    padding: 11px 13px;

    margin-bottom: 19px;

    border-radius: 8px;

    font-size: 13px;
    line-height: 1.45;
}

.alert-error {
    color: var(--danger);

    background: var(--danger-bg);

    border: 1px solid #F4CECC;
}

.alert-info {
    color: #725708;

    background: var(--accent-soft);

    border: 1px solid #F5E2A1;
}

.alert-success {
    color: var(--success);

    background: var(--success-bg);

    border: 1px solid #B7E4C7;
}


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

.login-security {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    margin-top: 20px;

    color: #8A8F94;

    font-size: 11.5px;
}

.security-dot {
    color: var(--primary);
}

.login-footer {
    margin-top: 21px;

    padding-top: 18px;

    border-top: 1px solid #EFEFEF;

    text-align: center;

    color: #9A9A9A;

    font-size: 11.5px;
}

.login-footer strong {
    color: var(--primary);
}


/* =========================================================
   CRM MAIN LAYOUT
   ========================================================= */

.crm-layout {
    display: flex;

    width: 100%;
    min-height: 100vh;
}

.crm-sidebar {
    position: fixed;

    top: 0;
    left: 0;
    bottom: 0;

    width: var(--sidebar-width);

    padding: 20px 16px;

    color: var(--white);

    background: var(--primary);

    overflow-y: auto;
    overflow-x: hidden;

    z-index: 100;
}

.crm-main {
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;

    margin-left: var(--sidebar-width);

    display: flex;
    flex-direction: column;
}

.crm-header {
    min-height: 72px;

    padding: 14px 28px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    flex: 0 0 auto;

    background: var(--white);

    border-bottom: 1px solid var(--border);
}

.crm-content {
    flex: 1;

    width: 100%;

    padding: 28px;
}


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

.sidebar-brand {
    display: flex;
    align-items: center;

    gap: 11px;

    padding: 0 8px 18px;

    margin-bottom: 10px;

    border-bottom:
        1px solid rgba(255, 255, 255, .13);
}

.sidebar-logo {
    width: 43px;
    height: 43px;

    flex: 0 0 43px;

    padding: 3px;

    object-fit: contain;

    background: var(--white);

    border-radius: 8px;
}

.sidebar-brand-text {
    min-width: 0;
}

.sidebar-brand-text strong {
    display: block;

    color: var(--white);

    font-size: 16px;
    font-weight: 700;

    white-space: nowrap;
}

.sidebar-brand-text span {
    display: block;

    margin-top: 2px;

    color: rgba(255, 255, 255, .65);

    font-size: 10px;
    line-height: 1.4;

    white-space: nowrap;
}


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

.sidebar-nav {
    width: 100%;

    padding-bottom: 20px;
}

.sidebar-nav > a {
    display: flex;
    align-items: center;

    width: 100%;
    min-height: 40px;

    margin: 2px 0;

    padding: 0 12px;

    color: rgba(255, 255, 255, .80);

    border-radius: 8px;

    text-decoration: none;

    font-size: 13px;
    font-weight: 500;

    transition:
        background .2s ease,
        color .2s ease;
}

.sidebar-nav > a:hover {
    color: var(--white);

    background:
        rgba(255, 255, 255, .09);
}

.sidebar-nav > a.active {
    color: #352600;

    background: var(--accent);

    font-weight: 650;
}

.sidebar-main-link {
    margin-bottom: 5px !important;
}


/* =========================================================
   COLLAPSIBLE SIDEBAR MODULE
   ========================================================= */

.sidebar-module {
    width: 100%;

    margin: 3px 0 6px;
}

.sidebar-module-title {
    width: 100%;
    min-height: 40px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;

    padding: 0 12px;

    color: rgba(255, 255, 255, .90);

    background:
        rgba(255, 255, 255, .04);

    border-radius: 8px;

    font-size: 13px;
    font-weight: 650;

    cursor: pointer;
    user-select: none;

    list-style: none;

    transition:
        background .2s ease,
        color .2s ease;
}

.sidebar-module-title::-webkit-details-marker {
    display: none;
}

.sidebar-module-title::marker {
    content: "";
}

.sidebar-module-title:hover {
    color: var(--white);

    background:
        rgba(255, 255, 255, .09);
}

.sidebar-module-arrow {
    display: inline-block;

    flex: 0 0 auto;

    font-size: 17px;
    line-height: 1;

    opacity: .75;

    transform: rotate(0deg);

    transition:
        transform .2s ease;
}

.sidebar-module[open] .sidebar-module-arrow {
    transform: rotate(90deg);
}


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

.sidebar-module .sidebar-submenu {
    display: block;

    margin: 5px 0 5px 13px;

    padding: 2px 0 2px 10px;

    border-left:
        1px solid rgba(255, 255, 255, .15);
}

.sidebar-module:not([open]) .sidebar-submenu {
    display: none;
}

.sidebar-module .sidebar-submenu a {
    min-height: 32px;

    display: flex;
    align-items: center;

    margin: 1px 0;

    padding: 0 10px;

    color:
        rgba(255, 255, 255, .70);

    background: transparent;

    border-radius: 6px;

    text-decoration: none;

    font-size: 12px;
    font-weight: 400;

    transition:
        background .2s ease,
        color .2s ease;
}

.sidebar-module .sidebar-submenu a:hover {
    color: var(--white);

    background:
        rgba(255, 255, 255, .08);
}

.sidebar-module .sidebar-submenu a.active-sub {
    color: #352600;

    background: var(--accent);

    font-weight: 650;
}


/* =========================================================
   FUTURE / DISABLED MODULES
   ========================================================= */

.sidebar-disabled-group {
    width: 100%;
    min-height: 38px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 8px;

    margin: 2px 0;

    padding: 0 12px;

    color:
        rgba(255, 255, 255, .48);

    border-radius: 7px;

    font-size: 12.5px;
}

.sidebar-disabled-group span:first-child {
    min-width: 0;
}

.sidebar-disabled-group span:last-child {
    flex: 0 0 auto;

    padding: 3px 6px;

    color:
        rgba(255, 255, 255, .65);

    background:
        rgba(255, 255, 255, .10);

    border-radius: 10px;

    font-size: 8px;
    font-weight: 700;

    letter-spacing: .4px;
    text-transform: uppercase;
}


/* =========================================================
   CRM HEADER
   ========================================================= */

.header-left {
    display: flex;
    align-items: center;
}

.header-page-title {
    color: var(--text-dark);

    font-size: 17px;
    font-weight: 700;
}

.header-right {
    display: flex;
    align-items: center;

    gap: 12px;
}

.header-user {
    padding-right: 15px;
    margin-right: 3px;

    border-right:
        1px solid var(--border);

    text-align: right;
}

.header-user-name {
    display: block;

    color: var(--text-dark);

    font-size: 13px;
    font-weight: 650;
}

.header-user-role {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 11px;
}


/* =========================================================
   COMMON PAGE ELEMENTS
   ========================================================= */

.page-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 20px;
}

.page-title {
    margin: 0;

    color: var(--text-dark);

    font-size: 27px;
    line-height: 1.25;
}

.page-subtitle {
    margin: 6px 0 25px;

    color: var(--muted);

    font-size: 14px;
}

.card {
    background: var(--white);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow-sm);
}


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

.dashboard-grid {
    display: grid;

    grid-template-columns:
        repeat(4, minmax(170px, 1fr));

    gap: 17px;
}

.stat-card {
    padding: 20px;
}

.stat-label {
    margin-bottom: 10px;

    color: var(--muted);

    font-size: 11.5px;
    font-weight: 650;

    text-transform: uppercase;

    letter-spacing: .4px;
}

.stat-value {
    color: var(--primary);

    font-size: 29px;
    font-weight: 750;
}


/* =========================================================
   ACCOUNT SETTINGS
   ========================================================= */

.account-card {
    max-width: 650px;

    padding: 28px;
}

.settings-divider {
    height: 1px;

    margin: 28px 0;

    background: var(--border);
}

.settings-heading {
    margin: 0 0 6px;

    color: var(--primary);

    font-size: 18px;
}

.settings-help {
    margin: 0 0 22px;

    color: var(--muted);

    font-size: 13px;
    line-height: 1.6;
}


/* =========================================================
   STAFF FILTERS
   ========================================================= */

.staff-filter-card {
    padding: 20px;

    margin-bottom: 20px;
}

.staff-filter-form {
    display: grid;

    grid-template-columns:
        2fr 1fr 1fr auto;

    gap: 14px;

    align-items: end;
}

.filter-actions {
    display: flex;

    gap: 8px;
}


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

.staff-table-card {
    overflow: hidden;
}

.table-header {
    padding: 18px 20px;

    border-bottom:
        1px solid var(--border);
}

.table-header strong {
    color: var(--text-dark);

    font-size: 15px;
}

.record-count {
    margin-left: 8px;

    color: var(--muted);

    font-size: 12px;
}

.table-responsive {
    width: 100%;

    overflow-x: auto;
}

.staff-table {
    width: 100%;

    border-collapse: collapse;
}

.staff-table th {
    padding: 13px 16px;

    color: var(--muted);

    background: #FAFAFA;

    border-bottom:
        1px solid var(--border);

    text-align: left;

    white-space: nowrap;

    font-size: 11px;
    font-weight: 700;

    text-transform: uppercase;

    letter-spacing: .35px;
}

.staff-table td {
    padding: 15px 16px;

    color: var(--text);

    border-bottom:
        1px solid #F0F0F0;

    font-size: 13px;

    vertical-align: middle;
}

.staff-table tbody tr:hover {
    background: var(--primary-soft);
}


/* =========================================================
   STAFF PERSON / PHOTO
   ========================================================= */

.staff-person {
    display: flex;
    align-items: center;

    gap: 11px;
}

.staff-person strong {
    display: block;

    color: var(--text-dark);

    font-size: 13px;
}

.staff-person span {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 11px;
}

.staff-avatar,
.staff-avatar-placeholder {
    width: 40px;
    height: 40px;

    flex: 0 0 40px;

    border-radius: 50%;
}

.staff-avatar {
    object-fit: cover;
}

.staff-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--primary);

    background: var(--primary-light);

    font-size: 15px;
    font-weight: 700;
}


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

.status-badge {
    display: inline-flex;
    align-items: center;

    padding: 5px 9px;

    border-radius: 20px;

    font-size: 11px;
    font-weight: 650;

    white-space: nowrap;
}

.status-active {
    color: #14783A;

    background: #EAF8EF;
}

.status-inactive {
    color: #896600;

    background: var(--accent-light);
}

.status-left {
    color: #7A7F87;

    background: #F0F1F2;
}


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

.table-actions {
    display: flex;

    gap: 10px;
}

.action-link {
    color: var(--primary);

    text-decoration: none;

    font-size: 12px;
    font-weight: 650;

    white-space: nowrap;
}

.action-link:hover {
    text-decoration: underline;
}


/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    padding: 50px 20px !important;

    text-align: center;
}

.empty-state strong {
    display: block;

    margin-bottom: 5px;

    color: var(--text-dark);
}

.empty-state span {
    color: var(--muted);

    font-size: 12px;
}


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

.crm-footer {
    flex: 0 0 auto;

    width: 100%;

    margin-top: auto;

    padding: 16px 28px;

    color: var(--muted);
    background: var(--background);

    border-top:
        1px solid var(--border);

    font-size: 11.5px;
    line-height: 1.5;

    text-align: center;
}


/* =========================================================
   RESPONSIVE - TABLET
   ========================================================= */

@media (max-width: 1050px) {

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

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

    .filter-search {
        grid-column: 1 / -1;
    }
}


/* =========================================================
   RESPONSIVE - SMALL TABLET
   ========================================================= */

@media (max-width: 760px) {

    :root {
        --sidebar-width: 210px;
    }

    .crm-sidebar {
        padding-left: 12px;
        padding-right: 12px;
    }

    .crm-content {
        padding: 20px;
    }

    .crm-header {
        padding-left: 18px;
        padding-right: 18px;
    }

    .header-user {
        display: none;
    }

    .header-right {
        gap: 7px;
    }

    .sidebar-brand {
        padding-left: 5px;
        padding-right: 5px;
    }

    .sidebar-brand-text strong {
        font-size: 14px;
    }

    .sidebar-brand-text span {
        font-size: 9px;
    }
}


/* =========================================================
   RESPONSIVE - MOBILE
   ========================================================= */

@media (max-width: 700px) {

    .page-heading-row {
        flex-direction: column;
    }

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

    .filter-search {
        grid-column: auto;
    }
}


@media (max-width: 600px) {

    .login-page {
        padding: 16px;
    }

    .login-card {
        padding: 32px 23px 27px;

        border-radius: 15px;
    }

    .login-logo {
        width: 88px;
        height: 88px;
    }

    .login-brand h1 {
        font-size: 24px;
    }

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

/* =========================================================
   DASHBOARD MODULE CARDS
   Scoped ONLY to CRM main dashboard
   Existing CRM styles remain untouched
   ========================================================= */

.crm-content .module-overview-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 18px !important;
    margin-top: 22px !important;
}


/* ALL MODULE CARDS */

.crm-content .module-overview-grid > .module-overview-card {
    display: flex !important;
    flex-direction: column !important;

    min-width: 0 !important;
    min-height: 245px !important;

    margin: 0 !important;
    padding: 20px !important;

    background: #ffffff !important;

    border: 1px solid #E2E6EA !important;
    border-radius: 12px !important;

    box-shadow: 0 3px 12px rgba(17, 24, 39, 0.05) !important;

    color: #172033 !important;
    text-decoration: none !important;

    overflow: hidden !important;

    transition:
        transform .2s ease,
        box-shadow .2s ease,
        border-color .2s ease !important;
}


/* STAFF CLICKABLE CARD */

.crm-content .module-overview-grid > a.module-overview-card,
.crm-content .module-overview-grid > a.module-overview-card:visited {
    color: #172033 !important;
    text-decoration: none !important;
}


.crm-content .module-overview-grid > a.module-overview-card:hover {
    transform: translateY(-3px) !important;

    border-color: rgba(114, 14, 11, .22) !important;

    box-shadow: 0 10px 26px rgba(17, 24, 39, .09) !important;

    color: #172033 !important;
    text-decoration: none !important;
}


/* CARD TOP */

.crm-content .module-card-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;

    gap: 12px !important;

    margin: 0 0 18px !important;
}


/* MODULE ICON */

.crm-content .module-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: 44px !important;
    height: 44px !important;
    flex: 0 0 44px !important;

    margin: 0 !important;
    padding: 0 !important;

    background: #F5E9E8 !important;
    color: #720E0B !important;

    border: 1px solid rgba(114, 14, 11, .08) !important;
    border-radius: 10px !important;

    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;

    text-decoration: none !important;
}


/* STATUS BADGE */

.crm-content .module-status {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;

    width: auto !important;

    margin: 0 !important;
    padding: 6px 9px !important;

    background: #F1F3F5 !important;
    color: #737983 !important;

    border: 0 !important;
    border-radius: 999px !important;

    font-size: 9px !important;
    font-weight: 750 !important;
    line-height: 1 !important;

    text-decoration: none !important;
    text-transform: uppercase !important;
    letter-spacing: .35px !important;
}


.crm-content .module-status.module-status-active {
    background: #EAF7EF !important;
    color: #247A45 !important;
}


/* CONTENT */

.crm-content .module-card-content {
    display: block !important;
    flex: 1 !important;

    margin: 0 !important;
    padding: 0 !important;
}


.crm-content .module-card-content h2 {
    display: block !important;

    margin: 0 0 8px !important;
    padding: 0 !important;

    color: #172033 !important;

    font-size: 17px !important;
    font-weight: 750 !important;
    line-height: 1.35 !important;

    text-decoration: none !important;
}


.crm-content .module-overview-card:hover .module-card-content h2 {
    color: #720E0B !important;
    text-decoration: none !important;
}


.crm-content .module-card-content p {
    display: block !important;

    margin: 0 !important;
    padding: 0 !important;

    color: #687182 !important;

    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.65 !important;

    text-decoration: none !important;
}


/* STAFF NUMBERS */

.crm-content .module-card-stats {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;

    margin: 18px 0 0 !important;
    padding: 0 !important;

    border-top: 1px solid #E5E7EB !important;
    border-bottom: 1px solid #E5E7EB !important;
}


.crm-content .module-card-stats > div {
    display: block !important;

    margin: 0 !important;
    padding: 12px 0 !important;
}


.crm-content .module-card-stats > div + div {
    padding-left: 16px !important;

    border-left: 1px solid #E5E7EB !important;
}


.crm-content .module-card-stats strong {
    display: block !important;

    margin: 0 0 3px !important;

    color: #720E0B !important;

    font-size: 20px !important;
    font-weight: 800 !important;
    line-height: 1.1 !important;

    text-decoration: none !important;
}


.crm-content .module-card-stats span {
    display: block !important;

    margin: 0 !important;

    color: #7B8390 !important;

    font-size: 10px !important;
    font-weight: 500 !important;

    text-decoration: none !important;
}


/* STAFF CARD BOTTOM LINK */

.crm-content .module-card-link {
    display: block !important;

    margin: 13px 0 0 !important;
    padding: 0 !important;

    color: #720E0B !important;

    font-size: 11.5px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;

    text-decoration: none !important;
}


/* COMING SOON */

.crm-content .module-overview-grid > .module-coming-soon {
    background: #FCFCFC !important;
}


.crm-content .module-coming-soon .module-icon {
    background: #F1F2F4 !important;
    color: #777D85 !important;

    border-color: #E5E7EB !important;
}


.crm-content .module-coming-soon .module-card-content h2 {
    color: #4B5563 !important;
}


.crm-content .module-card-placeholder {
    display: block !important;

    margin: 18px 0 0 !important;
    padding: 12px 0 0 !important;

    border-top: 1px solid #E5E7EB !important;

    color: #92969C !important;

    font-size: 10.5px !important;
    line-height: 1.5 !important;
}


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

@media (max-width: 1200px) {

    .crm-content .module-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

}


@media (max-width: 700px) {

    .crm-content .module-overview-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .crm-content .module-overview-grid > .module-overview-card {
        min-height: auto !important;
        padding: 18px !important;
    }

}

/* =========================================================
   ADD / EDIT STAFF FORM
   Scoped to .staff-form only
   Does NOT modify global CRM components
   ========================================================= */

.staff-form {
    width: 100%;
    max-width: 1100px;
}


/* Section Card */

.staff-form .form-section {
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden;
}


/* Section Header */

.staff-form .form-section-header {
    padding: 18px 22px 16px;

    background: var(--primary-soft);
    border-bottom: 1px solid var(--border);
}

.staff-form .form-section-header h2 {
    margin: 0 0 4px;

    color: var(--primary);

    font-size: 15px;
    font-weight: 750;
    line-height: 1.35;
}

.staff-form .form-section-header p {
    margin: 0;

    color: var(--muted);

    font-size: 11.5px;
    line-height: 1.5;
}


/* Section Body */

.staff-form .form-section-body {
    padding: 22px;
}


/* Two Column Form */

.staff-form .staff-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    column-gap: 22px;
    row-gap: 18px;
}


/* Existing global form-group has margin.
   Remove it ONLY inside staff form because grid controls spacing. */

.staff-form .form-group {
    min-width: 0;
    margin-bottom: 0;
}


/* Full width fields */

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


/* Labels */

.staff-form .form-label {
    display: block;

    margin-bottom: 7px;

    color: var(--text-dark);

    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.4;
}


/* Required */

.staff-form .required {
    margin-left: 2px;

    color: var(--danger);
}


/* Inputs / Selects */

.staff-form .form-control {
    width: 100%;
}


/* Readonly Staff ID */

.staff-form input[readonly] {
    background: #F7F8FA;
    color: #626B78;

    cursor: not-allowed;
}


/* File Input */

.staff-form .file-control {
    padding: 7px 9px;
}

.staff-form .file-control::file-selector-button {
    height: 32px;

    margin-right: 10px;
    padding: 0 12px;

    border: 1px solid var(--border);
    border-radius: 6px;

    background: #F5F6F7;
    color: var(--text-dark);

    font-family: inherit;
    font-size: 11px;
    font-weight: 600;

    cursor: pointer;
}


/* Help Text */

.staff-form .form-help {
    display: block;

    margin-top: 6px;

    color: var(--muted);

    font-size: 10.5px;
    line-height: 1.45;
}


/* Form Actions */

.staff-form .staff-form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 10px;

    margin-top: 4px;
    padding: 18px 20px;

    background: #FFFFFF;

    border: 1px solid var(--border);
    border-radius: var(--radius-lg);

    box-shadow: var(--shadow-sm);
}


/* Error List - scoped */

.staff-form + * {
    box-sizing: border-box;
}

.form-error-list {
    margin: 9px 0 0;
    padding-left: 18px;
}

.form-error-list li {
    margin-bottom: 4px;

    font-size: 11.5px;
    line-height: 1.5;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {

    .staff-form {
        max-width: none;
    }

}


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

@media (max-width: 700px) {

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

        row-gap: 16px;
    }

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

    .staff-form .form-section-header {
        padding: 16px 17px 14px;
    }

    .staff-form .form-section-body {
        padding: 17px;
    }

    .staff-form .staff-form-actions {
        padding: 15px;

        flex-direction: column-reverse;
        align-items: stretch;
    }

    .staff-form .staff-form-actions .btn {
        width: 100%;
        justify-content: center;
    }

}

/* =========================================================
   STAFF PROFILE / VIEW STAFF
   Scoped profile styles
   ========================================================= */


/* ---------------------------------------------------------
   PAGE HEADING ACTIONS
--------------------------------------------------------- */

.staff-profile-heading-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}


/* ---------------------------------------------------------
   PROFILE SUMMARY
--------------------------------------------------------- */

.staff-profile-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;

    padding: 22px 24px;
    margin-bottom: 20px;

    border-left: 4px solid var(--primary);
}

.staff-profile-identity {
    display: flex;
    align-items: center;
    gap: 18px;

    min-width: 0;
}


/* Photo */

.staff-profile-photo,
.staff-profile-photo-placeholder {
    width: 76px;
    height: 76px;

    flex: 0 0 76px;

    border-radius: 12px;
}

.staff-profile-photo {
    display: block;
    object-fit: cover;

    border: 1px solid var(--border);
}

.staff-profile-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--primary-light);
    border: 1px solid #E8CECC;

    color: var(--primary);

    font-size: 26px;
    font-weight: 750;
}


/* Name */

.staff-profile-name {
    min-width: 0;
}

.staff-profile-code {
    display: inline-flex;
    align-items: center;

    min-height: 25px;

    padding: 4px 9px;
    margin-bottom: 7px;

    background: var(--accent-soft);
    border: 1px solid #F3E1A1;
    border-radius: 6px;

    color: #725500;

    font-size: 10.5px;
    font-weight: 700;
    line-height: 1;
}

.staff-profile-name h2 {
    margin: 0 0 5px;

    color: var(--text-dark);

    font-size: 21px;
    font-weight: 750;
    line-height: 1.3;

    overflow-wrap: anywhere;
}

.staff-profile-name p {
    margin: 0;

    color: var(--muted);

    font-size: 12px;
    line-height: 1.5;
}


/* Status */

.staff-profile-status {
    display: flex;
    align-items: center;

    flex: 0 0 auto;
}


/* ---------------------------------------------------------
   PROFILE SECTIONS
--------------------------------------------------------- */

.staff-profile-section {
    padding: 0;
    margin-bottom: 20px;

    overflow: hidden;
}

.staff-profile-section-header {
    padding: 17px 22px 15px;

    background: var(--primary-soft);
    border-bottom: 1px solid var(--border);
}

.staff-profile-section-header h2 {
    margin: 0 0 4px;

    color: var(--primary);

    font-size: 15px;
    font-weight: 750;
    line-height: 1.35;
}

.staff-profile-section-header p {
    margin: 0;

    color: var(--muted);

    font-size: 11.5px;
    line-height: 1.5;
}

.staff-profile-section-body {
    padding: 6px 22px 10px;
}


/* ---------------------------------------------------------
   INFORMATION GRID
--------------------------------------------------------- */

.staff-profile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    column-gap: 0;
}


/* Individual Field */

.staff-info-item {
    min-width: 0;

    padding: 16px 18px 16px 0;
    margin-right: 18px;

    border-bottom: 1px solid var(--border);
}


/* Remove right spacing from every third item */

.staff-profile-grid .staff-info-item:nth-child(3n) {
    margin-right: 0;
}


/* Labels */

.staff-info-label {
    display: block;

    margin-bottom: 5px;

    color: var(--muted);

    font-size: 10.5px;
    font-weight: 650;
    line-height: 1.4;

    text-transform: uppercase;
    letter-spacing: 0.025em;
}


/* Values */

.staff-info-value {
    display: block;

    color: var(--text-dark);

    font-size: 12.5px;
    font-weight: 650;
    line-height: 1.5;

    overflow-wrap: anywhere;
}


/* Address section contains one field */

.staff-profile-section-body > .staff-info-item {
    margin-right: 0;
}


/* ---------------------------------------------------------
   TABLET
--------------------------------------------------------- */

@media (max-width: 1000px) {

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

    .staff-profile-grid .staff-info-item:nth-child(3n) {
        margin-right: 18px;
    }

    .staff-profile-grid .staff-info-item:nth-child(2n) {
        margin-right: 0;
    }

}


/* ---------------------------------------------------------
   MOBILE
--------------------------------------------------------- */

@media (max-width: 700px) {

    .staff-profile-heading-actions {
        width: 100%;

        justify-content: flex-start;
    }

    .staff-profile-summary {
        align-items: flex-start;

        padding: 18px;

        flex-direction: column;
        gap: 16px;
    }

    .staff-profile-identity {
        width: 100%;
    }

    .staff-profile-photo,
    .staff-profile-photo-placeholder {
        width: 62px;
        height: 62px;

        flex-basis: 62px;
    }

    .staff-profile-photo-placeholder {
        font-size: 22px;
    }

    .staff-profile-name h2 {
        font-size: 18px;
    }

    .staff-profile-status {
        width: 100%;
    }

    .staff-profile-section-header {
        padding: 15px 17px 13px;
    }

    .staff-profile-section-body {
        padding: 4px 17px 8px;
    }

    .staff-profile-grid {
        grid-template-columns: 1fr;
    }

    .staff-profile-grid .staff-info-item,
    .staff-profile-grid .staff-info-item:nth-child(2n),
    .staff-profile-grid .staff-info-item:nth-child(3n) {
        margin-right: 0;
    }

    .staff-info-item {
        padding: 14px 0;
    }

}


/* ---------------------------------------------------------
   SMALL MOBILE
--------------------------------------------------------- */

@media (max-width: 480px) {

    .staff-profile-heading-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .staff-profile-heading-actions .btn {
        width: 100%;
        justify-content: center;

        text-align: center;
    }

    .staff-profile-identity {
        align-items: flex-start;
    }

}

/* =========================================================
   STAFF PROFILE - CHANGE HISTORY
========================================================= */

.staff-history-list {
    display: flex;
    flex-direction: column;
}

.staff-history-item {
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}

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

.staff-history-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;

    margin-bottom: 13px;
}

.staff-history-field {
    display: block;

    margin-bottom: 3px;

    color: var(--text-dark);

    font-size: 12.5px;
    font-weight: 700;
}

.staff-history-date {
    display: block;

    color: var(--muted);

    font-size: 10.5px;
}

.staff-history-user {
    flex: 0 0 auto;

    padding: 4px 8px;

    background: var(--primary-soft);
    border-radius: 5px;

    color: var(--primary);

    font-size: 10px;
    font-weight: 650;
}

.staff-history-change {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr);
    align-items: center;

    gap: 10px;
}

.staff-history-value {
    min-width: 0;

    padding: 11px 13px;

    background: #F8F9FA;
    border: 1px solid var(--border);
    border-radius: 7px;
}

.staff-history-value span {
    display: block;

    margin-bottom: 4px;

    color: var(--muted);

    font-size: 9.5px;
    font-weight: 650;

    text-transform: uppercase;
}

.staff-history-value strong {
    display: block;

    color: var(--text-dark);

    font-size: 11.5px;
    font-weight: 650;

    overflow-wrap: anywhere;
}

.staff-history-arrow {
    color: var(--primary);

    text-align: center;

    font-size: 16px;
    font-weight: 700;
}

.staff-history-reason {
    margin-top: 9px;

    color: var(--muted);

    font-size: 10.5px;
}

.staff-history-empty {
    padding: 25px 0;

    text-align: center;
}

.staff-history-empty strong {
    display: block;

    margin-bottom: 4px;

    color: var(--text-dark);

    font-size: 12px;
}

.staff-history-empty p {
    margin: 0;

    color: var(--muted);

    font-size: 11px;
}


/* Mobile */

@media (max-width: 700px) {

    .staff-history-top {
        flex-direction: column;
    }

    .staff-history-change {
        grid-template-columns: 1fr;
    }

    .staff-history-arrow {
        transform: rotate(90deg);
    }

}