/* Template 3 Style: Modern Corporate (Office Theme) */

:root {
    --accent: #2563eb;
    /* Corporate Blue */
    --dark: #1e293b;
    --light: #f8fafc;
    --grey: #64748b;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    min-height: 100vh;
    width: 100%;
    /* overflow: hidden; Removed to allow scrolling */
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

.split-layout {
    width: 100%;
    position: relative;
    /* overflow-x: hidden; Kept for menu, but vertical scroll is now allowed by default document flow */
}

/* Sticky/Fixed Visual Side */
.visual-side {
    position: fixed;
    /* Changed from sticky to fixed to ensure it never moves */
    top: 0;
    left: 0;
    width: 55%;
    /* Fixed width based on previous flex ratio (1.2 vs 1) approx */
    height: 100vh;
    overflow: hidden;
    z-index: 5;
}

.bg-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 10s ease;
}

/* Subtle zoom effect */
.visual-side:hover .bg-img {
    transform: scale(1.05);
}

.visual-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(30, 41, 59, 0.4), rgba(30, 41, 59, 0.1));
}

.visual-content {
    position: absolute;
    bottom: 60px;
    left: 60px;
    color: white;
}

.visual-content h2 {
    font-size: 3rem;
    font-weight: 300;
    line-height: 1.2;
}

.content-side {
    margin-left: 55%;
    /* Push content to start after the fixed image */
    width: 45%;
    /* Use remaining width */
    min-height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
    z-index: 10;
    position: relative;
    /* Ensure it stacks correctly */
}





/* New Content Sections */
.info-section {
    padding: 80px;
    border-top: 1px solid #f1f5f9;
}

/* Sticky Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Fixed Positioning */
    position: fixed;
    top: 0;
    right: 0;
    /* Width matches content-side width (45% on desktop) */
    width: 45%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    z-index: 100;
    padding: 20px 80px;
    /* Match content padding */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    /* Include padding in width */
}

/* Add padding to wrapper to account for fixed header so content isn't hidden */
.content-wrapper {
    padding: 60px 80px;
    padding-top: 100px;
    /* Space for header */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}



.logo {
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -1px;
}

.highlight {
    color: var(--accent);
}

.menu-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--grey);
}

main {
    max-width: 500px;
}

.tagline {
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 20px;
}

h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 30px;
    color: var(--dark);
    font-weight: 700;
}

p {
    color: var(--grey);
    line-height: 1.6;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.benefit-list {
    list-style: none;
    padding: 0;
    margin-bottom: 40px;
}

.benefit-list li {
    margin-bottom: 12px;
    font-weight: 500;
    color: var(--dark);
}

/* New Content Styles */

.section-badge {
    display: inline-block;
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 20px;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--dark);
    font-weight: 700;
}

.section-lead {
    font-size: 1.25rem;
    color: var(--grey);
    max-width: 600px;
    margin-bottom: 3rem;
    font-weight: 300;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 2rem;
}

.f-card {
    padding: 30px;
    background: #f8fafc;
    border-radius: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid transparent;
}

.f-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    background: white;
    border-color: #e2e8f0;
}

.icon-box {
    font-size: 2rem;
    margin-bottom: 20px;
}

.f-card h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
    color: var(--dark);
}

.f-card p {
    font-size: 1rem;
    margin-bottom: 0;
    line-height: 1.5;
}

/* Workflow Steps */
.step-list {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.step-item {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.step-num {
    font-size: 3rem;
    font-weight: 900;
    color: #cbd5e1;
    /* Light grey */
    line-height: 1;
}

.step-content h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--dark);
}

.step-content p {
    margin: 0;
}

/* Footer Section */
.main-footer {
    background: var(--dark);
    color: white;
    padding: 80px;
    text-align: center;
}

.main-footer h2 {
    color: white;
    font-size: 3rem;
}

.main-footer p {
    color: #94a3b8;
    margin-bottom: 40px;
}

.footer-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 60px;
}

.btn-primary-footer {
    padding: 15px 40px;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s;
}

.btn-primary-footer:hover {
    background: #1d4ed8;
}

.btn-secondary-footer {
    padding: 15px 40px;
    background: transparent;
    border: 1px solid #475569;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: border 0.3s;
}

.btn-secondary-footer:hover {
    border-color: white;
}

.copyright {
    font-size: 0.8rem;
    color: #64748b;
    border-top: 1px solid #334155;
    padding-top: 30px;
}

/* ── Main site mobile (≤900px) ── */
@media (max-width: 900px) {
    .visual-side {
        position: relative;
        width: 100%;
        height: 38vh;
        top: auto;
        left: auto;
    }

    .content-side {
        margin-left: 0;
        width: 100%;
    }

    header {
        width: 100%;
        padding: 16px 24px;
    }

    .content-wrapper {
        padding: 80px 24px 40px;
    }

    .info-section {
        padding: 40px 24px;
    }

    .main-footer {
        padding: 40px 24px;
    }

    h1 {
        font-size: 2.2rem;
    }

    .main-footer h2 {
        font-size: 1.8rem;
    }
}

