:root {
    --sidebar-width: 260px;
    --sidebar-bg: #10243e;
    --sidebar-hover: #193654;
    --sidebar-text: #c9d5e3;
    --primary: #1769aa;
    --background: #f4f7fa;
    --border: #e4e9ef;
    --text: #243447;
    --muted: #718096;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

.tms-layout {
    min-height: 100vh;
}

.tms-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;

    width: var(--sidebar-width);

    background: var(--sidebar-bg);

    color: white;

    overflow-y: auto;

    z-index: 1030;

    transition: transform .25s ease;
}

.sidebar-brand {
    height: 82px;

    display: flex;
    align-items: center;

    gap: 13px;

    padding: 0 22px;

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

.brand-icon {
    width: 42px;
    height: 42px;

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

    border-radius: 10px;

    background: #fff;

    color: var(--sidebar-bg);

    font-size: 22px;
}

.brand-title {
    font-size: 20px;
    font-weight: 700;
}

.brand-subtitle {
    color: #9fb1c5;
    font-size: 12px;
}

.sidebar-nav {
    padding: 18px 12px;
}

.sidebar-label {
    padding: 22px 13px 8px;

    color: #718aa4;

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

    letter-spacing: 1.2px;
}

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

    gap: 13px;

    padding: 11px 13px;

    margin: 3px 0;

    border-radius: 8px;

    color: var(--sidebar-text);

    text-decoration: none;

    transition: all .15s ease;
}

.sidebar-link i {
    width: 20px;
    text-align: center;

    font-size: 18px;
}

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

.sidebar-link.active {
    background: #1e78bd;
    color: white;
}

.tms-main {
    min-height: 100vh;

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

.tms-topbar {
    height: 82px;

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

    padding: 0 28px;

    background: white;

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

    position: sticky;
    top: 0;

    z-index: 1020;
}

.topbar-title {
    font-size: 19px;
    font-weight: 700;
}

.topbar-subtitle {
    font-size: 12px;
    color: var(--muted);
}

.sidebar-toggle {
    display: none;

    font-size: 24px;
    padding: 0;
}

.user-button {
    display: flex;
    align-items: center;

    gap: 10px;

    border: 0;
    background: transparent;

    padding: 7px 9px;

    border-radius: 9px;
}

.user-button:hover {
    background: #f5f7fa;
}

.user-avatar {
    width: 38px;
    height: 38px;

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

    border-radius: 50%;

    background: #e6f0f8;
    color: var(--primary);

    font-weight: 700;
}

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

    text-align: left;

    font-size: 13px;
}

.user-info span {
    color: var(--muted);
    font-size: 11px;
}

.tms-content {
    padding: 28px;
}

.tms-card {
    background: white;

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

    border-radius: 12px;

    box-shadow: 0 2px 8px rgba(15, 35, 55, .04);
}

.stat-card {
    padding: 20px;

    height: 100%;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-icon {
    width: 44px;
    height: 44px;

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

    border-radius: 10px;

    background: #edf5fb;

    color: var(--primary);

    font-size: 21px;
}

.stat-value {
    margin-top: 15px;

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

.stat-label {
    color: var(--muted);
    font-size: 13px;
}

.action-card {
    display: flex;
    align-items: center;

    gap: 16px;

    padding: 20px;

    text-decoration: none;
    color: inherit;

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

.action-card:hover {
    transform: translateY(-2px);

    box-shadow:
        0 8px 20px rgba(15,35,55,.08);

    color: inherit;
}

.action-icon {
    width: 48px;
    height: 48px;

    flex-shrink: 0;

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

    border-radius: 11px;

    background: #edf5fb;

    color: var(--primary);

    font-size: 22px;
}

.section-title {
    font-size: 17px;
    font-weight: 700;

    margin-bottom: 16px;
}

@media (max-width: 991px) {

    .tms-sidebar {
        transform: translateX(-100%);
    }

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

    .tms-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .user-info {
        display: none;
    }

    .tms-content {
        padding: 18px;
    }

    .tms-topbar {
        padding: 0 18px;
    }
}


.customer-selector {
    display: flex;
    align-items: center;
    gap: 10px;

    min-width: 250px;

    padding: 8px 12px;

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

    background: #f8fafc;
}

.customer-selector > i {
    color: var(--primary);
    font-size: 20px;
}

.customer-selector-text {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

.customer-selector-text > span {
    color: var(--muted);

    font-size: 10px;
    font-weight: 600;

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

.customer-selector-text strong {
    max-width: 280px;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: 13px;
}

.customer-select {
    max-width: 300px;

    padding: 0;

    border: 0;
    outline: 0;

    background: transparent;

    color: var(--text);

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

    cursor: pointer;
}


.customer-logo {
    width: 38px;
    height: 38px;

    object-fit: contain;

    border-radius: 7px;

    background: white;
    padding: 3px;

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

    flex-shrink: 0;
}

.customer-logo-placeholder {
    width: 38px;
    height: 38px;

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

    border-radius: 7px;

    background: #eaf2f8;
    color: var(--primary);

    font-size: 19px;

    flex-shrink: 0;
}


@media (max-width: 767px) {

    .customer-selector {
        min-width: auto;
        max-width: 190px;
    }

    .customer-selector-text > span {
        display: none;
    }

    .customer-select {
        max-width: 145px;
    }

}



.municipality-autocomplete {
    position: relative;
}

.municipality-results {
    position: absolute;

    top: calc(100% + 5px);
    left: 0;
    right: 0;

    max-height: 320px;
    overflow-y: auto;

    background: #fff;

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

    box-shadow:
        0 12px 30px rgba(15, 35, 55, .14);

    z-index: 1100;
}

.municipality-result-item {
    display: block;

    width: 100%;

    padding: 11px 14px;

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

    background: #fff;

    text-align: left;

    cursor: pointer;
}

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

.municipality-result-item:hover {
    background: #f4f8fb;
}

.municipality-empty {
    padding: 16px;

    color: var(--muted);

    text-align: center;
}


/* =========================================================
   CAP MULTIPLI
   ========================================================= */

.postal-code-options {
    padding: 12px;

    background: #f8fafc;

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

.postal-code-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.postal-code-button {
    padding: 6px 11px;

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

    background: #fff;

    font-size: .875rem;
    font-weight: 600;

    cursor: pointer;

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

.postal-code-button:hover {
    background: #f1f5f9;
}

.postal-code-button.active {
    background: var(--bs-primary);
    border-color: var(--bs-primary);

    color: #fff;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, .12);
}



/* =========================================================
   SHIPMENT - ADDRESS BOOK
   ========================================================= */

.address-search-panel {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fafc;
}

.address-book-results {
    position: absolute;
    z-index: 1050;

    top: calc(100% + 6px);
    left: 0;
    right: 0;

    max-height: 360px;
    overflow-y: auto;

    background: #fff;

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

    box-shadow:
        0 12px 30px rgba(15, 23, 42, .12);
}

.address-result-item {
    display: block;
    width: 100%;

    padding: 14px 16px;

    text-align: left;

    background: #fff;
    border: 0;
    border-bottom: 1px solid #eef2f7;

    cursor: pointer;
}

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

.address-result-item:hover {
    background: #f8fafc;
}

.address-result-empty {
    padding: 18px;
    color: #64748b;
}

.selected-address-card {
    padding: 16px 18px;

    background: #fff;

    border: 1px solid #dbe5ef;
    border-radius: 12px;

    box-shadow:
        0 2px 8px rgba(15, 23, 42, .04);
}
