/* =========================================================
   CoShare CRM
   ========================================================= */

:root {

    --bg: #f4f7fb;

    --white: #ffffff;

    --sidebar: #111827;

    --sidebar-dark: #0f172a;

    --text: #172033;

    --muted: #778396;

    --line: #e4e9f0;

    --blue: #1769e0;

    --blue-dark: #1254b6;

    --blue-soft: #eaf2ff;

    --shadow:
        0 8px 28px rgba(16,24,40,.06);

    --radius: 14px;
}


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

* {
    box-sizing: border-box;
}


html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}


body {

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

    font-size: 14px;

    color: var(--text);

    background: var(--bg);
}


body.sidebar-open {
    overflow: hidden;
}


a {
    color: inherit;
    text-decoration: none;
}


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


button {
    cursor: pointer;
}


/* =========================================================
   APP
   ========================================================= */

.app-shell {
    min-height: 100vh;
}


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

.sidebar {

    position: fixed;

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

    width: 252px;

    display: flex;

    flex-direction: column;

    padding: 20px 14px;

    background:
        linear-gradient(
            180deg,
            var(--sidebar),
            var(--sidebar-dark)
        );

    color: #aeb9ca;

    z-index: 1000;

    overflow: hidden;
}


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

.brand {

    position: relative;

    flex-shrink: 0;

    display: flex;

    align-items: center;

    gap: 11px;

    padding:
        4px 10px 24px;
}


.brand-mark {

    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    display: grid;

    place-items: center;

    border-radius: 11px;

    background:
        linear-gradient(
            135deg,
            #3d8bff,
            #1254b6
        );

    color: #fff;

    font-size: 18px;

    font-weight: 900;
}


.brand-text strong {

    display: block;

    color: #fff;

    font-size: 16px;
}


.brand-text small {

    display: block;

    margin-top: 3px;

    color: #7e8ba0;

    font-size: 9px;

    letter-spacing: .1em;

    text-transform: uppercase;
}


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

.sidebar-nav {

    flex: 1 1 auto;

    min-height: 0;

    overflow-y: auto;

    overflow-x: hidden;

    padding-right: 2px;

    scrollbar-width: none;

    -ms-overflow-style: none;
}


.sidebar-nav::-webkit-scrollbar {

    width: 0;

    height: 0;

    display: none;
}


/* =========================================================
   NAV SECTION
   ========================================================= */

.nav-section-label {

    padding:
        10px 12px 6px;

    color: #637086;

    font-size: 10px;

    font-weight: 800;

    letter-spacing: .1em;
}


.tools-label {
    margin-top: 12px;
}


/* =========================================================
   NAV ITEM
   ========================================================= */

