:root {
    --bg-color: #202c3b;
    --card-bg: linear-gradient(150deg, rgba(39, 52, 70, 0.96), rgba(50, 64, 84, 0.94));
    --header-bg: rgba(8, 14, 24, 0.96);
    --bg-gradient:
        radial-gradient(1200px 700px at -10% -10%, rgba(31, 169, 255, 0.1), transparent 58%),
        radial-gradient(1000px 650px at 110% 110%, rgba(120, 154, 196, 0.08), transparent 62%),
        linear-gradient(160deg, #202c3b 0%, #28364a 50%, #2d3c52 100%);
    --text-primary: #eef5ff;
    --text-secondary: #cad7e6;
    --accent: #22a9ff;
    --accent-glow: rgba(34, 169, 255, 0.3);
    --accent-hover: #0f97ec;
    --sidebar-active-bg: linear-gradient(140deg, rgba(23, 160, 241, 0.24), rgba(12, 118, 191, 0.2));
    --sidebar-active-border: rgba(52, 176, 251, 0.45);
    --sidebar-active-shadow: rgba(7, 95, 154, 0.25);
    --sidebar-scroll-thumb: linear-gradient(180deg, rgba(34, 169, 255, 0.78), rgba(12, 118, 191, 0.72));
    --sidebar-scroll-thumb-hover: linear-gradient(180deg, rgba(65, 188, 255, 0.92), rgba(22, 143, 224, 0.86));
    --border: rgba(135, 154, 181, 0.26);
    --success: #238636;
    --danger: #f85149;
    --warning: #d29922;
    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html[data-theme='light'],
body.light-mode {
    --bg-color: #e8edf4;
    --card-bg: linear-gradient(150deg, rgba(240, 244, 250, 0.98), rgba(230, 237, 246, 0.96));
    --header-bg: rgba(229, 236, 245, 0.96);
    --bg-gradient:
        radial-gradient(1100px 680px at -8% -10%, rgba(97, 162, 221, 0.14), transparent 62%),
        radial-gradient(920px 620px at 108% 108%, rgba(160, 184, 211, 0.16), transparent 65%),
        linear-gradient(160deg, #e8edf4 0%, #e1e8f1 48%, #dbe3ed 100%);
    --text-primary: #1d2733;
    --text-secondary: #334556;
    --accent: #0a84d6;
    --accent-glow: rgba(10, 132, 214, 0.25);
    --accent-hover: #086eaf;
    --sidebar-active-bg: linear-gradient(140deg, rgba(23, 160, 241, 0.24), rgba(12, 118, 191, 0.2));
    --sidebar-active-border: rgba(52, 176, 251, 0.45);
    --sidebar-active-shadow: rgba(7, 95, 154, 0.25);
    --sidebar-scroll-thumb: linear-gradient(180deg, rgba(34, 169, 255, 0.82), rgba(10, 132, 214, 0.76));
    --sidebar-scroll-thumb-hover: linear-gradient(180deg, rgba(65, 188, 255, 0.92), rgba(22, 143, 224, 0.86));
    --border: rgba(111, 132, 155, 0.35);
    --success: #1d8f3a;
    --danger: #c83d3d;
    --warning: #bf7a00;
}

html[data-theme='black'],
body.theme-black {
    --bg-color: #08090b;
    --card-bg: linear-gradient(150deg, rgba(18, 19, 22, 0.98), rgba(10, 11, 13, 0.97));
    --header-bg: rgba(5, 6, 8, 0.98);
    --bg-gradient:
        radial-gradient(900px 560px at 0% 0%, rgba(80, 88, 102, 0.12), transparent 62%),
        radial-gradient(900px 560px at 110% 100%, rgba(42, 48, 58, 0.16), transparent 66%),
        linear-gradient(160deg, #050607 0%, #090b0e 52%, #111318 100%);
    --text-primary: #f4f6f8;
    --text-secondary: #c7cbd1;
    --accent: #22a9ff;
    --accent-glow: rgba(34, 169, 255, 0.28);
    --accent-hover: #0f97ec;
    --sidebar-active-bg: linear-gradient(140deg, rgba(34, 169, 255, 0.2), rgba(105, 114, 130, 0.16));
    --sidebar-active-border: rgba(34, 169, 255, 0.42);
    --sidebar-active-shadow: rgba(0, 0, 0, 0.35);
    --sidebar-scroll-thumb: linear-gradient(180deg, rgba(34, 169, 255, 0.72), rgba(95, 105, 120, 0.72));
    --sidebar-scroll-thumb-hover: linear-gradient(180deg, rgba(65, 188, 255, 0.88), rgba(125, 135, 150, 0.82));
    --border: rgba(180, 187, 197, 0.18);
}

html[data-theme='purple'],
body.theme-purple {
    --bg-color: #21162d;
    --card-bg: linear-gradient(150deg, rgba(43, 30, 60, 0.97), rgba(64, 38, 86, 0.94));
    --header-bg: rgba(24, 13, 35, 0.96);
    --bg-gradient:
        radial-gradient(1050px 620px at -8% -8%, rgba(177, 98, 255, 0.18), transparent 62%),
        radial-gradient(920px 620px at 108% 108%, rgba(118, 70, 204, 0.22), transparent 66%),
        linear-gradient(160deg, #20142e 0%, #312046 52%, #44275d 100%);
    --text-primary: #fbf6ff;
    --text-secondary: #dfcdec;
    --accent: #b56cff;
    --accent-glow: rgba(181, 108, 255, 0.32);
    --accent-hover: #9f54ed;
    --sidebar-active-bg: linear-gradient(140deg, rgba(181, 108, 255, 0.26), rgba(111, 62, 171, 0.22));
    --sidebar-active-border: rgba(211, 167, 255, 0.45);
    --sidebar-active-shadow: rgba(65, 29, 105, 0.35);
    --sidebar-scroll-thumb: linear-gradient(180deg, rgba(181, 108, 255, 0.78), rgba(118, 70, 204, 0.72));
    --sidebar-scroll-thumb-hover: linear-gradient(180deg, rgba(204, 147, 255, 0.92), rgba(150, 92, 224, 0.86));
    --border: rgba(214, 178, 255, 0.24);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    margin: 0 !important;
    padding: 0 !important;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    background-image: var(--bg-gradient);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: block !important;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 2rem 2.4rem;
}

.container.login-container {
    max-width: none;
    margin: 0;
    padding: 0;
}

html:has(body.login-page),
body.login-page {
    background:
        radial-gradient(520px 240px at 50% 40%, rgba(57, 177, 255, 0.24), transparent 70%),
        radial-gradient(1300px 700px at 0% 0%, rgba(56, 112, 178, 0.25), transparent 68%),
        radial-gradient(1100px 680px at 100% 100%, rgba(44, 89, 148, 0.22), transparent 72%),
        linear-gradient(160deg, #122540 0%, #1d3557 52%, #203b5f 100%) !important;
    min-height: 100vh;
    overflow: hidden;
}

html:has(body.app-page),
body.app-page {
    background:
        radial-gradient(1200px 700px at -10% -10%, rgba(44, 173, 255, 0.14), transparent 60%),
        radial-gradient(1000px 650px at 110% 110%, rgba(154, 184, 216, 0.12), transparent 65%),
        linear-gradient(165deg, var(--page-bg) 0%, var(--page-bg-2) 100%) !important;
    min-height: 100vh;
    min-height: 100dvh;
}

.main-header {
    background: linear-gradient(180deg, rgba(8, 14, 24, 0.98), rgba(10, 18, 30, 0.97));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.34);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    height: 40px;
    transition: var(--transition);
}

.header-logo:hover {
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.nav-container {
    background: linear-gradient(180deg, rgba(11, 20, 33, 0.98), rgba(12, 22, 36, 0.96));
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06), 0 4px 16px rgba(0, 0, 0, 0.14);
    padding: 0.5rem 2rem;
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: #c2d0df;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: var(--transition);
}

.nav-link:hover,
.nav-link.active {
    color: #f6fbff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    border-bottom: 2px solid var(--accent);
    border-radius: 8px 8px 0 0;
}

.main-footer {
    width: 100%;
    padding: 28px 0 22px;
    text-align: center;
    background: #000;
    border-top: 1px solid color-mix(in srgb, var(--accent, #219de3) 55%, #000);
    box-shadow: none;
}

.main-footer p {
    margin: 0 0 6px;
    font-family: Arial, Helvetica, sans-serif;
    font-style: italic;
    font-size: 0.88rem;
    letter-spacing: 0.08em;
    color: #fff;
}

.active-users-indicator {
    margin-left: 0.45rem;
    color: #a0a0a0;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.not-found-page {
    min-height: calc(100vh - 250px);
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

.not-found-card {
    width: min(760px, 100%);
    text-align: center;
    display: grid;
    gap: 1.2rem;
    justify-items: center;
}

.not-found-gif {
    width: min(560px, 100%);
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(6, 12, 21, 0.78);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}

.not-found-copy {
    max-width: 620px;
}

.not-found-code {
    margin: 0 0 0.2rem;
    color: var(--accent);
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.18em;
}

.not-found-copy h2 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1.05;
}

.not-found-copy p:last-child {
    margin-top: 0.75rem;
    color: var(--text-secondary);
    font-size: 1.02rem;
}

.not-found-actions {
    display: flex;
    justify-content: center;
}

.top-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.top-actions .user-id {
    color: #e8eef4;
    font-weight: 500;
}

.user-settings-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


/* User Settings Dropdown */
.user-settings-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 2600;
}

.btn-icon {
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    color: #d2dbe6;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.icon-gear {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.5s ease;
}

.icon-bell {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.icon-theme {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.btn-icon:hover .settings-gear {
    transform: rotate(90deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 180px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 3200;
    display: none;
    padding: 0.5rem 0;
    animation: dropdownAppear 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-menu.show {
    display: block;
}

.theme-menu {
    min-width: 210px;
    padding: 0.45rem;
}

.theme-option {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.58rem 0.65rem;
    border-radius: 7px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 650;
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
}

.theme-option:hover,
.theme-option.active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.theme-option.active {
    box-shadow: inset 0 0 0 1px rgba(34, 169, 255, 0.38);
}

.theme-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.38);
    flex: 0 0 auto;
}

.theme-swatch-dark {
    background: linear-gradient(135deg, #1c2634 0 50%, #22a9ff 50% 100%);
}

.theme-swatch-light {
    background: linear-gradient(135deg, #edf4fb 0 50%, #0a84d6 50% 100%);
}

.theme-swatch-black {
    background: linear-gradient(135deg, #030405 0 50%, #22a9ff 50% 100%);
}

.theme-swatch-purple {
    background: linear-gradient(135deg, #26143a 0 50%, #b56cff 50% 100%);
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    padding: 0 5px;
    background: var(--danger);
    color: #fff;
    font-size: 0.68rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid var(--border);
}

.notif-head-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.btn-danger-soft {
    border-color: rgba(248, 81, 73, 0.35);
    color: #ffb4ae;
}

.notif-list {
    max-height: 320px;
    overflow-y: auto;
}

.notif-item {
    padding: 0.7rem 0.8rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: start;
}

.notif-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.notif-item.unread {
    border-left: 3px solid var(--accent);
}

.notif-item p {
    margin: 0;
    font-size: 0.86rem;
    color: var(--text-primary);
}

.notif-item small {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.notif-actions {
    display: flex;
    gap: 0.25rem;
}

.notif-action {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border-radius: 6px;
    min-width: 28px;
    padding: 0 0.45rem;
    height: 26px;
    cursor: pointer;
    line-height: 1;
}

.notif-action:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.notif-delete:hover {
    color: #ffb4ae;
    border-color: rgba(248, 81, 73, 0.45);
}

.notif-empty {
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 0.9rem;
}

@keyframes dropdownAppear {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

button.dropdown-item {
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.dropdown-divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 0.4rem 0;
}

.logout-item {
    color: var(--danger);
}

.logout-item:hover {
    background: rgba(248, 81, 73, 0.1);
    color: var(--danger);
}

h1,
h2,
h3 {
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

a {
    transition: var(--transition);
}

.hidden {
    display: none !important;
}

.form-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    margin-bottom: 2rem;
}

/* Corporate shell reusable across sections */
.corp-shell {
    background: linear-gradient(145deg, rgba(49, 60, 77, 0.96), rgba(65, 76, 94, 0.92));
    border: 1px solid rgba(117, 133, 156, 0.25);
    border-radius: 12px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.03);
    color: #eef5ff;
}

.corp-shell h2 {
    color: #f4f8ff;
    font-weight: 700;
}

.corp-header {
    border: none;
    background: transparent;
    margin-bottom: 2rem;
    padding: 0;
}

.corp-subtitle {
    margin-top: 0.35rem;
    color: #c5d4e6;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.corp-shell label {
    color: #dce8f7;
    font-weight: 700;
}

body.light-mode .corp-shell h2,
html[data-theme='light'] .corp-shell h2 {
    color: #ffffff;
}

body.light-mode .corp-subtitle,
html[data-theme='light'] .corp-subtitle {
    color: #d6e2f0;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.6rem;
    color: #d2deed;
    font-size: 0.92rem;
    font-weight: 600;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    width: 100%;
    padding: 0.75rem;
    background: #eceff3;
    border: 1px solid #d6dce4;
    border-radius: 8px;
    color: #1c2530;
    font-family: inherit;
    font-size: 0.98rem;
    transition: var(--transition);
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #8cb7da;
    box-shadow: 0 0 0 3px rgba(25, 167, 255, 0.18);
    background: #f4f7fb;
}

button,
.btn-primary,
.btn-secondary,
.btn-sm,
.btn-delete {
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    padding: 0.8rem 1.5rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 8px 18px var(--accent-glow);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 20px var(--accent-glow);
}

.btn-secondary {
    background: #eceff3;
    border: 1px solid rgba(180, 196, 214, 0.7);
    color: #111;
}

.btn-secondary:hover {
    background: #fff;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    background: #eceff3;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #111;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

body.light-mode label,
html[data-theme='light'] label {
    color: #3e5164;
}

body.light-mode .corp-shell label,
html[data-theme='light'] .corp-shell label {
    color: #e7f0fc;
    font-weight: 700;
}

.btn-delete {
    background: rgba(248, 81, 73, 0.1);
    color: var(--danger);
    border: 1px solid rgba(248, 81, 73, 0.3);
}

.btn-delete:hover {
    background: var(--danger);
    color: white;
}

.segmented-control {
    display: flex;
    background: rgba(17, 28, 44, 0.55);
    border: 1px solid rgba(140, 164, 192, 0.3);
    border-radius: 8px;
    padding: 2px;
}

.segmented-control input {
    display: none;
}

.segmented-control label {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    margin: 0;
    cursor: pointer;
    border-radius: 4px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.segmented-control input:checked+label {
    background: rgba(255, 255, 255, 0.14);
    color: #f7fbff;
}

.status-box,
.warning-box,
.info-box {
    --status-border: rgba(198, 155, 40, 0.88);
    --status-text: #f6d672;
    --status-bg: rgba(43, 37, 18, 0.88);
    background: linear-gradient(135deg, var(--status-bg), rgba(14, 20, 30, 0.94));
    color: var(--status-text);
    padding: 1.15rem 1.35rem;
    border-radius: 12px;
    border: 2px solid var(--status-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 14px 24px rgba(0, 0, 0, 0.2);
    font-weight: 600;
    letter-spacing: 0.01em;
    margin-bottom: 1.5rem;
}

.info-box {
    font-weight: 500;
}

.status-box.is-success {
    --status-border: rgba(35, 134, 54, 0.9);
    --status-text: #67d78a;
    --status-bg: rgba(26, 39, 28, 0.9);
}

.status-box.is-warning,
.warning-box {
    --status-border: rgba(198, 155, 40, 0.9);
    --status-text: #f6d672;
    --status-bg: rgba(43, 37, 18, 0.9);
}

.status-box.is-neutral {
    --status-border: rgba(108, 117, 125, 0.85);
    --status-text: #e6ebf2;
    --status-bg: rgba(43, 47, 54, 0.9);
}

.status-box a {
    color: inherit;
    text-decoration: underline;
    font-weight: 700;
}

.delete-adicional-panel {
    display: grid;
    gap: 1.2rem;
}

.delete-adicional-head h3 {
    margin: 0;
}

.delete-lookup-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
}

.delete-result-card {
    display: grid;
    gap: 0.85rem;
}

.delete-result-title {
    color: var(--text-primary);
    font-size: 1.02rem;
    font-weight: 700;
}

.delete-result-grid {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.45rem 1rem;
    align-items: baseline;
}

.delete-result-grid span {
    color: var(--text-secondary);
    font-weight: 600;
}

.delete-result-grid strong {
    color: var(--text-primary);
    overflow-wrap: anywhere;
}

.delete-adicional-actions {
    display: flex;
    justify-content: flex-end;
}

.btn-danger-action {
    background: linear-gradient(135deg, #d23b3b, var(--danger));
    box-shadow: 0 12px 24px rgba(248, 81, 73, 0.22);
}

.btn-danger-action:hover:not(:disabled) {
    background: linear-gradient(135deg, #bf3030, #e34a42);
}

.btn-danger-action:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
}

.extra-offer-list {
    margin-top: 0.85rem;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.extra-offer-list div {
    padding: 0.6rem 0.85rem;
    background: rgba(255, 255, 255, 0.07);
}

.extra-offer-list div + div {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.18);
}

.warning-box {
    border-radius: 12px;
}

@media (max-width: 640px) {
    .delete-lookup-row {
        grid-template-columns: 1fr;
    }

    .delete-adicional-actions {
        justify-content: stretch;
    }

    .delete-adicional-actions .btn-primary {
        width: 100%;
    }
}

.user-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
}

.user-table th {
    background: rgba(255, 255, 255, 0.04);
    padding: 1rem;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}

.user-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(150, 170, 194, 0.26);
    transition: var(--transition);
}

.user-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(35, 134, 54, 0.15);
    color: #3fb950;
    border: 1px solid rgba(35, 134, 54, 0.3);
}

.badge-secondary {
    background: rgba(110, 118, 129, 0.15);
    color: var(--text-secondary);
    border: 1px solid rgba(110, 118, 129, 0.3);
}

.status-pending {
    background: rgba(210, 153, 34, 0.15);
    color: #f2c15f;
    border: 1px solid rgba(210, 153, 34, 0.3);
}

.status-processing {
    background: rgba(34, 169, 255, 0.15);
    color: #79cfff;
    border: 1px solid rgba(34, 169, 255, 0.3);
}

.status-completed {
    background: rgba(35, 134, 54, 0.15);
    color: #3fb950;
    border: 1px solid rgba(35, 134, 54, 0.3);
}

.status-failed {
    background: rgba(248, 81, 73, 0.15);
    color: #ff9b95;
    border: 1px solid rgba(248, 81, 73, 0.3);
}

.compact-scheduled-content {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 1rem;
}

.compact-scheduled-content h3 {
    margin: 0 0 .75rem;
}

.compact-scheduled-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem .8rem;
}

.compact-scheduled-content .form-group {
    margin-bottom: .65rem;
}

.compact-scheduled-content label {
    margin-bottom: .25rem;
    font-size: .82rem;
}

.compact-scheduled-content input,
.compact-scheduled-content select,
.compact-scheduled-content textarea {
    min-height: 36px;
    padding: .45rem .65rem;
}

.compact-scheduled-content textarea {
    min-height: 76px;
}

.compact-scheduled-actions {
    position: sticky;
    bottom: -1rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding-top: .75rem;
    margin-top: .5rem;
}

.scheduled-user-filters {
    width: min(760px, 100%);
}

@media (max-width: 700px) {
    .compact-scheduled-grid {
        grid-template-columns: 1fr;
    }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 15, 25, 0.62);
    backdrop-filter: blur(2px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5000;
}

.modal-content {
    background: var(--panel-bg);
    color: var(--text-primary);
    padding: 1.5rem;
    box-sizing: border-box;
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    border-radius: 14px;
    width: 90%;
    max-width: 610px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    animation: modalAppear 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-message-modal {
    z-index: 7000;
}

.app-message-content {
    max-width: 480px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    border-top: 4px solid var(--accent);
}

.app-message-content.is-success {
    border-top-color: var(--success);
}

.app-message-content.is-error {
    border-top-color: var(--danger);
}

.app-message-content.is-warning,
.app-message-content.is-confirm {
    border-top-color: var(--warning);
}

.app-message-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 1.45rem;
    font-weight: 800;
    color: #f8fbff;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    box-shadow: 0 12px 24px rgba(34, 169, 255, 0.25);
}

.app-message-content.is-success .app-message-icon {
    background: linear-gradient(135deg, #31b85b, var(--success));
    box-shadow: 0 12px 24px rgba(35, 134, 54, 0.28);
}

.app-message-content.is-error .app-message-icon {
    background: linear-gradient(135deg, #ff6b64, var(--danger));
    box-shadow: 0 12px 24px rgba(248, 81, 73, 0.28);
}

.app-message-content.is-warning .app-message-icon,
.app-message-content.is-confirm .app-message-icon {
    background: linear-gradient(135deg, #f0b84a, var(--warning));
    box-shadow: 0 12px 24px rgba(210, 153, 34, 0.28);
}

.app-message-copy h3 {
    margin: 0 0 0.45rem;
    font-size: 1.35rem;
}

.app-message-copy p {
    margin: 0;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

.app-message-actions {
    margin-top: 0.6rem;
    justify-content: center;
    width: 100%;
}

.confirm-delay {
    width: 100%;
    height: 8px;
    margin: 1rem 0 0.15rem;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.confirm-delay-bar {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--warning), var(--accent));
    transform-origin: left center;
}

.confirm-delay.is-running .confirm-delay-bar {
    animation-name: confirmDelayDrain;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

@keyframes confirmDelayDrain {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (max-width: 560px) {
    .app-message-content {
        padding: 1.6rem;
    }

    .app-message-actions {
        width: 100%;
    }
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 2rem;
    position: relative;
}

.modern-login {
    width: 100vw;
    margin-left: 0;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    gap: 1.35rem;
    background: transparent;
}

.modern-login::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.3;
    background-image:
        linear-gradient(120deg, transparent 32%, rgba(141, 205, 255, 0.12) 50%, transparent 66%),
        radial-gradient(circle at 22% 36%, rgba(139, 202, 255, 0.46) 2px, transparent 4px),
        radial-gradient(circle at 74% 52%, rgba(119, 191, 255, 0.42) 2px, transparent 5px),
        radial-gradient(circle at 61% 23%, rgba(152, 212, 255, 0.34) 2px, transparent 4px);
}

.login-hero-logo {
    position: relative;
    z-index: 1;
}

.login-logo {
    width: 100%;
    max-width: 340px;
    display: block;
    margin: 0 auto;
}

.login-glass {
    position: relative;
    z-index: 1;
    width: min(94vw, 560px);
    padding: 2.2rem;
    border-radius: 14px;
    border: 1px solid rgba(157, 205, 248, 0.34);
    background: linear-gradient(170deg, rgba(46, 86, 132, 0.24), rgba(24, 51, 82, 0.34));
    backdrop-filter: blur(8px);
    box-shadow: 0 0 0 1px rgba(165, 211, 250, 0.12) inset, 0 18px 40px rgba(5, 20, 41, 0.42);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-field {
    position: relative;
}

.login-field .field-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    opacity: 0.85;
}

.login-field .field-icon svg {
    width: 100%;
    height: 100%;
    fill: #d6e7f9;
}

.login-field input {
    width: 100%;
    height: 58px;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(167, 205, 239, 0.46) !important;
    color: #eff7ff !important;
    font-size: 1.12rem !important;
    padding-left: 3.1rem !important;
}

.login-field input::placeholder {
    color: #d9eaff !important;
    opacity: 0.92;
}

.login-field input:focus {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(120, 198, 255, 0.82) !important;
    box-shadow: 0 0 0 3px rgba(58, 169, 255, 0.28) !important;
}

.login-submit {
    height: 60px;
    width: 100%;
    margin-top: 0.2rem;
    border-radius: 11px !important;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
    background: linear-gradient(180deg, #347dff, #1d5ac8) !important;
    box-shadow: 0 12px 24px rgba(28, 96, 210, 0.32), 0 0 18px rgba(53, 136, 255, 0.25) inset !important;
}

.flash-messages {
    position: fixed;
    top: 5.8rem;
    right: 1.5rem;
    z-index: 6500;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
    width: min(400px, calc(100vw - 2rem));
    pointer-events: none;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
    border: 1px solid transparent;
    animation: slideIn 0.3s ease-out;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    pointer-events: auto;
}

.close-alert {
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: bold;
    opacity: 0.7;
    transition: var(--transition);
}

.close-alert:hover {
    opacity: 1;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.alert-success {
    background: #1a271c;
    color: #3fb950;
    border-color: #238636;
}

.alert-danger {
    background: #271a1a;
    color: #f85149;
    border-color: #f85149;
}

.alert-info {
    background: #1a2227;
    color: #58a6ff;
    border-color: #388bfd;
}

@media (max-width: 768px) {
    .flash-messages {
        top: 4.8rem;
        right: 1rem;
        left: 1rem;
        width: auto;
        max-width: none;
    }

    .container {
        padding: 1rem;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .main-header {
        padding: 1rem;
    }

    .top-actions {
        font-size: 0.8rem;
    }

    .login-card {
        padding: 2rem;
    }
}

.collapsible-header {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    user-select: none;
}

.collapsible-header h3 {
    margin: 0;
}

.toggle-icon {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-secondary);
    border-bottom: 2px solid var(--text-secondary);
    transform: rotate(45deg);
    transition: var(--transition);
    margin-left: 0.5rem;
}

.form-card.collapsed .toggle-icon {
    transform: rotate(-45deg);
}

.collapsible-content {
    max-height: 2000px;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0, 1, 0, 1);
}

.form-card.collapsed .collapsible-content {
    max-height: 0;
    transition: max-height 0.4s cubic-bezier(1, 0, 1, 0);
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* FreshChat Visual Template */
.chat-window {
    width: 100%;
    height: 600px;
    background: linear-gradient(155deg, #091321, #0b1727);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.28), 0 12px 26px rgba(0, 0, 0, 0.2);
}

.chat-window::-webkit-scrollbar {
    width: 6px;
}

.chat-window::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 3px;
}

.message-wrapper {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.message-wrapper.cliente {
    align-self: flex-start;
}

.message-wrapper.agente,
.message-wrapper.bot {
    align-self: flex-end;
}

.message-bubble {
    padding: 0.8rem 1.2rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
    white-space: pre-wrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-wrapper.cliente .message-bubble {
    background: #0088cc;
    /* Celeste/Azul Fresh */
    color: #ffffff;
    border-bottom-left-radius: 4px;
}

.message-wrapper.agente .message-bubble,
.message-wrapper.bot .message-bubble {
    background: #238636;
    /* Verde Fresh */
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.message-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    padding: 0 4px;
}

.message-wrapper.agente .message-meta,
.message-wrapper.bot .message-meta {
    text-align: right;
}

.message-event {
    align-self: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    max-width: 90%;
    margin: 0.5rem 0;
    font-style: italic;
}

.message-event strong {
    color: var(--text-primary);
}

body.light-mode .chat-window .message-meta,
html[data-theme='light'] .chat-window .message-meta {
    color: #8ea4bc;
}

body.light-mode .chat-window .message-event,
html[data-theme='light'] .chat-window .message-event {
    color: #b5c7db;
    border-color: rgba(126, 150, 177, 0.45);
    background: rgba(95, 118, 143, 0.18);
}

body.light-mode .chat-window .message-event strong,
html[data-theme='light'] .chat-window .message-event strong {
    color: #d5e3f2;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    transition: width 0.4s ease;
    border-radius: 4px;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 0.5rem;
}

/* Image Previews */
.preview-img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 0.5rem;
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

.preview-img:hover {
    transform: scale(1.01);
}

.preview-img-sm {
    max-width: 200px;
    max-height: 150px;
    border-radius: 4px;
    border: 1px solid #eee;
    cursor: zoom-in;
}

/* ===== Global Corporate Redesign (v2) ===== */
html[data-theme='dark'],
body:not(.light-mode) {
    --page-bg: #1c2634;
    --page-bg-2: #233249;
    --panel-bg: linear-gradient(145deg, rgba(36, 49, 68, 0.96), rgba(48, 63, 84, 0.94));
    --panel-border: rgba(148, 171, 202, 0.24);
    --muted-label: #d5e4f4;
    --field-bg: #f2f5fa;
    --field-text: #1f2b3a;
}

html[data-theme='light'],
body.light-mode {
    --page-bg: #e6edf5;
    --page-bg-2: #d8e2ee;
    --panel-bg: linear-gradient(145deg, rgba(237, 243, 250, 0.97), rgba(225, 234, 245, 0.96));
    --panel-border: rgba(131, 154, 183, 0.35);
    --muted-label: #2f4359;
    --field-bg: #ffffff;
    --field-text: #1f2b3a;
}

html[data-theme='black'],
body.theme-black {
    --page-bg: #050607;
    --page-bg-2: #101216;
    --panel-bg: linear-gradient(145deg, rgba(18, 19, 22, 0.97), rgba(9, 10, 12, 0.96));
    --panel-border: rgba(180, 187, 197, 0.16);
    --muted-label: #d7dce3;
    --field-bg: #f2f5fa;
    --field-text: #1f2b3a;
}

html[data-theme='purple'],
body.theme-purple {
    --page-bg: #21162d;
    --page-bg-2: #3a2453;
    --panel-bg: linear-gradient(145deg, rgba(43, 30, 60, 0.97), rgba(64, 38, 86, 0.94));
    --panel-border: rgba(214, 178, 255, 0.24);
    --muted-label: #f0defb;
    --field-bg: #fbf8ff;
    --field-text: #251a31;
}

body {
    background-image:
        radial-gradient(1200px 700px at -10% -10%, rgba(44, 173, 255, 0.14), transparent 60%),
        radial-gradient(1000px 650px at 110% 110%, rgba(154, 184, 216, 0.12), transparent 65%),
        linear-gradient(165deg, var(--page-bg) 0%, var(--page-bg-2) 100%);
}

html[data-theme='black'] body,
body.theme-black {
    background-image:
        radial-gradient(1000px 620px at -10% -10%, rgba(92, 101, 116, 0.12), transparent 60%),
        radial-gradient(900px 580px at 110% 110%, rgba(36, 42, 52, 0.18), transparent 65%),
        linear-gradient(165deg, var(--page-bg) 0%, var(--page-bg-2) 100%);
}

html[data-theme='purple'] body,
body.theme-purple {
    background-image:
        radial-gradient(1120px 680px at -10% -10%, rgba(181, 108, 255, 0.2), transparent 60%),
        radial-gradient(920px 600px at 110% 110%, rgba(95, 55, 160, 0.24), transparent 65%),
        linear-gradient(165deg, var(--page-bg) 0%, var(--page-bg-2) 100%);
}

.main-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 12px 30px rgba(2, 9, 20, 0.38);
}

.nav-container {
    gap: 0.9rem;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
}

.nav-link {
    border: 1px solid transparent;
    letter-spacing: 0.02em;
}

.nav-link:hover,
.nav-link.active {
    border-color: rgba(255, 255, 255, 0.18);
}

.form-card,
.corp-shell,
.ret-shell {
    background: var(--panel-bg) !important;
    border: 1px solid var(--panel-border) !important;
    border-radius: 14px !important;
    box-shadow: 0 24px 40px rgba(4, 12, 24, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

h2 {
    font-weight: 700;
}

label,
.ret-shell label,
.corp-shell label {
    color: var(--muted-label) !important;
    font-size: 0.93rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    background: var(--field-bg) !important;
    color: var(--field-text) !important;
    border: 1px solid rgba(176, 194, 214, 0.75) !important;
    border-radius: 10px !important;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #63b6f1 !important;
    box-shadow: 0 0 0 3px rgba(52, 169, 245, 0.22) !important;
    background: #ffffff !important;
}

.btn-primary {
    border-radius: 11px !important;
    background: linear-gradient(135deg, #17a1f4, #0d86db) !important;
    box-shadow: 0 10px 22px rgba(13, 134, 219, 0.35) !important;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #22adff, #1091ea) !important;
}

.btn-secondary,
.btn-sm {
    border-radius: 10px !important;
    background: linear-gradient(180deg, #f8fbff, #e8eef5) !important;
    color: #1e2a39 !important;
    border: 1px solid rgba(182, 198, 216, 0.85) !important;
}

.info-box {
    border-radius: 12px !important;
}

.warning-box {
    border-radius: 12px !important;
}

.user-table {
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    overflow: hidden;
}

.user-table th {
    background: rgba(255, 255, 255, 0.08) !important;
    font-weight: 700;
}

body.light-mode .user-table,
html[data-theme='light'] .user-table {
    background: #f7fbff;
    border-color: rgba(129, 153, 179, 0.45);
}

body.light-mode .user-table th,
html[data-theme='light'] .user-table th {
    background: #e4edf7 !important;
    color: #24364a !important;
    border-bottom-color: rgba(129, 153, 179, 0.45);
}

body.light-mode .user-table td,
html[data-theme='light'] .user-table td {
    background: #edf4fb;
    color: #26384c !important;
    border-bottom-color: rgba(167, 186, 207, 0.62);
}

body.light-mode .user-table tr:nth-child(even) td,
html[data-theme='light'] .user-table tr:nth-child(even) td {
    background: #e6eef8;
}

body.light-mode .user-table tr:hover td,
html[data-theme='light'] .user-table tr:hover td {
    background: #dce9f6;
}

body.light-mode .segmented-control,
html[data-theme='light'] .segmented-control {
    background: #d4dee9;
    border-color: rgba(110, 132, 156, 0.55);
}

body.light-mode .segmented-control label,
html[data-theme='light'] .segmented-control label {
    color: #26384c !important;
}

body.light-mode .segmented-control input:checked + label,
html[data-theme='light'] .segmented-control input:checked + label {
    background: #f6fbff;
    color: #132236 !important;
    box-shadow: 0 1px 8px rgba(77, 101, 128, 0.22);
}

body.light-mode .badge,
html[data-theme='light'] .badge {
    color: #24364a;
}

body.light-mode .status-completed,
html[data-theme='light'] .status-completed {
    background: #d8f3df;
    color: #177232 !important;
    border-color: #7ccf91;
}

.modal-content {
    border-radius: 10px !important;
    border: 1px solid var(--panel-border) !important;
    background: var(--panel-bg) !important;
    color: var(--text-primary) !important;
}

.chat-window {
    border-radius: 16px !important;
}

/* ===== New App Layout ===== */
.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    position: relative;
    top: 0;
}
.app-shell.sidebar-collapsed { grid-template-columns:0 minmax(0, 1fr); }

body.app-page .app-shell {
    margin-top: 0 !important;
}

body>.app-shell {
    margin-top: 0 !important;
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 1.4rem 1rem;
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(180deg, rgba(7, 12, 22, 0.98), rgba(10, 17, 29, 0.96));
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 20;
}
.app-shell.sidebar-collapsed .app-sidebar { width:0; min-width:0; padding-left:0; padding-right:0; border-right:0; overflow:hidden; }
.sidebar-collapse-toggle { position:fixed; z-index:30; top:50%; left:268px; width:26px; height:52px; padding:0; transform:translateY(-50%); border:1px solid rgba(255,255,255,.2); border-radius:0 8px 8px 0; color:#eaf1fb; background:rgba(21, 27, 41, .94); cursor:pointer; font-size:1.55rem; line-height:1; transition:left .2s ease, background .2s ease; }
.sidebar-collapse-toggle:hover { background:rgba(95, 69, 135, .95); }
.app-shell.sidebar-collapsed .sidebar-collapse-toggle { left:0; }

.sidebar-brand {
    display: block;
    padding: 0.25rem 0.4rem 0.55rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-brand .header-logo {
    height: 42px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.72rem;
    overflow-y: auto;
    padding-right: 0.35rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) rgba(255, 255, 255, 0.06);
}

.sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--sidebar-scroll-thumb);
    border: 2px solid rgba(7, 12, 22, 0.98);
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--sidebar-scroll-thumb-hover);
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
}

.sidebar-section-title {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.78rem 0.05rem;
    border: 0;
    background: transparent;
    color: rgba(202, 215, 230, 0.72);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: left;
}

.sidebar-section-title::after {
    content: "+";
    color: var(--accent);
    font-size: 0.9rem;
    line-height: 1;
}

.sidebar-section.is-open .sidebar-section-title::after {
    content: "-";
}

.sidebar-section:not(.is-open) .side-link {
    display: none;
}

.side-link {
    display: block;
    padding: 0.56rem 0.78rem;
    border-radius: 9px;
    color: #c8d7e9;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid transparent;
    transition: var(--transition);
}

.side-link:hover {
    color: #f4f9ff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

.side-link.active {
    color: #ffffff;
    background: var(--sidebar-active-bg);
    border-color: var(--sidebar-active-border);
    box-shadow: 0 10px 20px var(--sidebar-active-shadow);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.sidebar-keep-visible {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
    color: rgba(202, 215, 230, 0.84);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

.sidebar-keep-visible input {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    flex: 0 0 auto;
}

.sidebar-logout {
    display: inline-flex;
    padding: 0.55rem 0.8rem;
    border-radius: 9px;
    text-decoration: none;
    color: #f7b4b4;
    background: rgba(248, 81, 73, 0.12);
    border: 1px solid rgba(248, 81, 73, 0.28);
}

.app-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(9, 16, 27, 0.9), rgba(12, 21, 34, 0.78));
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 2500;
    overflow: visible;
}

body.light-mode .modal-content label,
html[data-theme='light'] .modal-content label {
    color: var(--muted-label) !important;
    font-weight: 700 !important;
}

.modal-content .form-group>label {
    color: var(--muted-label) !important;
    font-weight: 700 !important;
}

.modal-content h1,
.modal-content h2,
.modal-content h3 {
    color: var(--text-primary);
}

.app-topbar-title h1 {
    margin: 0;
    font-size: 1.12rem;
    color: #f0f7ff;
}

.app-topbar-title p {
    margin: 0.08rem 0 0;
    color: #a9bfd8;
    font-size: 0.82rem;
}

.app-content.container {
    max-width: 100%;
    padding: 1.4rem 1.6rem 2rem;
}

.app-footer.main-footer {
    margin-top: auto;
}

.app-shell .top-actions .user-id {
    font-weight: 600;
    color: #dbe7f4;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    padding: 0.34rem 0.65rem;
}

body.light-mode .app-sidebar,
html[data-theme='light'] .app-sidebar {
    background: linear-gradient(180deg, rgba(27, 39, 55, 0.98), rgba(34, 48, 66, 0.96));
}

body.theme-black .app-sidebar,
html[data-theme='black'] .app-sidebar {
    background: linear-gradient(180deg, rgba(3, 4, 5, 0.99), rgba(11, 12, 15, 0.98));
}

body.theme-purple .app-sidebar,
html[data-theme='purple'] .app-sidebar {
    background: linear-gradient(180deg, rgba(28, 15, 42, 0.98), rgba(43, 24, 63, 0.96));
}

body.theme-black .app-topbar,
html[data-theme='black'] .app-topbar {
    background: linear-gradient(180deg, rgba(5, 6, 8, 0.92), rgba(11, 12, 15, 0.82));
}

body.theme-purple .app-topbar,
html[data-theme='purple'] .app-topbar {
    background: linear-gradient(180deg, rgba(31, 17, 46, 0.92), rgba(48, 28, 69, 0.82));
}

body.light-mode .sidebar-nav,
html[data-theme='light'] .sidebar-nav {
    scrollbar-color: rgba(34, 169, 255, 0.62) rgba(255, 255, 255, 0.08);
}

body.light-mode .sidebar-nav::-webkit-scrollbar-track,
html[data-theme='light'] .sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
}

body.light-mode .sidebar-nav::-webkit-scrollbar-thumb,
html[data-theme='light'] .sidebar-nav::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(34, 169, 255, 0.82), rgba(10, 132, 214, 0.76));
    border-color: rgba(27, 39, 55, 0.98);
}

body.light-mode .form-card h1,
body.light-mode .form-card h2,
body.light-mode .form-card h3,
html[data-theme='light'] .form-card h1,
html[data-theme='light'] .form-card h2,
html[data-theme='light'] .form-card h3 {
    color: #1f3044 !important;
}

body.light-mode .corp-subtitle,
body.light-mode .ret-subtitle,
html[data-theme='light'] .corp-subtitle,
html[data-theme='light'] .ret-subtitle {
    color: #455d77 !important;
    font-weight: 600;
}

body.light-mode .app-topbar-title h1,
html[data-theme='light'] .app-topbar-title h1 {
    color: #f4f8ff;
}

body.light-mode .app-topbar-title p,
html[data-theme='light'] .app-topbar-title p {
    color: #d2e0ef;
}

@media (max-width: 1080px) {
    .app-shell {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .sidebar-brand .header-logo {
        height: 30px;
    }

    .side-link {
        font-size: 0.78rem;
        padding: 0.48rem 0.38rem;
        text-align: center;
    }

    .sidebar-section-title {
        padding: 0 0.2rem;
        font-size: 0.56rem;
        letter-spacing: 0.04em;
        text-align: center;
    }

    .sidebar-section-title::after {
        font-size: 0.72rem;
    }

    .sidebar-keep-visible {
        align-items: flex-start;
        font-size: 0.68rem;
        gap: 0.3rem;
    }

    .sidebar-logout {
        font-size: 0.75rem;
        padding: 0.5rem 0.55rem;
    }

    .app-topbar-title p {
        display: none;
    }
}

@media (max-width: 768px) {
    .app-shell,
    .app-shell.sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .app-main { min-height:100dvh; }
    .app-content.container { flex:1 0 auto; }
    .app-footer.main-footer { flex:0 0 auto; margin-top:0; }

    .app-sidebar,
    .app-shell.sidebar-collapsed .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(280px, 82vw);
        min-width: 0;
        height: 100dvh;
        padding: 1.1rem .9rem;
        border-right: 1px solid rgba(255, 255, 255, 0.14);
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform .22s ease;
        z-index: 3000;
    }

    .app-shell:not(.sidebar-collapsed) .app-sidebar { transform: translateX(0); }

    .sidebar-collapse-toggle,
    .app-shell.sidebar-collapsed .sidebar-collapse-toggle {
        top: auto;
        bottom: 1rem;
        left: .55rem;
        transform: none;
        border-radius: 8px;
        z-index: 3001;
    }

    .app-shell:not(.sidebar-collapsed) .sidebar-collapse-toggle {
        left: calc(min(280px, 82vw) - 13px);
        border-radius: 8px;
    }

    .app-topbar {
        padding: 0.9rem 1rem;
    }

    .app-content.container {
        padding: 1rem;
    }
}

/* ===== Feedback Widget ===== */
.feedback-widget {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 3500;
}

.feedback-fab {
    position: relative;
    width: 56px;
    min-width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(129, 229, 255, 0.4);
    background: linear-gradient(135deg, #00a9e0 0%, #2f7bff 56%, #3d6fff 100%);
    color: #ffffff;
    font-weight: 800;
    letter-spacing: 0.01em;
    box-shadow: 0 14px 30px rgba(14, 56, 120, 0.42);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.feedback-fab:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
    box-shadow: 0 18px 34px rgba(14, 56, 120, 0.52);
}

.feedback-fab:active {
    transform: translateY(0);
}

.feedback-fab-icon {
    font-size: 1.45rem;
    line-height: 1;
}

.feedback-fab-badge {
    position: absolute;
    top: -7px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ff6262, #ea3f4f);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0 5px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    box-shadow: 0 8px 16px rgba(230, 66, 79, 0.35);
}

.feedback-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(380px, calc(100vw - 28px));
    height: min(530px, calc(100vh - 110px));
    border: 1px solid rgba(132, 196, 239, 0.25);
    border-radius: 18px;
    background: radial-gradient(120% 110% at 0% 0%, rgba(20, 101, 182, 0.28), rgba(12, 22, 36, 0) 45%),
                linear-gradient(160deg, rgba(20, 32, 48, 0.98), rgba(10, 22, 39, 0.98));
    box-shadow: 0 28px 48px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
    backdrop-filter: blur(3px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.feedback-widget.open .feedback-fab {
    opacity: 0;
    pointer-events: none;
    transform: translateY(8px) scale(0.86);
}

.feedback-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 15px;
    border-bottom: 1px solid rgba(164, 190, 218, 0.17);
    color: #edf5ff;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
}

.feedback-close {
    border: 0;
    background: transparent;
    color: #d4e7f7;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    transition: background-color .16s ease, color .16s ease;
}

.feedback-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.feedback-messages {
    flex: 1;
    overflow: auto;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0));
}

.feedback-msg {
    border: 1px solid rgba(158, 188, 220, 0.2);
    border-radius: 12px;
    padding: 9px 11px;
    max-width: 90%;
    line-height: 1.35;
    color: #eaf4ff;
}

.feedback-msg.mine {
    align-self: flex-end;
    background: linear-gradient(145deg, rgba(57, 167, 255, 0.34), rgba(34, 134, 225, 0.18));
    border-color: rgba(106, 196, 255, 0.55);
    box-shadow: 0 8px 14px rgba(8, 89, 165, 0.2);
}

.feedback-msg.other {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(168, 195, 224, 0.22);
}

.feedback-msg small {
    display: block;
    margin-top: 5px;
    color: #bed2e6;
    font-size: 0.7rem;
}

.feedback-compose {
    border-top: 1px solid rgba(164, 190, 218, 0.16);
    padding: 10px 11px 11px;
    display: grid;
    gap: 8px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0));
}

.feedback-compose textarea {
    min-height: 78px;
    border-radius: 12px;
    border: 1px solid rgba(176, 200, 225, 0.32);
    background: rgba(16, 29, 44, 0.92);
    color: #e8f2fb;
    padding: .72rem .8rem;
    resize: vertical;
}

.feedback-compose textarea::placeholder {
    color: rgba(188, 209, 232, 0.72);
}

.feedback-compose textarea:focus {
    outline: none;
    border-color: rgba(101, 191, 255, 0.9);
    box-shadow: 0 0 0 3px rgba(65, 172, 248, 0.2);
}

.feedback-compose .btn-primary {
    border-radius: 12px;
    min-height: 42px;
    font-weight: 700;
}

body.light-mode .feedback-panel,
html[data-theme='light'] .feedback-panel {
    border-color: rgba(43, 102, 163, 0.24);
    background: radial-gradient(120% 110% at 0% 0%, rgba(80, 163, 234, 0.2), rgba(255, 255, 255, 0) 42%),
                linear-gradient(170deg, rgba(248, 252, 255, 0.99), rgba(233, 243, 252, 0.99));
    box-shadow: 0 24px 42px rgba(24, 65, 112, 0.2);
}

body.light-mode .feedback-panel-head,
html[data-theme='light'] .feedback-panel-head {
    color: #123152;
    border-bottom-color: rgba(46, 111, 177, 0.2);
}

body.light-mode .feedback-close,
html[data-theme='light'] .feedback-close {
    color: #1c446d;
}

body.light-mode .feedback-close:hover,
html[data-theme='light'] .feedback-close:hover {
    background: rgba(40, 105, 171, 0.1);
}

body.light-mode .feedback-messages,
html[data-theme='light'] .feedback-messages {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(238, 247, 255, 0.4));
}

body.light-mode .feedback-msg,
html[data-theme='light'] .feedback-msg {
    color: #122a44;
}

body.light-mode .feedback-msg.mine,
html[data-theme='light'] .feedback-msg.mine {
    background: linear-gradient(145deg, rgba(100, 189, 255, 0.32), rgba(76, 142, 224, 0.2));
    border-color: rgba(63, 143, 216, 0.56);
}

body.light-mode .feedback-msg.other,
html[data-theme='light'] .feedback-msg.other {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(65, 123, 183, 0.25);
}

body.light-mode .feedback-msg small,
html[data-theme='light'] .feedback-msg small {
    color: #2e5277;
}

body.light-mode .feedback-compose,
html[data-theme='light'] .feedback-compose {
    border-top-color: rgba(46, 111, 177, 0.2);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.74), rgba(244, 249, 255, 0.94));
}

body.light-mode .feedback-compose textarea,
html[data-theme='light'] .feedback-compose textarea {
    border-color: rgba(66, 130, 194, 0.36);
    background: #ffffff;
    color: #10273f;
}

body.light-mode .feedback-compose textarea::placeholder,
html[data-theme='light'] .feedback-compose textarea::placeholder {
    color: rgba(39, 79, 120, 0.52);
}

body.light-mode .feedback-compose textarea:focus,
html[data-theme='light'] .feedback-compose textarea:focus {
    border-color: rgba(36, 128, 212, 0.78);
    box-shadow: 0 0 0 3px rgba(37, 127, 205, 0.16);
}

/* ===== Feedback Admin ===== */
.feedback-admin-grid {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 14px;
}

.feedback-admin-list,
.feedback-admin-thread {
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: rgba(12, 24, 39, 0.45);
    padding: 10px;
}

.feedback-admin-list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.feedback-admin-conversations {
    display: grid;
    gap: 8px;
    max-height: 520px;
    overflow: auto;
}

.feedback-admin-item {
    border: 1px solid rgba(152, 178, 206, 0.3);
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
}

.feedback-admin-item.active {
    border-color: rgba(67, 191, 255, 0.7);
    box-shadow: 0 0 0 2px rgba(36, 167, 244, 0.25) inset;
}

.feedback-admin-item-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.feedback-admin-unread {
    background: #ef4444;
    color: #fff;
    border-radius: 999px;
    min-width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0 6px;
}

.feedback-admin-thread-header {
    border-bottom: 1px solid rgba(152, 178, 206, 0.25);
    padding: 6px 2px 10px;
    margin-bottom: 10px;
    color: #edf6ff;
    font-weight: 700;
}

.feedback-admin-messages {
    min-height: 380px;
    max-height: 520px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 2px;
}

.feedback-admin-compose {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

@media (max-width: 980px) {
    .feedback-admin-grid {
        grid-template-columns: 1fr;
    }

    .feedback-widget {
        right: 12px;
        bottom: 12px;
    }

    .feedback-panel {
        width: min(370px, calc(100vw - 18px));
        height: min(520px, calc(100vh - 92px));
    }

    .feedback-fab {
        width: 54px;
        min-width: 54px;
        height: 54px;
    }
}

/* Portal de clientes */
.client-portal { max-width:calc(100% - 430px); margin:0 auto 0 0; overflow-x:hidden; }
.client-portal.client-portal--without-chat { max-width:1180px; margin-left:auto; margin-right:auto; }
.client-portal.client-portal--empty { width:min(520px, 100%); max-width:520px; min-height:calc(100dvh - 210px); margin:0 auto; display:flex; flex-direction:column; justify-content:center; }
.client-portal--empty .client-portal-head { width:100%; }

/* SSSMovil eSim */
.esim-request-page { display:grid; gap:1rem; max-width:1120px; margin:0 auto; }
.esim-request-head { display:flex; align-items:end; justify-content:space-between; gap:1.5rem; padding:1.15rem 1.35rem; border:1px solid var(--border-color); border-radius:14px; background:rgb(0 0 0 / 42%); }
.esim-request-head h2 { margin:.2rem 0 .35rem; }
.esim-request-head p { margin:0; color:var(--text-secondary); }
.esim-request-search { width:min(360px, 100%); }
.esim-request-search label, .esim-request-panel > label { display:block; margin-bottom:.35rem; color:var(--text-secondary); font-size:.82rem; font-weight:700; }
.esim-request-search > div { display:flex; gap:.55rem; }
.esim-request-search input { width:100%; min-width:0; }
.esim-request-workspace { display:grid; gap:1rem; }
.esim-request-fulfillment { display:grid; grid-template-columns:minmax(320px, .65fr) minmax(0, 1.35fr); gap:1rem; align-items:stretch; }
.esim-request-overview, .esim-request-panel, .esim-request-result, .esim-request-reservation { border:1px solid var(--border-color); border-radius:14px; background:rgb(0 0 0 / 32%); }
.esim-request-overview { display:grid; grid-template-columns:minmax(0, 1fr) minmax(310px, .65fr); gap:1rem; align-items:center; padding:.85rem 1rem; border-top:3px solid var(--accent); }
.esim-request-client-card { min-width:0; }
.esim-request-client-card h3 { margin:.25rem 0 .4rem; }
.esim-request-client-card p { margin:0; color:var(--text-secondary); font-size:.88rem; }
.esim-request-email-inline { display:block; margin-top:.45rem; color:var(--text-secondary); font-size:.8rem; overflow-wrap:anywhere; }
.esim-request-email-inline strong { color:var(--text-primary); }
.esim-request-phone-select { display:grid; gap:.35rem; padding:.7rem .8rem; border:1px solid rgba(207, 215, 229, .18); border-radius:10px; background:rgb(0 0 0 / 22%); }
.esim-request-phone-select label { color:var(--text-secondary); font-size:.78rem; font-weight:700; }
.esim-request-phone-select select { width:100%; min-width:0; }
.esim-request-reservation { display:flex; flex-direction:column; align-items:flex-start; gap:1.2rem; padding:.8rem 1rem; border-color:color-mix(in srgb, var(--accent) 60%, transparent); background:color-mix(in srgb, var(--accent) 10%, transparent); }
.esim-request-reservation-main { display:grid; gap:.35rem; min-width:0; }
.esim-request-reservation small { color:var(--text-secondary); font-size:.76rem; font-weight:700; }
.esim-request-reservation-main > .eyebrow { font-size:.68rem; }
.esim-request-reservation-main > strong { color:var(--accent); overflow-wrap:anywhere; }
.esim-request-reservation b { color:var(--text-primary); font-variant-numeric:tabular-nums; }
.esim-request-copy-row { display:flex; align-items:center; flex-wrap:wrap; gap:.55rem; }
.esim-request-copy-row strong { color:var(--accent); font-size:1rem; }
.esim-request-copy-value { padding:.3rem .5rem; border:1px solid rgba(207, 215, 229, .35); border-radius:7px; color:var(--text-primary); background:rgb(0 0 0 / 22%); cursor:pointer; font:inherit; font-size:.72rem; font-weight:700; }
.esim-request-copy-value:hover { border-color:var(--accent); background:color-mix(in srgb, var(--accent) 16%, transparent); }
.esim-request-reservation-qr-wrap { display:grid; gap:.3rem; justify-items:start; }
.esim-request-reservation-qr-wrap > span { color:var(--text-secondary); font-size:.72rem; font-weight:700; }
.esim-request-reservation-qr { display:block; width:max-content; padding:.2rem; border:1px solid rgba(207, 215, 229, .3); border-radius:6px; background:#fff; }
.esim-request-reservation-qr img { display:block; width:250px; height:250px; object-fit:contain; }
.esim-request-reservation-qr em { display:none; color:var(--text-primary); font-size:.76rem; font-style:normal; font-weight:700; }
.esim-request-reservation-qr.is-link-only { padding:.45rem .6rem; background:rgb(0 0 0 / 22%); }
.esim-request-reservation-qr.is-link-only em { display:block; }
.esim-request-reservation-qr.is-link-only img { display:none; }
.esim-request-reservation-qr-wrap code { max-width:200px; overflow-wrap:anywhere; color:var(--text-primary); font-size:.72rem; }
.esim-request-copy-qr { width:max-content; padding:.35rem .55rem; border:1px solid rgba(207, 215, 229, .35); border-radius:7px; color:var(--text-primary); background:rgb(0 0 0 / 22%); cursor:pointer; font:inherit; font-size:.74rem; font-weight:700; }
.esim-request-copy-qr:hover { border-color:var(--accent); background:color-mix(in srgb, var(--accent) 16%, transparent); }
.esim-request-panel { padding:1.15rem 1.3rem; }
.esim-request-ticket-panel { display:flex; flex-direction:column; }
.esim-request-ticket-panel textarea { flex:1; min-height:98px; }
.esim-request-panel h3 { margin:0; }
.esim-request-note { margin:.35rem 0 1rem; }
.esim-request-panel textarea { width:100%; resize:vertical; color:var(--text-primary); background:rgb(0 0 0 / 22%); }
.esim-request-actions { display:flex; justify-content:flex-end; margin-top:.8rem; }
.esim-request-result { display:flex; align-items:center; justify-content:space-between; gap:1.5rem; padding:1.1rem 1.3rem; border-color:rgba(57, 199, 152, .55); }
.esim-request-result h3 { margin:.3rem 0; color:#54dfad; }
.esim-request-result p { margin:0; color:var(--text-secondary); }
.esim-request-result pre { margin:.8rem 0 0; color:var(--text-primary); font:inherit; font-size:.83rem; white-space:pre-wrap; }
.esim-request-qr a { display:block; padding:.35rem; border:1px solid rgba(207, 215, 229, .3); border-radius:9px; background:#fff; }
.esim-request-qr img { display:block; width:112px; height:112px; object-fit:contain; }
.esim-request-qr code { display:block; max-width:300px; overflow-wrap:anywhere; color:var(--text-secondary); }
.esim-page { display:grid; gap:1.1rem; max-width:1400px; margin:0 auto; }
.esim-availability-banner { display:flex; align-items:center; justify-content:space-between; gap:1rem; min-height:104px; padding:1.2rem 1.5rem; border:1px solid rgba(207, 215, 229, .28); border-radius:14px; background:rgb(0 0 0 / 42%); }
.esim-counters { display:flex; align-items:center; gap:2.4rem; }
.esim-counters > div { display:grid; gap:.35rem; }
.esim-availability-banner span { color:#c7d4e5; font-size:1rem; font-weight:700; }
.esim-availability-banner strong { color:var(--accent); font-size:2.5rem; line-height:1; }
.esim-banner-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.65rem; }
.esim-action { min-height:38px; padding:.45rem .85rem; border:1px solid rgba(207, 215, 229, .45); border-radius:9px; color:var(--text-primary); background:rgb(0 0 0 / 24%); cursor:pointer; font:inherit; font-size:.82rem; font-weight:700; }
.esim-action:hover { border-color:var(--accent); background:color-mix(in srgb, var(--accent) 20%, transparent); }
.esim-action-upload { border-color:color-mix(in srgb, var(--accent) 68%, transparent); }
.esim-action-delete, .esim-delete-confirm { border:1px solid rgba(255, 119, 119, .56); border-radius:9px; color:#ffd2d2; background:rgba(214, 61, 61, .14); cursor:pointer; font:inherit; font-size:.82rem; font-weight:700; }
.esim-action-delete { min-height:38px; padding:.45rem .85rem; }
.esim-delete-confirm { padding:.65rem .9rem; }
.esim-action-delete:hover, .esim-delete-confirm:hover { background:rgba(214, 61, 61, .25); border-color:#ff8e8e; }
.esim-list-switch { display:flex; align-items:center; gap:.35rem; width:max-content; max-width:100%; padding:.3rem; border:1px solid rgba(207, 215, 229, .25); border-radius:10px; background:rgb(0 0 0 / 22%); }
.esim-list-switch a { display:flex; align-items:center; justify-content:center; gap:.45rem; min-height:34px; padding:.35rem .8rem; border:1px solid transparent; border-radius:7px; color:var(--text-secondary); font-size:.82rem; font-weight:700; text-decoration:none; transition:background .16s ease, border-color .16s ease, color .16s ease; }
.esim-list-switch a:hover { color:var(--text-primary); border-color:rgba(207, 215, 229, .3); background:rgb(255 255 255 / 6%); }
.esim-list-switch a.is-active { color:var(--text-primary); border-color:color-mix(in srgb, var(--accent) 65%, transparent); background:color-mix(in srgb, var(--accent) 18%, transparent); }
.esim-list-switch span { display:inline-grid; min-width:1.35rem; place-items:center; padding:.05rem .25rem; border-radius:999px; color:var(--text-primary); background:rgb(0 0 0 / 24%); font-size:.72rem; }
.esim-list-search { display:grid; gap:.35rem; width:min(620px, 100%); }
.esim-list-search label { color:var(--text-secondary); font-size:.8rem; font-weight:700; }
.esim-list-search > div { display:flex; flex-wrap:wrap; gap:.55rem; }
.esim-list-search input { flex:1 1 280px; min-width:0; }
.esim-list-search .btn-secondary, .esim-list-search .btn-primary { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
.esim-pagination { display:flex; align-items:center; justify-content:center; gap:1rem; flex-wrap:wrap; padding:.85rem 1rem; color:var(--text-secondary); font-size:.82rem; }
.esim-pagination a { padding:.35rem .6rem; border:1px solid rgba(207, 215, 229, .35); border-radius:7px; color:var(--text-primary); text-decoration:none; }
.esim-pagination a:hover { border-color:var(--accent); background:color-mix(in srgb, var(--accent) 16%, transparent); }
.esim-page-summary { margin:.8rem 1rem; color:var(--text-secondary); font-size:.82rem; text-align:center; }
.esim-copy-qr, .esim-download-qr { display:block; width:max-content; min-height:0; margin-top:.35rem; padding:.22rem .42rem; border:1px solid rgba(207, 215, 229, .35); border-radius:6px; color:var(--text-primary); background:rgb(0 0 0 / 22%); cursor:pointer; font:inherit; font-size:.68rem; font-weight:700; line-height:1.1; white-space:nowrap; }
.esim-copy-qr:hover, .esim-download-qr:hover { border-color:var(--accent); background:color-mix(in srgb, var(--accent) 16%, transparent); }
.esim-occupied-list { display:grid; gap:1rem; padding:1.15rem; border:1px solid var(--border-color); border-radius:14px; background:rgb(0 0 0 / 32%); }
.esim-occupied-list > header { display:flex; align-items:end; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.esim-occupied-list h3 { margin:.25rem 0; }
.esim-occupied-list p { margin:0; color:var(--text-secondary); font-size:.86rem; }
.esim-occupied-table { min-width:940px; }
.esim-table-panel { border:1px solid var(--border-color); border-radius:14px; overflow:hidden; background:var(--card-bg, rgba(19, 30, 48, .74)); }
.esim-bulk-toolbar { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.65rem .9rem; border-bottom:1px solid rgba(207, 215, 229, .14); background:rgb(0 0 0 / 16%); color:var(--text-secondary); font-size:.8rem; font-weight:700; }
.esim-select-column { width:42px; padding-right:.3rem !important; text-align:center !important; }
.esim-select-column input { width:15px; height:15px; accent-color:var(--accent); cursor:pointer; }
.esim-export-button { display:inline-flex; align-items:center; justify-content:center; min-height:38px; padding:.38rem .65rem; border:1px solid rgba(207, 215, 229, .42); border-radius:7px; color:var(--text-primary); background:rgb(0 0 0 / 22%); font-size:.76rem; font-weight:700; line-height:1; text-decoration:none; }
.esim-export-button:hover { border-color:var(--accent); background:color-mix(in srgb, var(--accent) 18%, transparent); }
.esim-help-button { display:grid; width:38px; min-height:38px; place-items:center; border:1px solid rgba(207, 215, 229, .45); border-radius:50%; color:var(--text-primary); background:rgb(0 0 0 / 24%); cursor:pointer; }
.esim-help-button svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-linecap:round; stroke-linejoin:round; stroke-width:1.9; }
.esim-help-button:hover { border-color:var(--accent); color:var(--accent); background:color-mix(in srgb, var(--accent) 16%, transparent); }
.esim-table-wrap { overflow:auto; }
.esim-table { width:100%; min-width:980px; border-collapse:collapse; font-size:.84rem; }
.esim-table th { padding:.8rem 1rem; color:var(--text-secondary); background:rgb(0 0 0 / 18%); font-size:.72rem; letter-spacing:.04em; text-align:left; text-transform:uppercase; white-space:nowrap; }
.esim-table td { max-width:260px; padding:.78rem 1rem; border-top:1px solid rgba(207, 215, 229, .1); color:var(--text-primary); vertical-align:middle; }
.esim-table tbody tr:hover { background:color-mix(in srgb, var(--accent) 9%, transparent); }
.esim-table .esim-qr { max-width:250px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.esim-qr a { display:inline-flex; padding:.2rem; border:1px solid rgba(207, 215, 229, .25); border-radius:6px; background:rgb(0 0 0 / 18%); }
.esim-qr a:hover { border-color:var(--accent); }
.esim-qr img { display:block; width:42px; height:42px; border-radius:3px; object-fit:contain; background:#fff; }
.esim-empty { padding:2.2rem !important; color:var(--text-secondary) !important; text-align:center; }
.esim-upload-content, .esim-release-content { width:min(620px, 94vw); }
.esim-upload-content > p, .esim-release-content > p { margin:.45rem 0 1rem; color:var(--text-secondary); line-height:1.45; }
.esim-upload-content input[type="file"] { width:100%; padding:.55rem; border:1px dashed rgba(207, 215, 229, .42); border-radius:8px; color:var(--text-secondary); background:rgb(0 0 0 / 18%); }
.esim-release-content input[type="search"] { width:100%; margin-bottom:.7rem; }
.esim-search-combobox { position:relative; margin-bottom:.7rem; }
.esim-search-combobox .esim-search-select { margin:0; }
.esim-search-options { position:absolute; z-index:20; top:calc(100% + .35rem); right:0; left:0; display:grid; max-height:230px; overflow-y:auto; border:1px solid rgba(207, 215, 229, .28); border-radius:9px; background:var(--card-bg, #1c2838); box-shadow:0 12px 28px rgba(0, 0, 0, .35); }
.esim-search-options button { display:flex !important; flex-direction:column; align-items:flex-start !important; justify-content:flex-start !important; gap:.18rem; width:100%; padding:.65rem .75rem; border:0; border-bottom:1px solid rgba(207, 215, 229, .1); color:var(--text-primary); background:transparent; cursor:pointer; text-align:left !important; }
.esim-search-options button strong, .esim-search-options button span { width:100%; text-align:left !important; }
.esim-search-options button[hidden], .esim-search-options .esim-search-empty.hidden { display:none !important; }
.esim-search-options button:last-child { border-bottom:0; }
.esim-search-options button:hover { background:color-mix(in srgb, var(--accent) 15%, transparent); }
.esim-search-options button strong { font-size:.84rem; }
.esim-search-options button span { color:var(--text-secondary); font-size:.75rem; }
.esim-search-empty { margin:0; padding:.8rem; color:var(--text-secondary); font-size:.82rem; text-align:center; }
.esim-upload-content .status-box { margin:1rem 0 0; }
.esim-upload-content .modal-actions { margin-top:1rem; }
.esim-release-content .modal-actions { display:flex; gap:.75rem; margin-top:1rem; }
.esim-conflict-choice { display:grid; gap:.55rem; margin-top:1rem; padding:.85rem; border:1px solid rgba(255, 190, 95, .4); border-radius:9px; background:rgba(210, 157, 39, .1); }
.esim-conflict-choice p { color:#ffe0a3; font-weight:600; }
.esim-conflict-choice label { color:var(--text-primary); font-size:.88rem; }
.esim-format-content { width:min(1040px, calc(100vw - 3rem)); max-width:none; }
.esim-format-heading { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.esim-format-heading h3 { margin:0; }
.esim-format-close { box-sizing:border-box; flex:0 0 32px; width:32px; height:32px; padding:0; border:1px solid rgba(207, 215, 229, .34); border-radius:50%; color:var(--text-primary); background:rgb(0 0 0 / 20%); cursor:pointer; font-size:1.35rem; line-height:1; }
.esim-format-close:hover { border-color:var(--accent); color:var(--accent); }
.esim-format-content > p { margin:.75rem 0; color:var(--text-secondary); }
.esim-format-table-wrap { overflow-x:auto; border:1px solid rgba(207, 215, 229, .2); border-radius:9px; }
.esim-format-table { width:100%; min-width:0; border-collapse:collapse; table-layout:fixed; font-size:.8rem; }
.esim-format-table th, .esim-format-table td { padding:.7rem .55rem; border-bottom:1px solid rgba(207, 215, 229, .12); overflow-wrap:anywhere; text-align:left; }
.esim-format-table th { color:var(--text-secondary); background:rgb(0 0 0 / 20%); font-size:.7rem; letter-spacing:.04em; text-transform:uppercase; }
.esim-format-table tbody tr { background:color-mix(in srgb, var(--accent) 8%, transparent); }
.esim-format-rules { display:grid; gap:.4rem; margin:1rem 0 0; padding-left:1.2rem; color:var(--text-secondary); font-size:.88rem; line-height:1.4; }
.esim-format-content .modal-actions { justify-content:flex-end; margin-top:1.1rem; }
.client-portal-head { display:flex; align-items:center; justify-content:flex-start; padding:.7rem 1.1rem; border:1px solid var(--panel-border, var(--border-color)); border-radius:12px; background:var(--panel-bg, rgba(31, 21, 53, .78)); }
.client-portal-head h2 { margin:.2rem 0; font-size:1.55rem; }
.client-portal-head p { margin:.35rem 0 0; color:var(--text-secondary); }
.eyebrow { color:var(--accent-color, #43bfff); font-size:.76rem; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.client-search { width:288px; }
.client-search label { display:block; margin-bottom:.3rem; color:var(--text-secondary); font-size:.76rem; font-weight:700; }
.client-search > div { display:flex; gap:.6rem; }
.client-search input { min-width:0; height:40px; flex:1; padding:.45rem .7rem; color:var(--text-primary); background:rgba(10, 7, 20, .24); border:1px solid rgba(177, 150, 218, .3); }
.client-search .btn-primary { min-height:40px; padding:.45rem .9rem; background:rgba(136, 92, 190, .9); border-color:rgba(181, 143, 232, .5); box-shadow:none; }
.client-search .btn-primary:disabled { opacity:.78; cursor:wait; }
.client-search-spinner { display:inline-block; width:13px; height:13px; margin-left:.38rem; border:2px solid rgba(255,255,255,.35); border-top-color:#fff; border-radius:50%; vertical-align:-2px; animation:client-search-spin .7s linear infinite; }
@keyframes client-search-spin { to { transform:rotate(360deg); } }
.client-portal > .status-box { margin-top:1rem; }
.client-profile { margin-top:1.2rem; display:grid; gap:1.1rem; }
.client-identity-card, .client-panel, .client-actions-panel { border:1px solid var(--border-color); border-radius:14px; background:var(--card-bg, rgba(19, 30, 48, .74)); padding:1.3rem; }
.client-identity-card { display:grid; grid-template-columns:minmax(260px, 1.4fr) minmax(190px, .8fr) minmax(230px, 1fr); gap:1.25rem; align-items:start; padding:1rem 1.15rem; border-top:3px solid rgba(170, 181, 198, .55); background:rgb(0 0 0 / 42%); }
.client-identity-card.is-active { border-top-color:#39c798; }
.client-identity-card.is-cut { border-top-color:#ef5362; }
.client-summary-title { margin-bottom:.7rem; padding:.2rem 0 .58rem; color:#fff; border-bottom:1px solid rgba(207, 215, 229, .2); font-size:1.05rem; font-weight:700; }
.client-summary-details, .client-summary-contact { display:grid; gap:.3rem; color:#edf1f7; font-size:.84rem; }
.client-summary-details strong, .client-summary-contact .summary-label { color:#aebbd0; font-weight:600; }
.client-summary-contact { align-content:center; overflow-wrap:anywhere; }
.client-summary-account { display:grid; justify-items:end; gap:.65rem; padding-top:.2rem; text-align:right; }
.client-summary-account > strong { color:#d7dce6; font-size:2rem; line-height:1; letter-spacing:.01em; }
.client-summary-account > strong.client-balance--debt { color:#ff4c61; }
.client-summary-account > strong.client-balance--good { color:#54dfad; }
.client-payment-badge { border:1px solid rgba(207, 215, 229, .32); border-radius:999px; padding:.28rem .55rem; color:#dfe6f2; background:transparent; font-size:.73rem; font-weight:700; }
.client-late-months { color:#c7d0dd; font-size:.8rem; font-weight:600; }
.client-late-months strong { margin-left:.3rem; color:#fff; font-size:1rem; }
.client-category { color:var(--text-secondary); }
.client-statuses { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.45rem; }
.client-status { font-size:.9rem; font-weight:700; border:1px solid var(--border-color); border-radius:8px; padding:.55rem .8rem; color:var(--text-secondary); }
.client-status.is-ok { color:#54dfad; border-color:rgba(57,199,152,.5); background:rgba(39, 174, 116, .12); }
.client-status.is-alert { color:#ff9898; border-color:rgba(255,119,119,.75); background:rgba(214, 61, 61, .17); box-shadow:0 0 0 1px rgba(255,119,119,.12) inset; }
.client-summary-actions { grid-column:1 / -1; display:flex; justify-content:center; margin-top:.15rem; padding-top:.15rem; }
.client-summary-actions .client-actions { justify-content:center; }
.client-summary-actions .client-action { color:#edf4ff !important; border-color:rgba(207, 215, 229, .48) !important; background:rgb(0 0 0 / 28%) !important; box-shadow:inset 0 1px 0 rgba(255, 255, 255, .08); backdrop-filter:blur(6px); }
.client-summary-actions .client-action:hover { border-color:var(--accent) !important; background:color-mix(in srgb, var(--accent) 22%, transparent) !important; box-shadow:0 0 14px color-mix(in srgb, var(--accent) 28%, transparent), inset 0 1px 0 rgba(255, 255, 255, .12); }
.client-profile-grid { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:1.1rem; }
.client-panel h3, .client-actions-panel h3 { margin:0 0 1rem; }
.client-panel#technical-panel, .client-panel#phone-panel, .client-panel#tv-panel, .client-panel#additions-panel, .client-panel#ticket-reasons-panel, .client-panel#commitments-panel, .client-panel#billing-history-panel { grid-column:1 / -1; }
.client-panel-toggle { width:100%; display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:0; border:0; background:transparent; color:var(--text-primary); font:inherit; font-size:1.05rem; font-weight:600; text-align:left; cursor:pointer; }
.client-panel-toggle span:last-child { color:var(--accent-color, #43bfff); font-size:.86rem; font-weight:600; }
.client-panel dl { margin:0; display:grid; gap:.85rem; }
.client-panel dl div { display:grid; grid-template-columns:140px minmax(0, 1fr); gap:1rem; }
.client-panel dt { color:var(--text-secondary); }
.client-panel dd { margin:0; overflow-wrap:anywhere; }
.client-services { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); grid-auto-rows:108px; gap:.65rem; max-height:calc(216px + .65rem); margin-top:1rem; overflow-y:auto; padding-right:.35rem; }
.client-services article { display:grid; align-content:start; gap:.2rem; min-width:0; padding:.75rem; border-radius:9px; background:rgba(111, 135, 168, .12); }
.client-services article.client-addition-card { cursor:pointer; border:1px solid transparent; }
.client-services article.client-addition-card:hover { border-color:rgba(181, 150, 218, .6); background:rgba(150, 104, 211, .16); }
.addition-edit-content { width:min(540px, 92vw); }
.client-chat-panel { position:fixed; z-index:10; top:calc(var(--topbar-height, 62px) + 1rem); right:1.25rem; bottom:calc(80px + 1.25rem); width:390px; max-width:calc(100vw - 2.5rem); display:flex; flex-direction:column; min-height:0; overflow:hidden; padding:1rem; border:1px solid var(--border-color); border-radius:14px; background:var(--card-bg, rgba(19, 30, 48, .94)); box-shadow:0 14px 35px rgba(0, 0, 0, .25); }
.client-chat-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.client-chat-head h3 { margin:.12rem 0 0; font-size:1.08rem; }
.client-chat-id { flex:0 0 auto; color:var(--text-secondary); font-size:.74rem; font-weight:700; }
.client-chat-body { display:flex; flex:1; min-width:0; min-height:0; margin-top:.8rem; overflow:hidden; }
.client-chat-loading { display:flex; justify-content:center; align-items:center; gap:.5rem; min-height:160px; color:var(--text-secondary); }
.client-chat-body > .client-chat-loading:not(.hidden) { flex:1; }
.client-chat-messages { flex:1; min-width:0; min-height:0; height:auto; padding:1rem; overflow-x:hidden; overflow-y:auto; }
.client-chat-messages .message-wrapper, .client-chat-messages .message-bubble, .client-chat-messages .message-event { min-width:0; max-width:100%; overflow-wrap:anywhere; word-break:break-word; }
.client-services article strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.client-services article span, .client-services article small { color:var(--text-secondary); }
.client-services article small { overflow:hidden; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.client-panel#technical-panel.is-collapsed .client-services, .client-panel#phone-panel.is-collapsed .client-services, .client-panel#tv-panel.is-collapsed .client-services, .client-panel#additions-panel.is-collapsed .client-services, .client-panel#ticket-reasons-panel.is-collapsed .ticket-reasons, .client-panel#commitments-panel.is-collapsed .ticket-reasons, .client-panel#billing-history-panel.is-collapsed .ticket-reasons { display:none; }
.ticket-reasons { display:grid; gap:.35rem; margin-top:1rem; }
.ticket-list-head, .ticket-list-row { display:grid; grid-template-columns:100px minmax(180px, 1fr) 110px; gap:1rem; align-items:center; padding:.62rem .75rem; border-radius:7px; font-size:.86rem; }
.ticket-list-head { color:var(--text-secondary); font-size:.74rem; font-weight:700; text-transform:uppercase; }
.ticket-list-row { background:rgba(111, 135, 168, .12); }
.ticket-list-row strong { color:var(--accent-color, #43bfff); }
.ticket-list-row time { color:var(--text-secondary); text-align:right; }
.tickets-grid { grid-template-columns:110px minmax(180px, 1fr) 120px 110px; }
.ticket-status { display:inline-flex; justify-content:center; width:max-content; min-width:76px; padding:.2rem .45rem; border-radius:999px; font-size:.75rem; font-weight:700; }
.ticket-status.is-complete { color:#54dfad; background:rgba(39, 174, 116, .12); }
.ticket-status.is-open { color:#ffd278; background:rgba(210, 157, 39, .13); }
.ticket-pager { display:flex; align-items:center; justify-content:center; gap:.7rem; margin-top:.55rem; color:var(--text-secondary); font-size:.8rem; }
.ticket-pager button { padding:.3rem .6rem; border:1px solid rgba(181,150,218,.35); border-radius:6px; color:var(--text-primary); background:rgba(255,255,255,.04); cursor:pointer; }
.ticket-pager button:disabled { opacity:.4; cursor:default; }
.commitments-grid { grid-template-columns:100px minmax(130px, 1fr) 100px minmax(130px, 1fr) 120px; }
.commitments-grid > * { text-align:center !important; }
.billing-history-grid { grid-template-columns:110px 105px minmax(150px, 1fr) minmax(180px, 1.4fr) 130px; }
.billing-history-grid > * { min-width:0; }
.billing-id { display:inline-flex; align-items:center; flex-wrap:wrap; gap:.4rem; }
.invoice-download { padding:.22rem .45rem; border:1px solid rgba(207, 215, 229, .4); border-radius:6px; color:var(--text-primary); background:rgb(0 0 0 / 22%); cursor:pointer; font:inherit; font-size:.7rem; font-weight:700; }
.invoice-download:hover:not(:disabled) { border-color:var(--accent); background:color-mix(in srgb, var(--accent) 18%, transparent); }
.invoice-download:disabled { opacity:.65; cursor:wait; }
.billing-type { display:inline-flex; justify-content:center; width:max-content; min-width:76px; padding:.2rem .45rem; border-radius:999px; font-size:.75rem; font-weight:700; }
.billing-type.is-invoice { color:#ffd278; background:rgba(210, 157, 39, .13); }
.billing-type.is-payment { color:#54dfad; background:rgba(39, 174, 116, .12); }
.ticket-limit-note { margin-top:.35rem; padding:.55rem; border-radius:7px; color:var(--text-secondary); background:rgba(255,255,255,.04); text-align:center; font-size:.78rem; font-weight:600; }
.client-actions-panel p { color:var(--text-secondary); margin-top:-.55rem; }
.client-actions { display:flex; gap:.65rem; flex-wrap:wrap; }
.client-quick-actions { display:grid; grid-template-columns:minmax(230px, .9fr) minmax(0, 2fr); gap:1.25rem; align-items:center; padding:1rem 1.2rem; }
.client-actions-heading h3 { margin:.18rem 0 0; font-size:1rem; }
.client-actions-heading p { margin:.35rem 0 0; font-size:.82rem; }
.client-quick-actions .client-actions { justify-content:flex-end; }
.client-action { min-height:34px; padding:.4rem .7rem; text-decoration:none; color:var(--text-primary); background:rgba(255, 255, 255, .04); border-color:rgba(181, 150, 218, .35); font-size:.8rem; }
.client-action:hover { background:rgba(150, 104, 211, .22); border-color:rgba(194, 157, 241, .65); }
.client-action-modal-content { position:relative; width:min(1180px, 96vw); height:min(860px, 92vh); max-width:none; padding:0; overflow:hidden; }
.client-action-modal iframe { display:block; width:100%; height:100%; border:0; background:var(--bg-color, #101826); }
.client-action-close { position:absolute; z-index:2; right:12px; top:10px; cursor:pointer; color:var(--text-primary); background:var(--panel-bg); border:1px solid var(--panel-border); font-size:1.5rem; }

/* Keep close controls independent of the padding and minimum sizes of form buttons. */
button.client-action-close,
button.feedback-close,
button.esim-format-close {
    box-sizing:border-box;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    flex:0 0 36px;
    width:36px;
    min-width:36px;
    max-width:36px;
    height:36px;
    min-height:36px;
    max-height:36px;
    padding:0;
    margin:0;
    border-radius:8px;
    line-height:1;
}
button.client-action-close:hover { color:var(--accent); border-color:var(--accent); }
button.client-action-close:focus-visible,
button.feedback-close:focus-visible,
button.esim-format-close:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.embedded-page .app-sidebar, .embedded-page .app-topbar, .embedded-page .app-footer { display:none; }
.embedded-page .sidebar-collapse-toggle { display:none; }
.embedded-page .app-shell { display:block; min-height:0; }
.embedded-page .app-main { width:100%; min-height:0; }
.embedded-page .app-content { max-width:none; padding:1rem; }
.embedded-page #cliente-container,
.embedded-page .titularidad-top .ret-client-group,
.embedded-page .retoma-top .ret-client-group { display:none !important; }
.embedded-page .retoma-top { display:block; }
@media (max-width: 1240px) {
    .client-portal { max-width:none; margin:0; }
    .client-chat-panel { position:static; width:auto; height:clamp(400px, 60svh, 560px); margin-top:1.1rem; }
}
@media (max-width: 980px) {
    .client-identity-card { grid-template-columns:minmax(0, 1fr) minmax(0, 1fr); }
    .client-summary-account { grid-column:1 / -1; justify-items:start; text-align:left; }
    .client-statuses { justify-content:flex-start; }
    .client-services { grid-template-columns:repeat(2, minmax(0, 1fr)); max-height:340px; }
    .client-quick-actions { grid-template-columns:1fr; gap:.85rem; }
    .client-quick-actions .client-actions { justify-content:flex-start; }
    .client-summary-actions { align-items:center; }
    .client-summary-actions .client-actions { justify-content:center; }
}
@media (max-width: 820px) {
    .client-portal.client-portal--empty { width:100%; min-height:calc(100svh - 180px); }
    .client-portal-head { padding:.75rem; }
    .client-identity-card { grid-template-columns:1fr; justify-items:start; padding:1rem; }
    .client-summary-account { grid-column:auto; justify-items:start; text-align:left; width:100%; }
    .client-statuses { justify-content:flex-start; }
    .client-profile-grid { grid-template-columns:1fr; }
    .client-search { width:100%; }
    .client-search > div { gap:.45rem; }
    .client-search .btn-primary { padding:.45rem .75rem; }
    .client-panel, .client-actions-panel { padding:1rem; border-radius:12px; }
    .client-panel dl div { grid-template-columns:1fr; gap:.2rem; }
    .client-services { grid-template-columns:1fr; grid-auto-rows:104px; max-height:318px; }
    .client-quick-actions { grid-template-columns:1fr; gap:.8rem; }
    .client-quick-actions .client-actions { justify-content:flex-start; }
    .client-actions { gap:.45rem; }
    .client-action { flex:1 1 145px; }
    .client-summary-actions { gap:.6rem; }
    .client-chat-panel { height:clamp(340px, 62svh, 500px); margin-top:.9rem; padding:.8rem; }
    .client-chat-messages { padding:.8rem; gap:.7rem; }
    .message-wrapper { max-width:90%; }
    .message-bubble { padding:.7rem .85rem; font-size:.88rem; }
    .client-chat-id { max-width:58%; overflow-wrap:anywhere; text-align:right; }
    .ticket-reasons { overflow-x:auto; padding-bottom:.25rem; }
    .ticket-list-head, .ticket-list-row { min-width:610px; }
    .commitments-grid { min-width:660px; }
    .billing-history-grid { min-width:680px; }
}
@media (max-width: 480px) {
    .client-profile { gap:.85rem; margin-top:.85rem; }
    .client-portal-head, .client-panel, .client-actions-panel { border-radius:10px; }
    .client-search > div { display:grid; grid-template-columns:minmax(0, 1fr) auto; }
    .client-search .btn-primary { min-width:76px; }
    .client-summary-account > strong { font-size:1.65rem; }
    .client-actions { display:grid; grid-template-columns:1fr; width:100%; }
    .client-action { width:100%; }
    .client-panel-toggle { font-size:.96rem; }
    .client-panel-toggle span:last-child { font-size:.78rem; }
    .client-chat-panel { height:58svh; min-height:320px; }
    .client-chat-head { align-items:flex-start; }
    .message-wrapper { max-width:94%; }
}

@media (max-width: 760px) {
    .esim-request-head, .esim-request-result, .esim-request-reservation { align-items:stretch; flex-direction:column; }
    .esim-request-overview { grid-template-columns:1fr; }
    .esim-request-fulfillment { grid-template-columns:1fr; }
    .esim-request-search { width:100%; }
    .esim-request-qr { align-self:center; }
    .esim-occupied-list { padding:1rem; }
    .esim-occupied-list > header { align-items:stretch; }
    .esim-list-search { width:100%; }
    .esim-page { gap:.85rem; }
    .esim-availability-banner { align-items:stretch; flex-direction:column; padding:1rem; }
    .esim-counters { justify-content:space-between; gap:.8rem; }
    .esim-counters > div { flex:1; justify-items:center; text-align:center; }
    .esim-counters strong { display:block; width:100%; text-align:center; }
    .esim-availability-banner strong { font-size:2rem; }
    .esim-banner-actions { display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); justify-content:stretch; gap:.5rem; }
    .esim-banner-actions .esim-action, .esim-banner-actions .esim-export-button { width:100%; min-height:40px; text-align:center; }
    .esim-banner-actions .esim-help-button { width:100%; min-height:40px; border-radius:9px; }
    .esim-list-switch { width:100%; }
    .esim-list-switch a { flex:1; }
    .esim-format-content { width:min(1040px, calc(100vw - 1.5rem)); }
    .esim-table-panel { border-radius:11px; }
    .esim-table-wrap { max-width:100%; -webkit-overflow-scrolling:touch; }
    .esim-table { min-width:760px; font-size:.78rem; }
    .esim-table th, .esim-table td { padding:.65rem .7rem; }
    .esim-qr img { width:36px; height:36px; }
    .esim-upload-content, .esim-release-content { width:min(94vw, 620px); padding:1rem; }
    .esim-release-content .modal-actions { flex-wrap:wrap; }
}

@media (max-width: 390px) {
    .esim-banner-actions { grid-template-columns:1fr; }
    .esim-counters { flex-direction:column; }
}

@media (max-width: 560px) {
    .esim-format-table { min-width:650px; table-layout:auto; }
    .esim-format-table th, .esim-format-table td { padding:.7rem .75rem; overflow-wrap:normal; white-space:nowrap; }
}