/* CSS Updates for Menu (no body duplication, just menu overrides) */

/* Ensure content-side is relative for absolute positioning of the menu */
.content-side {
    position: relative;
}

/* Off-canvas Menu Styles */
.offcanvas-menu {
    position: fixed;
    /* Changed to fixed to cover viewport regardless of scroll */
    top: 0;
    right: -100%;
    /* Hidden by default */
    width: 600px;
    /* Use fixed width for better layout on desktop, max-width 100% for mobile */
    max-width: 100%;
    height: 100%;
    background-color: #1e293b;
    /* Corporate Blue/Dark */
    color: white;
    z-index: 2000;
    /* Increased z-index to be above everything */

    /* Toggle Visibility to prevent scrollbars */
    visibility: hidden;
    transition: right 0.5s ease-in-out, visibility 0.5s;

    display: flex;
    flex-direction: column;
    padding: 40px;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
    /* Stronger shadow */
}

.offcanvas-menu.open {
    right: 0;
    visibility: visible;
    transition: right 0.5s ease-in-out, visibility 0s;
}

.close-btn {
    align-self: flex-end;
    background: none;
    border: none;
    color: white;
    font-size: 3rem;
    line-height: 1;
    cursor: pointer;
    margin-bottom: 30px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.close-btn:hover {
    opacity: 1;
}

.menu-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
}

.menu-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}

.menu-content li {
    margin-bottom: 15px;
}

.menu-content a {
    color: #e2e8f0;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    transition: color 0.3s;
}

.menu-content a:hover {
    color: #2563eb;
    /* Accent Color */
}

.group-header {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #94a3b8;
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 1px solid #334155;
    padding-bottom: 5px;
}

.spacer {
    height: 20px;
}

.menu-cta {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 30px;
}

.btn-login {
    text-align: center;
    padding: 15px;
    border: 1px solid #475569;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.3s;
}

.btn-login:hover {
    background: #334155;
}

.btn-demo {
    text-align: center;
    padding: 15px;
    background: #2563eb;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-demo:hover {
    background: #1d4ed8;
}

.menu-footer {
    border-top: 1px solid #334155;
    padding-top: 20px;
    font-size: 0.9rem;
    color: #94a3b8;
}

.menu-footer p {
    margin: 5px 0;
    color: #94a3b8;
}

/* SPA Sections */
.page-section {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.page-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Coming Soon Styles */
.coming-soon {
    padding: 100px 40px;
    max-width: 600px;
    margin: 0 auto;
}

.notify-form {
    margin-top: 30px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Form Styles */
input,
select {
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.pricing-form-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    margin-top: 30px;
}

/* Standardized Modern Form Styles */
.modern-form-container {
    max-width: 600px;
    margin: 0;
    padding: 30px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.modern-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
    margin-bottom: 5px;
}

.modern-input:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-submit {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
    margin-top: 10px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(37, 99, 235, 0.3);
}

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

/* Dashboard Styles */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
    margin-top: 20px;
}

.stat-card {
    background: #f8fafc;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--grey);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dashboard-section {
    margin-top: 50px;
}

.dashboard-section h3 {
    font-size: 1.25rem;
    margin-bottom: 20px;
}

.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.dashboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.dashboard-table th {
    background: #f1f5f9;
    padding: 15px;
    font-size: 0.85rem;
    color: var(--grey);
    font-weight: 600;
}

.dashboard-table td {
    padding: 15px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.95rem;
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.online {
    background: #dcfce7;
    color: #166534;
}

.status-badge.offline {
    background: #fee2e2;
    color: #991b1b;
}

/* ============================================================
   SETTINGS PAGE — Isolated Full-Width Layout
   Breaks out of the 45% content-side constraint
   ============================================================ */

/* The #settings page-section is inside content-side (45% wide).
   We escape it by making its own wrapper cover the full viewport. */
#settings.page-section {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 200;
    background: #f1f5f9;
    overflow-y: auto;
    overflow-x: hidden;
}

#settings.page-section.active {
    display: block;
}

.settings-page-wrapper {
    padding-top: 70px; /* space for the fixed header */
    min-height: 100vh;
}

.settings-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}

/* Page Header */
.settings-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.settings-h1 {
    font-size: 2rem !important;
    margin: 4px 0 0 !important;
    color: #1e293b !important;
    font-weight: 700 !important;
}

.settings-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #dcfce7;
    color: #166534;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    white-space: nowrap;
}

/* --- Subscriptions horizontal scroll row --- */
.subs-container {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 24px;
    /* hide scrollbar but keep scroll */
    scrollbar-width: none;
}
.subs-container::-webkit-scrollbar { display: none; }