.nav-item {

    display: flex;

    align-items: center;

    width: 100%;

    height: 42px;

    margin: 3px 0;

    padding:
        0 12px;

    gap: 12px;

    border-radius: 9px;

    color: #aeb9ca;

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


.nav-item:hover {

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

    color: #fff;
}


.nav-item.active {

    background:
        rgba(
            47,
            125,
            244,
            .16
        );

    color: #fff;

    box-shadow:
        inset 3px 0 #3d8bff;
}


.nav-icon {

    width: 20px;

    flex: 0 0 20px;

    text-align: center;

    font-size: 17px;
}


.nav-label-text {

    font-size: 13px;
}


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

.sidebar-footer {

    flex-shrink: 0;

    margin-top: 12px;

    padding:
        14px 10px 2px;

    border-top:
        1px solid
        rgba(
            255,
            255,
            255,
            .07
        );

    color: #8793a6;

    font-size: 10px;
}


.system-status {

    display: flex;

    align-items: center;

    gap: 7px;
}


.status-dot {

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #2bcf88;
}


.sidebar-footer small {

    display: block;

    margin-top: 8px;

    color: #5e6a7c;
}


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

.sidebar-close {

    display: none;

    border: 0;

    background: transparent;

    color: #fff;
}


/* =========================================================
   OVERLAY
   ========================================================= */

.sidebar-overlay {
    display: none;
}


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

.main-shell {

    min-height: 100vh;

    margin-left: 252px;
}


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

.topbar {

    position: sticky;

    top: 0;

    z-index: 900;

    height: 70px;

    display: flex;

    align-items: center;

    gap: 20px;

    padding:
        0 30px;

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

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

    backdrop-filter: blur(10px);
}


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

.mobile-menu {

    display: none;

    width: 40px;
    height: 40px;

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

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

    border-radius: 9px;

    background: #fff;

    color: var(--text);

    font-size: 20px;
}


/* =========================================================
   SEARCH
   ========================================================= */

.global-search {

    flex: 1;

    max-width: 600px;

    height: 40px;

    display: flex;

    align-items: center;

    gap: 9px;

    padding:
        0 11px;

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

    border-radius: 9px;

    background: #f8fafc;

    color: #7d8999;
}


.search-symbol {
    font-size: 21px;
}


.global-search input {

    flex: 1;

    min-width: 0;

    border: 0;

    outline: 0;

    background: transparent;

    color: var(--text);
}


.global-search input::placeholder {
    color: #9aa4b3;
}


.global-search kbd {

    padding:
        3px 6px;

    border:
        1px solid
        #d8dee7;

    border-radius: 5px;

    background: #fff;

    font-size: 10px;
}


/* =========================================================
   TOP ACTIONS
   ========================================================= */

.top-actions {

    display: flex;

    align-items: center;

    gap: 12px;

    margin-left: auto;
}


/* =========================================================
   NOTIFICATIONS
   ========================================================= */

.notification-button {

    position: relative;

    width: 38px;
    height: 38px;

    flex: 0 0 38px;

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

    border-radius: 9px;

    background: #fff;

    color: #657286;

    transition:
        background .15s ease,
        border-color .15s ease,
        color .15s ease;
}


.notification-button:hover {

    background: #f8fafc;

    border-color: #d5dde7;

    color: var(--text);
}


.notification-dot {

    position: absolute;

    top: 7px;
    right: 8px;

    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: #e04b4b;
}


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

.user-profile {

    display: flex;

    align-items: center;

    gap: 9px;

    min-width: 0;
}


.user-avatar {

    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    display: grid;

    place-items: center;

    border-radius: 10px;

    background: var(--blue-soft);

    color: #1b5fca;

    font-weight: 800;
}


.user-info {

    min-width: 0;
}


.user-info strong {

    display: block;

    overflow: hidden;

    max-width: 150px;

    color: var(--text);

    font-size: 12px;

    line-height: 1.3;

    text-overflow: ellipsis;

    white-space: nowrap;
}


.user-info small {

    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 10px;
}


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

.logout-link {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    height: 36px;

    padding:
        0 12px;

    border:
        1px solid
        #e4e9f0;

    border-radius: 9px;

    background: #fff;

    color: #667085;

    font-size: 11px;

    font-weight: 800;

    line-height: 1;

    white-space: nowrap;

    transition:
        background .15s ease,
        border-color .15s ease,
        color .15s ease,
        transform .1s ease;
}


.logout-link:hover {

    border-color: #efcfcf;

    background: #fff7f7;

    color: #b63838;
}


.logout-link:active {

    transform:
        translateY(1px);
}


.logout-link:focus-visible {

    outline: none;

    border-color: #e7a5a5;

    box-shadow:
        0 0 0 3px
        rgba(
            182,
            56,
            56,
            .10
        );
}


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

.content {

    min-height:
        calc(100vh - 112px);

    padding:
        28px 30px;
}


/* =========================================================
   PAGE HEADER
   ========================================================= */

.page-header {

    display: flex;

    align-items: flex-end;

    justify-content: space-between;

    gap: 20px;

    margin-bottom: 24px;
}


.breadcrumb {

    margin-bottom: 7px;

    color: #8a95a5;

    font-size: 11px;
}


.breadcrumb b {

    padding:
        0 6px;

    color: #c3cad3;
}


.page-header h1 {

    margin: 0;

    font-size: 25px;

    letter-spacing: -.03em;
}


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

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


.form-group label {

    display: block;

    margin-bottom: 7px;

    color: #475569;

    font-size: 11px;

    font-weight: 800;
}


.form-group input,
.form-group select,
.form-group textarea {

    display: block;

    width: 100%;

    min-width: 0;

    height: 40px;

    padding:
        0 11px;

    border:
        1px solid
        #dbe2ea;

    border-radius: 8px;

    outline: none;

    background: #f8fafc;

    color: var(--text);

    font-size: 12px;

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


.form-group textarea {

    height: auto;

    min-height: 90px;

    padding:
        10px 11px;

    resize: vertical;
}


.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9aa4b3;
}


.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {

    border-color: #cbd5e1;

    background: #fff;
}


.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {

    border-color: #6da5f5;

    background: #fff;

    box-shadow:
        0 0 0 3px
        rgba(
            23,
            105,
            224,
            .10
        );
}


.form-group select {

    appearance: none;

    padding-right: 34px;

    background-image:
        linear-gradient(
            45deg,
            transparent 50%,
            #7b8798 50%
        ),
        linear-gradient(
            135deg,
            #7b8798 50%,
            transparent 50%
        );

    background-position:
        calc(100% - 15px) 17px,
        calc(100% - 10px) 17px;

    background-size:
        5px 5px,
        5px 5px;

    background-repeat: no-repeat;
}


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

.stat-grid {

    display: grid;

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

    gap: 15px;
}


.stat {

    min-width: 0;

    padding: 18px;

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

    border-radius: var(--radius);

    background: #fff;

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


.stat-label {

    color: #7a8697;

    font-size: 10px;

    font-weight: 800;

    letter-spacing: .06em;

    text-transform: uppercase;
}


.stat-value {

    margin-top: 7px;

    font-size: 27px;

    font-weight: 850;
}


.stat-note {

    margin-top: 4px;

    color: #8b96a6;

    font-size: 10px;
}


/* =========================================================
   PANEL
   ========================================================= */

.panel {

    min-width: 0;

    padding: 20px;

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

    border-radius: var(--radius);

    background: #fff;

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


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

.table-wrap {

    width: 100%;

    overflow-x: auto;

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

    border-radius: 11px;

    background: #fff;

    -webkit-overflow-scrolling: touch;
}


table {

    width: 100%;

    border-collapse: collapse;

    min-width: 650px;
}


th {

    padding:
        11px 13px;

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

    background: #f8fafc;

    color: #7a8697;

    font-size: 10px;

    text-align: left;

    text-transform: uppercase;
}


td {

    padding:
        13px;

    border-bottom:
        1px solid
        #edf0f4;

    font-size: 12px;

    vertical-align: middle;
}


tr:last-child td {
    border-bottom: 0;
}


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

.badge {

    display: inline-flex;

    align-items: center;

    white-space: nowrap;

    padding:
        4px 8px;

    border-radius: 999px;

    font-size: 10px;

    font-weight: 800;
}


.badge-success {

    background: #e9f8f1;

    color: #11845a;
}


.badge-warning {

    background: #fff5df;

    color: #a76b00;
}


.badge-danger {

    background: #ffeded;

    color: #b63838;
}


.badge-info {

    background: #eaf2ff;

    color: #1c60c4;
}


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

.btn {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-height: 38px;

    padding:
        0 14px;

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

    border-radius: 8px;

    font-size: 12px;

    font-weight: 800;

    transition:
        background .15s ease,
        border-color .15s ease,
        transform .1s ease;
}


.btn:active {
    transform: translateY(1px);
}


.btn-primary {

    border-color: var(--blue);

    background: var(--blue);

    color: #fff;
}


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


.btn-secondary {

    background: #fff;

    color: #475569;
}


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

.empty-state {

    padding:
        55px 20px;

    color: #8792a3;

    text-align: center;
}


.empty-state h3 {

    margin:
        0 0 5px;

    color: #4b5563;

    font-size: 14px;
}


.empty-state p {

    margin: 0;

    font-size: 11px;
}


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

.login-page {

    min-height: 100vh;

    display: flex;

    align-items: center;

    justify-content: center;

    padding: 20px;

    background:
        radial-gradient(
            circle at top left,
            #eaf2ff 0,
            transparent 35%
        ),
        var(--bg);
}


.login-wrapper {

    width: 100%;

    max-width: 430px;
}


.login-card {

    padding: 32px;

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

    border-radius: 18px;

    background: #fff;

    box-shadow:
        0 20px 50px
        rgba(
            16,
            24,
            40,
            .10
        );
}


.login-brand {

    display: flex;

    align-items: center;

    gap: 11px;

    margin-bottom: 30px;
}


.login-brand-mark {

    width: 42px;
    height: 42px;

    display: grid;

    place-items: center;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #3d8bff,
            #1254b6
        );

    color: #fff;

    font-size: 19px;

    font-weight: 900;
}


.login-brand strong {

    display: block;

    font-size: 17px;
}


.login-brand span {

    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 10px;
}


.login-heading h1 {

    margin: 0;

    font-size: 25px;

    letter-spacing: -.03em;
}


.login-heading p {

    margin:
        7px 0 22px;

    color: var(--muted);

    font-size: 12px;
}


.login-error {

    padding:
        10px 12px;

    border:
        1px solid
        #f2cccc;

    border-radius: 8px;

    background: #fff2f2;

    color: #a53232;

    font-size: 11px;
}


.login-button {

    width: 100%;

    height: 42px;

    margin-top: 4px;

    border: 0;

    border-radius: 9px;

    background: var(--blue);

    color: #fff;

    font-size: 12px;

    font-weight: 800;
}


.login-button:hover {
    background: var(--blue-dark);
}


.login-footer {

    margin-top: 22px;

    color: #9aa4b3;

    font-size: 10px;

    text-align: center;
}


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

.user-management {

    width: 100%;

    min-width: 0;
}


.user-management-grid {

    display: grid;

    grid-template-columns:
        minmax(0, 2fr)
        minmax(300px, 1fr);

    gap: 18px;

    width: 100%;

    min-width: 0;

    margin-top: 18px;
}


.user-management-message {

    margin-bottom: 18px;

    padding:
        10px 12px;

    border-radius: 8px;

    font-size: 11px;
}


.user-management-message.success {

    border:
        1px solid
        #c8eedc;

    background: #eaf8f1;

    color: #11784f;
}


.user-management-message.error {

    border:
        1px solid
        #f2cccc;

    background: #fff2f2;

    color: #a53232;
}


/* =========================================================
   USER MANAGEMENT HEADER
   ========================================================= */

.user-panel-header {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 15px;

    margin-bottom: 16px;
}


.user-panel-header h2,
.add-user-header h2 {

    margin: 0;

    color: var(--text);

    font-size: 16px;
}


.user-panel-header p,
.add-user-header p {

    margin:
        5px 0 0;

    color: #8792a3;

    font-size: 11px;
}


/* =========================================================
   ADD USER HEADER
   ========================================================= */

.add-user-header {

    display: flex;

    align-items: center;

    gap: 11px;

    margin-bottom: 14px;
}


.add-user-icon {

    width: 38px;
    height: 38px;

    flex: 0 0 38px;

    display: grid;

    place-items: center;

    border-radius: 10px;

    background: var(--blue-soft);

    color: var(--blue);

    font-size: 21px;

    font-weight: 700;
}


.add-user-info {

    margin-bottom: 20px;

    padding:
        10px 11px;

    border:
        1px solid
        #e1eaf7;

    border-radius: 9px;

    background: #f7faff;

    color: #66758a;

    font-size: 10px;

    line-height: 1.6;
}


.add-user-button {
    width: 100%;
    margin-top: 6px;
}


.user-table-name {

    color: var(--text);

    font-size: 12px;

    font-weight: 800;
}


.user-table-meta {

    margin-top: 3px;

    color: #8a95a5;

    font-size: 10px;

    line-height: 1.5;
}


.text-muted {
    color: #a0a9b6;
}


.user-empty-cell {

    padding: 0 !important;

    text-align: center;
}


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

.site-footer {

    display: flex;

    justify-content: space-between;

    gap: 15px;

    padding:
        14px 30px;

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

    background: #fff;

    color: #8a95a5;

    font-size: 10px;
}


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

@media (max-width: 1050px) {

    .sidebar {
        width: 220px;
    }


    .main-shell {
        margin-left: 220px;
    }


    .stat-grid {

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


    .user-management-grid {

        grid-template-columns:
            minmax(0, 1fr)
            minmax(280px, 360px);
    }
}


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

@media (max-width: 760px) {

    .sidebar {

        width: 280px;

        max-width: 86vw;

        transform:
            translateX(-105%);

        transition:
            transform .25s ease;

        box-shadow:
            10px 0 35px
            rgba(
                0,
                0,
                0,
                .25
            );
    }


    .sidebar.open {

        transform:
            translateX(0);
    }


    .sidebar-close {

        position: absolute;

        top: 14px;
        right: 14px;

        width: 36px;
        height: 36px;

        display: flex;

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

        padding: 0;

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

        border-radius: 9px;

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

        color: #fff;

        font-size: 25px;

        z-index: 1100;
    }


    .sidebar-overlay {

        display: block;

        position: fixed;

        inset: 0;

        z-index: 950;

        background:
            rgba(
                15,
                23,
                42,
                .48
            );

        opacity: 0;

        visibility: hidden;

        pointer-events: none;

        transition:
            opacity .25s ease,
            visibility .25s ease;
    }


    .sidebar-overlay.show {

        opacity: 1;

        visibility: visible;

        pointer-events: auto;
    }


    .main-shell {

        width: 100%;

        margin-left: 0;
    }


    .topbar {

        height: 64px;

        padding:
            0 15px;

        gap: 10px;
    }


    .mobile-menu {

        display: flex;

        flex: 0 0 40px;
    }


    .global-search {

        min-width: 0;
    }


    .global-search kbd {
        display: none;
    }


    .user-info {
        display: none;
    }


    .logout-link {

        height: 34px;

        padding:
            0 10px;

        font-size: 10px;
    }


    .content {

        padding:
            22px 15px;
    }


    .page-header {

        align-items: flex-start;

        flex-direction: column;
    }


    .page-header h1 {
        font-size: 23px;
    }


    .stat-grid {

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


    /* USER MANAGEMENT */

    .user-management-grid {

        grid-template-columns: 1fr;

        gap: 15px;
    }


    .user-list-panel,
    .add-user-panel {

        width: 100%;

        min-width: 0;
    }


    .panel {

        width: 100%;

        padding: 17px;
    }


    .user-panel-header {

        align-items: flex-start;
    }


    .table-wrap {

        max-width: 100%;
    }


    .site-footer {

        flex-direction: column;

        align-items: flex-start;

        padding:
            13px 15px;
    }
}


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

@media (max-width: 480px) {

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


    .notification-button {
        display: none;
    }


    .logout-link {

        height: 32px;

        padding:
            0 9px;

        border-radius: 8px;

        font-size: 10px;
    }


    .content {

        padding:
            18px 12px;
    }


    .panel {

        padding: 15px;

        border-radius: 12px;
    }


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


    .form-group label {
        font-size: 10px;
    }


    .form-group input,
    .form-group select,
    .form-group textarea {

        height: 42px;

        font-size: 13px;
    }


    .login-card {

        padding:
            24px 20px;
    }


    .add-user-header {

        align-items: flex-start;
    }


    .add-user-info {

        font-size: 10px;
    }
}