.sub-card {
    min-width: 250px;
    background: white;
    border: 1px solid #DFE4EF;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sub-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.sub-card.active {
    border-color: #1d4ed8;
    background: #f8faff;
    box-shadow: 0 4px 12px rgba(29,78,216,0.1);
}

.sub-card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sub-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
}

.mgmt-tabs-container {
    background: white;
    border-radius: 16px;
    border: 1px solid #DFE4EF;
    overflow: hidden;
}

.mgmt-tabs-header {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #DFE4EF;
    padding: 0 20px;
}

.mgmt-tab {
    padding: 16px 24px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.mgmt-tab:hover {
    color: #1e293b;
}

.mgmt-tab.active {
    color: #1d4ed8;
}

.mgmt-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #1d4ed8;
}

.mgmt-tabs-content {
    padding: 30px;
}

.tab-pane {
    display: none !important;
    animation: fadeIn 0.3s ease;
}

.tab-pane.active {
    display: block !important;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    font-size: 0.8rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-val {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* --- Agent Personnel Grid --- */
.agent-personnel-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

/* Personnel card */
.personnel-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 24px 16px 18px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.personnel-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: #e2e8f0;
    transition: background 0.25s ease;
}

.personnel-card:hover {
    border-color: #93c5fd;
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(29,78,216,0.08);
}

.personnel-card:hover::before {
    background: #93c5fd;
}

.personnel-card.active {
    border-color: #1d4ed8;
    background: #f8faff;
    box-shadow: 0 8px 24px rgba(29,78,216,0.12);
}

.personnel-card.active::before {
    background: linear-gradient(90deg, #1d4ed8, #3b82f6);
}

/* Avatar circle */
.pc-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.4rem;
    color: white;
    margin-bottom: 14px;
    position: relative;
}

.pc-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px; right: 2px;
    width: 14px; height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    background: #94a3b8; /* default: offline */
}

.pc-avatar.status-active::after { background: #22c55e; }
.pc-avatar.status-registered::after { background: #3b82f6; }

.pc-name {
    font-size: 0.9rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.3;
}

.pc-group {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 10px;
}

.pc-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.pc-status.ok   { background: #dcfce7; color: #166534; }
.pc-status.warn { background: #fef9c3; color: #854d0e; }
.pc-status.err  { background: #fee2e2; color: #991b1b; }

/* Selected check mark */
.personnel-card.active::after {
    content: '✓';
    position: absolute;
    top: 10px; right: 12px;
    background: #1d4ed8;
    color: white;
    width: 20px; height: 20px;
    border-radius: 50%;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Agent Settings Card (below grid) --- */
.agent-settings-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    margin-top: 4px;
    animation: slideUp 0.3s ease;
}

.agent-settings-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.asc-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.asc-meta {
    flex: 1;
    min-width: 0;
}

.asc-meta h3 {
    margin: 0 0 2px;
    font-size: 1rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.asc-meta span {
    font-size: 0.8rem;
    color: #64748b;
}

.asc-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.asc-footer {
    padding: 12px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.asc-footer p {
    margin: 0;
    font-size: 0.8rem;
    color: #94a3b8;
}

/* re-used badge */
.wpf-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.badge-success { background: #0E9F6E; }
.badge-warning { background: #f59e0b; }
.badge-danger  { background: #ef4444; }

/* agent grid responsive */
@media (max-width: 1024px) {
    .agent-personnel-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px)  {
    .agent-personnel-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px)  {
    .agent-personnel-grid { grid-template-columns: 1fr; }
    .agent-settings-card-header { flex-direction: column; align-items: flex-start; }
    .asc-actions { width: 100%; }
    .asc-actions .wpf-btn { flex: 1; }
}


/* --- Data Grid --- */
.wpf-panel-header {
    margin-bottom: 20px;
    display: flex;
    align-items: baseline;
}

.wpf-data-grid {
    width: 100%;
    border-collapse: collapse;
}

.wpf-data-grid th {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid #E2E8F0;
    color: #64748B;
    font-size: 0.85rem;
    font-weight: 600;
}

.wpf-data-grid td {
    padding: 12px;
    border-bottom: 1px solid #F1F5F9;
}

.wpf-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.wpf-panel-footer {
    margin-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wpf-action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.wpf-btn {
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.85rem;
}

.wpf-btn-secondary { background: #F1F5F9; color: #475569; }
.wpf-btn-success { background: #0E9F6E; color: white; }
.wpf-btn-purple { background: #7E22CE; color: white; }

.wpf-divider {
    width: 1px;
    height: 24px;
    background: #E2E8F0;
    margin: 0 5px;
}

/* ============================================================
   RESPONSIVE — Settings page is a full-viewport overlay,
   so only tablet/mobile tweaks for the inner layout matter.
   General site breakpoints below.
   ============================================================ */

/* ── Tablet & below (≤900px) ─────────────────────────────── */
@media (max-width: 900px) {

    /* Settings inner padding */
    .settings-inner {
        padding: 20px 16px 60px;
    }

    .settings-h1 {
        font-size: 1.6rem !important;
    }

    /* Subscription cards: slightly smaller on tablet */
    .sub-card {
        min-width: 220px;
    }

    /* Details grid: 2 columns on tablet */
    .details-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Tabs: tighter padding */
    .mgmt-tabs-header {
        padding: 0 12px;
    }
    .mgmt-tab {
        padding: 14px 16px;
        font-size: 0.9rem;
    }
    .mgmt-tabs-content {
        padding: 20px;
    }

    /* Agent slider */
    .agent-slider-section {
        /* soft fade on edges so it looks deliberate */
        -webkit-mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
        mask-image: linear-gradient(to right, transparent 0%, black 12%, black 88%, transparent 100%);
    }

    /* Settings table: horizontal scroll */
    .wpf-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .wpf-data-grid {
        min-width: 620px;
    }

    /* Action footer: stack */
    .wpf-panel-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .wpf-action-buttons {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .wpf-btn {
        width: 100%;
        padding: 14px;
        text-align: center;
    }
    .wpf-divider { display: none; }
}

/* ── Mobile (≤600px) ─────────────────────────────────────── */
@media (max-width: 600px) {

    /* Settings page header stacks on very narrow */
    .settings-page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .settings-h1 {
        font-size: 1.4rem !important;
    }

    /* Subscription cards: full-width on mobile */
    .sub-card {
        min-width: calc(85vw);
        width: calc(85vw);
    }

    /* Details grid: single column */
    .details-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Tab labels: equal width */
    .mgmt-tab {
        flex: 1;
        text-align: center;
        padding: 12px 8px;
        font-size: 0.82rem;
    }
    .mgmt-tabs-content {
        padding: 14px;
    }

    /* Agent circles: smaller on phone */
    .agent-circle {
        min-width: 64px;
        height: 64px;
        font-size: 0.95rem;
    }
    .agent-circle.active {
        transform: scale(1.25);
    }

    /* Info card: compact */
    .agent-info-glass {
        padding: 16px;
    }
    .info-header {
        gap: 12px;
    }
    .info-avatar {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
        border-radius: 10px;
    }
    .info-titles h3 {
        font-size: 1rem;
    }

    /* Panel header: stack title + subtitle */
    .wpf-panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .wpf-panel-header span {
        margin-left: 0 !important;
    }
}

/* ── Small mobile (≤400px) ───────────────────────────────── */
@media (max-width: 400px) {
    .settings-inner {
        padding: 12px 12px 60px;
    }

    .agent-circle {
        min-width: 56px;
        height: 56px;
        font-size: 0.85rem;
    }

    .slider-nav {
        width: 34px;
        height: 34px;
    }
}

/* --- CUSTOM DIALOG --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    display: flex;
}

.modal-card {
    background: #fff;
    width: 90%;
    max-width: 400px;
    padding: 32px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid #f1f5f9;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--dark);
}

.modal-card p {
    color: var(--grey);
    line-height: 1.6;
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 12px 24px;
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease; /* Ensure transition exists */
}

.modal-actions button:hover {
    transform: translateY(-2px); /* Uniform movement */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--dark);
    border: 1px solid #e2e8f0 !important;
}

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

/* --- AUTH TABS & SOCIAL --- */
.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid #f1f5f9;
}

.auth-tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 700;
    color: var(--grey);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s ease;
}

.auth-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.social-divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
    color: var(--grey);
    font-size: 0.85rem;
}

.social-divider::before, .social-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.social-divider span {
    padding: 0 15px;
}

.social-auth-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.social-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* --- EMAIL TAG INPUT --- */
.email-tag-input-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    min-height: 48px;
    align-items: center;
    transition: all 0.2s;
    width: 100%;
}

.email-tag-input-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.email-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.email-tag {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: tagIn 0.2s ease-out;
}

.email-tag .remove-tag {
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0.8;
}

.email-tag .remove-tag:hover {
    opacity: 1;
}

@keyframes tagIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Disabled State Styling - Re-fixed for High Visibility */
.setting-value-input:disabled,
.setting-value-input[disabled] {
    opacity: 0.7 !important;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.08) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-muted) !important;
}

[data-theme="dark"] .setting-value-input:disabled,
[data-theme="dark"] .setting-value-input[disabled] {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    color: rgba(255, 255, 255, 0.5) !important;
}

.email-tag-input-container.setting-value-input {
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
}

.email-tag-input-container.setting-value-input input:disabled {
    background: transparent !important;
    border: none !important;
}
