/* ═══════════════════════════════════════
   LARAVELSAAS — Design System
   Light default, Dark switchable
═══════════════════════════════════════ */

/* ── CSS VARIABLES ── */
:root {
    --brand: #7f77dd;
    --brand-dark: #6c63d4;
    --brand-light: #eeedfe;
    --brand-glow: rgba(127, 119, 221, 0.2);

    --sb-bg: #ffffff;
    --sb-border: #f0ecfc;
    --sb-brand-name: #1a1730;
    --sb-brand-tag: #7f77dd;
    --sb-section-label: #c0bce0;
    --sb-item-color: #8b87a8;
    --sb-item-hover-bg: #f5f3fd;
    --sb-item-hover-color: #534ab7;
    --sb-active-bg: #eeedfe;
    --sb-active-color: #534ab7;
    --sb-active-border: #7f77dd;
    --sb-badge-bg: #e0ddfb;
    --sb-badge-color: #534ab7;
    --sb-search-bg: #f8f7fd;
    --sb-search-border: #ede9fb;
    --sb-search-placeholder: #c0bce0;
    --sb-divider: #f0ecfc;
    --sb-user-bg: #f8f7fd;
    --sb-user-border: #ede9fb;
    --sb-user-name: #1a1730;
    --sb-user-role: #b0acd8;
    --sb-dots: #c0bce0;

    --topbar-bg: #ffffff;
    --topbar-border: #f0ecfc;
    --topbar-title: #1a1730;
    --topbar-sub: #8b87a8;
    --topbar-notif-border: #ede9fb;
    --topbar-notif-icon: #8b87a8;

    --page-bg: #f8f7fd;
    --card-bg: #ffffff;
    --card-border: #ece9f8;
    --card-radius: 12px;

    --text-primary: #1a1730;
    --text-secondary: #8b87a8;
    --text-muted: #b0acd8;

    --input-bg: #f8f7fd;
    --input-border: #e0ddfb;
    --input-focus: #7f77dd;
    --input-text: #1a1730;
    --input-placeholder: #b0acd8;

    --btn-primary-bg: #7f77dd;
    --btn-primary-hover: #6c63d4;
    --btn-primary-text: #ffffff;

    --success: #639922;
    --success-bg: #eaf3de;
    --warning: #854f0b;
    --warning-bg: #faeeda;
    --danger: #a32d2d;
    --danger-bg: #fcebeb;
    --info: #185fa5;
    --info-bg: #e6f1fb;
}

/* ── DARK THEME ── */
[data-theme="dark"] {
    --sb-bg: #13112b;
    --sb-border: rgba(255, 255, 255, 0.06);
    --sb-brand-name: #ffffff;
    --sb-brand-tag: #9b93ff;
    --sb-section-label: #3d3a60;
    --sb-item-color: #6b6890;
    --sb-item-hover-bg: #1e1b3f;
    --sb-item-hover-color: #b0acd8;
    --sb-active-bg: #252248;
    --sb-active-color: #c4bfff;
    --sb-active-border: #9b93ff;
    --sb-badge-bg: #2e2a55;
    --sb-badge-color: #9b93ff;
    --sb-search-bg: #1e1b3f;
    --sb-search-border: rgba(255, 255, 255, 0.06);
    --sb-search-placeholder: #4e4b72;
    --sb-divider: rgba(255, 255, 255, 0.05);
    --sb-user-bg: #1a1736;
    --sb-user-border: rgba(255, 255, 255, 0.06);
    --sb-user-name: #d4d0f5;
    --sb-user-role: #4e4b72;
    --sb-dots: #4e4b72;

    --topbar-bg: #1a1736;
    --topbar-border: rgba(255, 255, 255, 0.06);
    --topbar-title: #ffffff;
    --topbar-sub: #6b6890;
    --topbar-notif-border: rgba(255, 255, 255, 0.08);
    --topbar-notif-icon: #6b6890;

    --page-bg: #110f27;
    --card-bg: #1a1736;
    --card-border: rgba(255, 255, 255, 0.06);

    --text-primary: #ffffff;
    --text-secondary: #6b6890;
    --text-muted: #4e4b72;

    --input-bg: #1e1b3f;
    --input-border: rgba(255, 255, 255, 0.08);
    --input-text: #ffffff;
    --input-placeholder: #4e4b72;

    --success-bg: #1a2e0a;
    --warning-bg: #2e1f08;
    --danger-bg: #2e0f0f;
    --info-bg: #0a1e35;
}

/* ── BASE ── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    background: var(--page-bg);
    color: var(--text-primary);
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: 14px;
    line-height: 1.6;
    transition:
        background 0.3s ease,
        color 0.3s ease;
    margin: 0;
}

/* ── SIDEBAR ── */
.sidebar {
    width: 235px;
    min-height: 100vh;
    background: var(--sb-bg);
    border-right: 1px solid var(--sb-border);
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition:
        background 0.3s ease,
        border-color 0.3s ease;
}

.sb-brand {
    padding: 22px 18px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--sb-border);
}

.sb-brand-icon {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #9b93ff, #6c63d4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--brand-glow);
}

.sb-brand-icon svg {
    width: 17px;
    height: 17px;
    fill: #fff;
}

.sb-brand-text {
    display: flex;
    flex-direction: column;
}
.sb-brand-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--sb-brand-name);
    letter-spacing: -0.3px;
    line-height: 1.2;
}
.sb-brand-tag {
    font-size: 10px;
    color: var(--sb-brand-tag);
    letter-spacing: 0.3px;
    margin-top: 2px;
}

.sb-search {
    margin: 14px 14px 4px;
    background: var(--sb-search-bg);
    border: 1px solid var(--sb-search-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}
.sb-search svg {
    width: 13px;
    height: 13px;
    stroke: var(--sb-search-placeholder);
    flex-shrink: 0;
    fill: none;
}
.sb-search input {
    border: none;
    background: transparent;
    font-size: 12px;
    color: var(--input-text);
    outline: none;
    width: 100%;
}
.sb-search input::placeholder {
    color: var(--sb-search-placeholder);
}

.sb-section-label {
    font-size: 10px;
    color: var(--sb-section-label);
    padding: 14px 18px 5px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    font-weight: 500;
}

.sb-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    margin: 2px 10px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--sb-item-color);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    transition:
        background 0.15s ease,
        color 0.15s ease;
}
.sb-nav-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}
.sb-nav-item:hover {
    background: var(--sb-item-hover-bg);
    color: var(--sb-item-hover-color);
    text-decoration: none;
}
.sb-nav-item.active {
    background: var(--sb-active-bg);
    color: var(--sb-active-color);
    font-weight: 500;
}
.sb-nav-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--sb-active-border);
    border-radius: 0 3px 3px 0;
}

.sb-badge {
    margin-left: auto;
    background: var(--sb-badge-bg);
    color: var(--sb-badge-color);
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 20px;
    font-weight: 500;
}

.sb-divider {
    height: 1px;
    background: var(--sb-divider);
    margin: 8px 14px;
}

.sb-bottom {
    margin-top: auto;
    padding: 12px 10px;
    border-top: 1px solid var(--sb-border);
}

.sb-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    background: var(--sb-user-bg);
    border: 1px solid var(--sb-user-border);
    text-decoration: none;
}
.sb-avatar {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, #9b93ff, #6c63d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    flex-shrink: 0;
}
.sb-user-name {
    font-size: 12px;
    color: var(--sb-user-name);
    font-weight: 500;
}
.sb-user-role {
    font-size: 11px;
    color: var(--sb-user-role);
    margin-top: 1px;
}
.sb-user-dots {
    margin-left: auto;
}
.sb-user-dots svg {
    width: 14px;
    height: 14px;
    stroke: var(--sb-dots);
    fill: none;
}

/* ── TOPBAR ── */
.topbar {
    position: fixed;
    top: 0;
    left: 235px;
    right: 0;
    height: 56px;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--topbar-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    transition:
        background 0.3s ease,
        border-color 0.3s ease;
}
.topbar-left {
    display: flex;
    flex-direction: column;
}
.topbar-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--topbar-title);
}
.topbar-sub {
    font-size: 11px;
    color: var(--topbar-sub);
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Theme Toggle Button */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--topbar-notif-border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.theme-toggle:hover {
    background: var(--sb-item-hover-bg);
}
.theme-toggle svg {
    width: 16px;
    height: 16px;
    stroke: var(--topbar-notif-icon);
    fill: none;
}

.notif-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--topbar-notif-border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.notif-btn svg {
    width: 16px;
    height: 16px;
    stroke: var(--topbar-notif-icon);
    fill: none;
}

.plan-badge {
    background: var(--brand-light);
    color: #534ab7;
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}
[data-theme="dark"] .plan-badge {
    background: #252248;
    color: #c4bfff;
}

/* ── MAIN CONTENT ── */
.main-content {
    margin-left: 235px;
    padding: 80px 28px 28px;
    min-height: 100vh;
    background: var(--page-bg);
    transition: background 0.3s ease;
}

/* ── CARDS ── */
.saas-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    padding: 20px;
    transition:
        background 0.3s ease,
        border-color 0.3s ease;
}

/* ── STAT CARDS ── */
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    padding: 18px;
    transition: background 0.3s ease;
}
.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin-bottom: 8px;
}
.stat-value {
    font-size: 26px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1;
}
.stat-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 5px;
}
.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.stat-icon svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke-width: 1.5;
}
.si-purple {
    background: #eeedfe;
}
.si-purple svg {
    stroke: #534ab7;
}
.si-green {
    background: #eaf3de;
}
.si-green svg {
    stroke: #3b6d11;
}
.si-amber {
    background: #faeeda;
}
.si-amber svg {
    stroke: #854f0b;
}
.si-blue {
    background: #e6f1fb;
}
.si-blue svg {
    stroke: #185fa5;
}
[data-theme="dark"] .si-purple {
    background: #252248;
}
[data-theme="dark"] .si-green {
    background: #1a2e0a;
}
[data-theme="dark"] .si-amber {
    background: #2e1f08;
}
[data-theme="dark"] .si-blue {
    background: #0a1e35;
}

/* ── BUTTONS ── */
.btn-brand {
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-brand:hover {
    background: var(--btn-primary-hover);
    color: #fff;
    text-decoration: none;
}

.btn-outline-brand {
    background: transparent;
    color: var(--brand);
    border: 1px solid var(--brand);
    border-radius: 9px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-outline-brand:hover {
    background: var(--brand-light);
    text-decoration: none;
}

/* ── FORMS ── */
.saas-input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 9px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--input-text);
    outline: none;
    transition: border-color 0.2s;
}
.saas-input:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px var(--brand-glow);
}
.saas-input::placeholder {
    color: var(--input-placeholder);
}
.saas-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: block;
}

.saas-input-error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(163, 45, 45, 0.1);
}

/* ── ALERTS ── */
.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #c0dd97;
    border-radius: 9px;
    padding: 12px 16px;
    font-size: 13px;
}
.alert-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #f09595;
    border-radius: 9px;
    padding: 12px 16px;
    font-size: 13px;
}
.alert-warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid #fac775;
    border-radius: 9px;
    padding: 12px 16px;
    font-size: 13px;
}
.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid #85b7eb;
    border-radius: 9px;
    padding: 12px 16px;
    font-size: 13px;
}

/* ── BADGES ── */
.badge-purple {
    background: #eeedfe;
    color: #534ab7;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}
.badge-green {
    background: #eaf3de;
    color: #3b6d11;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}
.badge-red {
    background: #fcebeb;
    color: #a32d2d;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}
.badge-amber {
    background: #faeeda;
    color: #854f0b;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}

/* ── PAGE HEADER ── */
.page-header {
    margin-bottom: 22px;
}
.page-title {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 3px;
}
.page-sub {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── TABLES ── */
.saas-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.saas-table th {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--card-border);
    text-align: left;
}
.saas-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-primary);
}
.saas-table tr:last-child td {
    border-bottom: none;
}
.saas-table tr:hover td {
    background: var(--sb-item-hover-bg);
}

/* ── DIVIDER ── */
.saas-divider {
    height: 1px;
    background: var(--card-border);
    margin: 20px 0;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .topbar {
        left: 0;
    }
}

/* ── LAYOUT HELPERS ── */
.d-flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.d-flex-center {
    display: flex;
    align-items: center;
}
.gap-10 {
    gap: 10px;
}
.mb-20 {
    margin-bottom: 20px;
}
.w-100 {
    width: 100%;
}

/* ── GRIDS ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}
.two-col-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

/* ── STAT CARD ── */
.stat-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* ── ICON HELPERS ── */
.icon-sm {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}
.icon-stroke {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}
.icon-white {
    stroke: #fff;
}

/* ── CARD HEADER ROW ── */
.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.card-heading {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}
.card-link {
    font-size: 11px;
    color: var(--brand);
    text-decoration: none;
    cursor: pointer;
}
.card-link:hover {
    text-decoration: underline;
}

/* ── USAGE BAR ── */
.usage-bar-wrap {
    margin-bottom: 14px;
}
.usage-bar-track {
    height: 6px;
    background: var(--card-border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 6px;
}
.usage-bar-fill {
    height: 100%;
    background: var(--brand);
    border-radius: 10px;
    transition: width 0.4s ease;
}
.usage-bar-labels {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

/* ── GMAIL CONNECT BOX ── */
.gmail-connect-box {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--page-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 14px;
}
.gmail-icon-wrap {
    width: 46px;
    height: 46px;
    background: var(--card-border);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.gmail-connect-text {
    flex: 1;
}

/* ── EMPTY STATE ── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    text-align: center;
}
.empty-icon {
    width: 56px;
    height: 56px;
    background: var(--page-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.empty-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 5px;
}
.empty-sub {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 260px;
    line-height: 1.6;
}

/* ── QUICK ACTIONS ── */
.quick-actions-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.quick-action-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 10px;
    text-decoration: none;
    transition: background 0.15s;
}
.quick-action-item:hover {
    background: var(--sb-item-hover-bg);
    text-decoration: none;
}
.qa-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.qa-text {
    flex: 1;
}
.qa-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}
.qa-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 1px;
}
.qa-arrow {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 2;
    flex-shrink: 0;
}

/* red variant badge for sidebar */
.sb-badge-red {
    background: #fcebeb;
    color: #a32d2d;
    font-size: 9px;
    padding: 2px 6px;
}
[data-theme="dark"] .sb-badge-red {
    background: #2e0f0f;
    color: #f09595;
}

/* ── FILTER BAR ── */
.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.filter-tabs {
    display: flex;
    gap: 4px;
    background: var(--page-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 4px;
}
.filter-tab {
    background: transparent;
    border: none;
    border-radius: 7px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}
.filter-tab.active {
    background: var(--card-bg);
    color: var(--brand);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.filter-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.search-input-icon {
    position: absolute;
    left: 10px;
    width: 13px;
    height: 13px;
    fill: none;
    stroke: var(--text-muted);
    stroke-width: 2;
}
.search-input {
    padding-left: 32px !important;
}

/* ── AUTOMATION TABLE ── */
.auto-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}
.auto-prompt-preview {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.auto-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.auto-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    border: 1px solid var(--card-border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.15s;
}
.auto-action-btn:hover {
    background: var(--page-bg);
    color: var(--brand);
}
.auto-action-btn-danger:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* ── TOGGLE SWITCH ── */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--card-border);
    border-radius: 22px;
    transition: 0.2s;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--brand);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(18px);
}

/* ── AUTO TOGGLE (table row) ── */
.auto-toggle {
    width: 44px;
    height: 24px;
    background: var(--card-border);
    border-radius: 24px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.08);
}

.auto-toggle.on {
    background: var(--btn-primary-bg);
}

.auto-toggle-thumb {
    width: 20px;
    height: 20px;
    background: var(--card-bg);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 4px rgba(0,0,0,0.18), 0 1px 2px rgba(0,0,0,0.12);
}

.auto-toggle.on .auto-toggle-thumb {
    transform: translateX(20px);
}

/* ── HOW IT WORKS ── */
.how-it-works {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    padding: 24px;
    margin-top: 20px;
}
.hiw-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
}
.hiw-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.hiw-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    flex: 1;
    min-width: 120px;
}
.hiw-step-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hiw-step-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}
.hiw-step-sub {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.hiw-arrow {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* ── MODAL ── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}
.modal-overlay.modal-open {
    display: flex;
}
.modal-box {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
}
.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 24px;
}
.modal-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}
.modal-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
}
.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    flex-shrink: 0;
}
.modal-close:hover {
    background: var(--page-bg);
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.saas-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}
.mt-20 {
    margin-top: 20px;
}
.mb-20 {
    margin-bottom: 20px;
}

/* ── BADGE BLUE ── */
.badge-blue {
    background: #e6f1fb;
    color: #185fa5;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 500;
}
[data-theme="dark"] .badge-blue {
    background: #0a1e35;
    color: #85b7eb;
}
[data-theme="dark"] .badge-green {
    background: #1a2e0a;
    color: #97c459;
}
[data-theme="dark"] .badge-purple {
    background: #252248;
    color: #c4bfff;
}
[data-theme="dark"] .badge-amber {
    background: #2e1f08;
    color: #ef9f27;
}
[data-theme="dark"] .badge-red {
    background: #2e0f0f;
    color: #f09595;
}

/* ── GMAIL STATUS ── */
.gmail-status-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}
.gmail-status-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.gmail-status-icon.connected {
    background: #eaf3de;
}
.gmail-status-icon.disconnected {
    background: #fcebeb;
}
[data-theme="dark"] .gmail-status-icon.connected {
    background: #1a2e0a;
}
[data-theme="dark"] .gmail-status-icon.disconnected {
    background: #2e0f0f;
}

.gmail-status-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 3px;
}
.gmail-status-sub {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ── GMAIL INFO GRID ── */
.gmail-info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 4px;
}
.gmail-info-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}
.gmail-info-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ── PERMISSIONS LIST ── */
.permissions-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.permission-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 10px;
    border-radius: 10px;
    background: var(--page-bg);
    border: 1px solid var(--card-border);
}
.permission-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.permission-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}
.permission-sub {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.permission-text {
    flex: 1;
}

/* ── GMAIL CONNECT CTA ── */
.gmail-connect-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

/* ── GMAIL STEPS ── */
.gmail-steps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}
.gmail-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    flex: 1;
    min-width: 110px;
    position: relative;
}
.gmail-step-number {
    position: absolute;
    top: -6px;
    right: calc(50% - 30px);
    width: 18px;
    height: 18px;
    background: var(--brand);
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gmail-step-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.gmail-step-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}
.gmail-step-sub {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.gmail-step-arrow {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    margin-bottom: 20px;
}

/* ── SECURITY NOTE ── */
.gmail-security-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: #e6f1fb;
    border: 1px solid #85b7eb;
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 4px;
}
[data-theme="dark"] .gmail-security-note {
    background: #0a1e35;
    border-color: #185fa5;
}
.security-note-icon {
    flex-shrink: 0;
    margin-top: 1px;
}
.security-note-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ══════════════════════════════════════
   LOGS PAGE
══════════════════════════════════════ */
.log-automation-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}
.log-email-subject {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}
.log-ai-output {
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ══════════════════════════════════════
   SUBSCRIPTION PAGE
══════════════════════════════════════ */

/* ── CURRENT PLAN WRAP ── */
.current-plan-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.current-plan-name {
    font-size: 22px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.current-plan-price {
    font-size: 32px;
    font-weight: 500;
    color: var(--brand);
    line-height: 1;
    margin-bottom: 8px;
}
.current-plan-price span {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
}
.current-plan-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}
.current-plan-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.cpf-item {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
}
.cpf-yes {
    background: var(--success-bg);
    color: var(--success);
}
.cpf-no {
    background: var(--page-bg);
    color: var(--text-muted);
    text-decoration: line-through;
    border: 1px solid var(--card-border);
}

/* ── USAGE ── */
.current-plan-usage {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.cpu-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}
.cpu-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cpu-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

/* ── BILLING TOGGLE ── */
.billing-toggle {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 0.5px solid var(--border-color);
    border-radius: 24px;
    padding: 4px;
    gap: 2px;
}
.billing-btn {
    border: none;
    background: transparent;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

/* This MUST come after the rule above */
.billing-btn.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 500;
}
.yearly-savings {
    font-size: 12px;
    color: #1a7a45;
    font-weight: 500;
    min-height: 16px;
    opacity: 0;
    transition: opacity 0.2s;
    margin-bottom: 4px;
}
.billing-btn {
    background: transparent;
    border: none;
    border-radius: 7px;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.billing-btn.active {
    background: var(--card-bg);
    color: var(--brand);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.save-badge {
    background: #eaf3de;
    color: #3b6d11;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 20px;
    font-weight: 500;
}

/* ── PLANS GRID ── */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.plan-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    transition: border-color 0.2s;
}
.plan-card-featured {
    border: 2px solid var(--brand);
}
.plan-popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--brand);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 14px;
    border-radius: 20px;
    white-space: nowrap;
}
.plan-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.plan-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.plan-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}
.plan-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}
.plan-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.plan-price {
    font-size: 30px;
    font-weight: 500;
    color: var(--text-primary);
}
.plan-period {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── PLAN FEATURES ── */
.plan-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.pf-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}
.pf-item::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.pf-yes {
    color: var(--text-primary);
}
.pf-yes::before {
    background: var(--brand);
}
.pf-no {
    color: var(--text-muted);
    text-decoration: line-through;
}
.pf-no::before {
    background: var(--card-border);
}

/* ── PLAN BUTTONS ── */
.plan-btn {
    width: 100%;
    padding: 10px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    display: block;
    border: none;
    transition: all 0.2s;
}
.plan-btn-current {
    background: var(--page-bg);
    color: var(--text-muted);
    border: 1px solid var(--card-border);
    cursor: not-allowed;
}
.plan-btn-featured {
    background: var(--brand);
    color: #fff;
}
.plan-btn-featured:hover {
    background: var(--btn-primary-hover);
}
.plan-btn-outline {
    background: transparent;
    color: var(--brand);
    border: 1px solid var(--brand);
}
.plan-btn-outline:hover {
    background: var(--brand-light);
    color: var(--brand);
}

/* ── DARK MODE FIXES ── */
[data-theme="dark"] .cpf-yes {
    background: #1a2e0a;
    color: #97c459;
}
[data-theme="dark"] .save-badge {
    background: #1a2e0a;
    color: #97c459;
}
[data-theme="dark"] .plan-btn-current {
    background: var(--page-bg);
}

/* ══════════════════════════════════════
   PROFILE PAGE
══════════════════════════════════════ */

/* ── LAYOUT ── */
.profile-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 20px;
    align-items: start;
}
.profile-left {
    display: flex;
    flex-direction: column;
}
.profile-right {
    display: flex;
    flex-direction: column;
}

/* ── AVATAR ── */
.avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 4px;
    gap: 14px;
}
.profile-avatar-wrap {
    position: relative;
    width: 88px;
    height: 88px;
}
.profile-avatar-img {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--brand-light);
}
.profile-avatar-initials {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: linear-gradient(135deg, #9b93ff, #6c63d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 500;
    color: #fff;
    border: 3px solid var(--brand-light);
}
.avatar-edit-btn {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 26px;
    height: 26px;
    background: var(--brand);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid var(--card-bg);
    transition: background 0.2s;
}
.avatar-edit-btn:hover {
    background: var(--btn-primary-hover);
}
.profile-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}
.profile-email {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 3px;
}
.profile-since {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

/* ── PROFILE INFO ROWS ── */
.profile-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--card-border);
    font-size: 13px;
}
.profile-info-row:last-child { border-bottom: none; }
.profile-info-label { color: var(--text-secondary); }
.profile-info-value { color: var(--text-primary); font-weight: 500; }

/* ── QUICK STATS ── */
.profile-quick-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 4px 0;
}
.pqs-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex: 1;
}
.pqs-value {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
}
.pqs-label {
    font-size: 11px;
    color: var(--text-secondary);
}
.pqs-divider {
    width: 1px;
    height: 32px;
    background: var(--card-border);
}

/* ── DANGER ZONE ── */
.danger-zone-card {
    border-color: #f09595 !important;
}
[data-theme="dark"] .danger-zone-card {
    border-color: #a32d2d !important;
}
.danger-zone-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}
.danger-zone-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--danger);
    margin-bottom: 4px;
}
.danger-zone-sub {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    max-width: 200px;
}

/* ── DANGER BUTTON ── */
.btn-danger {
    background: var(--danger);
    color: #fff;
    border: none;
    border-radius: 9px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.btn-danger:hover {
    background: #791f1f;
}
.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ── PASSWORD INPUT ── */
.password-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.password-input-wrap .saas-input {
    padding-right: 40px;
}
.password-toggle {
    position: absolute;
    right: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    padding: 0;
    transition: color 0.15s;
}
.password-toggle:hover {
    color: var(--brand);
}

/* ── PASSWORD STRENGTH ── */
.password-strength-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.ps-label {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}
.ps-bars {
    display: flex;
    gap: 4px;
    flex: 1;
}
.ps-bar {
    height: 4px;
    flex: 1;
    border-radius: 4px;
    background: var(--card-border);
    transition: background 0.3s;
}
.ps-text {
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

/* ── CONNECTED SERVICES ── */
.connected-services {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.service-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 10px;
    background: var(--page-bg);
    border: 1px solid var(--card-border);
}
.service-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.service-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}
.service-status {
    margin-top: 3px;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }
    .plans-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .two-col-grid {
        grid-template-columns: 1fr;
    }
    .gmail-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .current-plan-wrap {
        grid-template-columns: 1fr;
    }
}

/* ══════════════════════════════════════
   ADMIN USERS PAGE
══════════════════════════════════════ */

/* ── ADMIN STAT PILL ── */
.admin-stat-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ── USER TABLE AVATAR ── */
.user-table-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
}
.uta-admin {
    background: linear-gradient(135deg, #9b93ff, #6c63d4);
    color: #fff;
}
.uta-user {
    background: var(--brand-light);
    color: var(--brand);
}
[data-theme="dark"] .uta-user {
    background: #252248;
    color: #c4bfff;
}

.user-table-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}
.user-table-id {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* ── ROLE SELECT ── */
.role-select {
    min-width: 100px;
}

/* ── PAGINATION ── */
.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 4px;
    flex-wrap: wrap;
    gap: 12px;
}
.pagination-info {
    font-size: 12px;
    color: var(--text-secondary);
}
.pagination-links {
    display: flex;
    align-items: center;
    gap: 4px;
}
.page-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}
.page-btn:hover {
    background: var(--brand-light);
    color: var(--brand);
    border-color: var(--brand);
}
.page-btn-active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}
.page-btn-active:hover {
    background: var(--brand);
    color: #fff;
}
.page-btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ── MODAL DETAIL GRID ── */
.modal-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 16px;
}
.modal-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.modal-detail-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.modal-detail-value {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}



/* ══════════════════════════════════════
   ADMIN SETTINGS PAGE
══════════════════════════════════════ */
.settings-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.settings-input-prefix {
    position: absolute;
    left: 12px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
}
.settings-input { padding-left: 34px !important; }
.settings-plan-box {
    background: var(--page-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px;
}
.settings-plan-box-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ── PREVIEW ── */
.settings-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    background: var(--page-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
}
.sp-monthly, .sp-yearly {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sp-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.sp-price {
    font-size: 28px;
    font-weight: 500;
    color: var(--brand);
}
.sp-price span { font-size: 13px; color: var(--text-secondary); font-weight: 400; }
.sp-name  { font-size: 12px; color: var(--text-secondary); }
.sp-divider {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--card-border);
    width: 30px; height: 30px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}


/* ── PLAN SECTION HEADER ── */
.plan-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

/* ── YEARLY SAVINGS BANNER ── */
.yearly-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #EAF3DE;
    border: 1px solid #c0dd97;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 13px;
    color: #3B6D11;
    margin-bottom: 14px;
}
[data-theme="dark"] .yearly-banner {
    background: #1a2e0a;
    border-color: #3B6D11;
    color: #97C459;
}

/* ── PLAN BILLING NOTE ── */
.plan-billing-note {
    font-size: 10px;
    color: var(--brand);
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* ── PLAN YEARLY TOTAL ── */
.plan-yearly-total {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--page-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 6px 12px;
    margin-top: -6px;
}


/* ══════════════════════════════════════
   HAMBURGER BUTTON
══════════════════════════════════════ */
.hamburger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 9px;
    border: 1px solid var(--card-border);
    background: transparent;
    cursor: pointer;
    color: var(--text-primary);
    flex-shrink: 0;
    margin-right: 10px;
    transition: background 0.15s;
}
.hamburger-btn:hover { background: var(--page-bg); }

/* ── SIDEBAR CLOSE BUTTON (mobile only) ── */
.sb-close-btn {
    display: none;
    position: absolute;
    top: 14px; right: 14px;
    width: 28px; height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: transparent;
    cursor: pointer;
    color: #9d9bbc;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    z-index: 10;
}
.sb-close-btn:hover { background: rgba(255,255,255,0.05); }

/* ── SIDEBAR OVERLAY ── */
.sb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 199;
    backdrop-filter: blur(2px);
}
.sb-overlay.sb-overlay-visible { display: block; }

/* ══════════════════════════════════════
   RESPONSIVE BREAKPOINTS
══════════════════════════════════════ */

/* ── TABLET (max 1024px) ── */
@media (max-width: 1024px) {
    .stats-grid       { grid-template-columns: repeat(2, 1fr); }
    .plans-grid       { grid-template-columns: 1fr; }
    .gmail-info-grid  { grid-template-columns: repeat(2, 1fr); }
    .current-plan-wrap { grid-template-columns: 1fr; }
    .footer-top       { grid-template-columns: 1fr 1fr; }
}

/* ── MOBILE (max 768px) ── */
@media (max-width: 768px) {

    /* Show hamburger, hide on desktop */
    .hamburger-btn { display: flex; }
    .sb-close-btn  { display: flex; }

    /* Sidebar slides in from left */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 200;
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    }
    .sidebar.sb-open { transform: translateX(0); }

    /* Main content full width on mobile */
    .main-content {
        margin-left: 0;
        padding: 70px 16px 24px;
    }

    /* Topbar full width */
    .topbar {
        left: 0;
        padding: 0 16px;
    }
    .topbar-left { gap: 0; }

    /* Hide topbar subtitle on mobile */
    .topbar-sub { display: none; }

    /* Hide plan badge on small screens */
    .plan-badge { display: none; }

    /* Stats grid — 2 columns on mobile */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    /* Two col grid → single col */
    .two-col-grid       { grid-template-columns: 1fr; }
    .plans-grid         { grid-template-columns: 1fr; }
    .profile-grid       { grid-template-columns: 1fr; }
    .landing-plans-grid { grid-template-columns: 1fr; }
    .testimonials-grid  { grid-template-columns: 1fr; }

    /* Current plan wrap → single col */
    .current-plan-wrap { grid-template-columns: 1fr; }

    /* Gmail info grid → 2 col */
    .gmail-info-grid { grid-template-columns: repeat(2, 1fr); }

    /* Page header stacks on mobile */
    .page-header.d-flex-between {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    /* Card heading row wraps */
    .card-header-row { flex-wrap: wrap; gap: 8px; }

    /* Filter bar stacks */
    .filter-bar  { flex-direction: column; align-items: flex-start; }
    .filter-right { flex-wrap: wrap; width: 100%; }
    .filter-right .saas-input { flex: 1; min-width: 120px; }

    /* Saas card padding reduced */
    .saas-card { padding: 14px; }

    /* Modal full width */
    .modal-box { padding: 20px; max-width: 100%; }

    /* Admin users table — hide some columns */
    .saas-table th:nth-child(4),
    .saas-table td:nth-child(4) { display: none; }

    /* Settings grid */
    .settings-plan-box { padding: 12px; }

    /* Footer stacks */
    .footer-top    { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; text-align: center; }

    /* Hero on mobile */
    .hero-title    { font-size: 32px; letter-spacing: -1px; }
    .hero-actions  { flex-direction: column; }
    .hero-subtitle { font-size: 15px; }
    .section-title { font-size: 24px; }

    /* Nav links hide on mobile (landing) */
    .nav-links { display: none; }

    /* HIW timeline stacks */
    .hiw-timeline  { flex-direction: column; align-items: center; }
    .hiw-connector { padding-top: 0; transform: rotate(90deg); }

    /* Preview mockup stacks */
    .hero-preview-body { flex-direction: column; }
    .mock-sidebar {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 8px;
        gap: 4px;
    }
    .mock-stat-row { grid-template-columns: repeat(2, 1fr); }

    /* Pagination */
    .pagination-wrap { flex-direction: column; gap: 10px; }

    /* Profile quick stats */
    .profile-quick-stats { gap: 0; }

    /* CTA section */
    .cta-title   { font-size: 24px; }
    .cta-actions { flex-direction: column; }

    /* Topbar title smaller */
    .topbar-title { font-size: 14px; }
}

/* ── SMALL MOBILE (max 480px) ── */
@media (max-width: 480px) {

    /* Stats grid → single col on very small */
    .stats-grid { grid-template-columns: 1fr; }

    /* Page header btn full width */
    .page-header.d-flex-between .btn-brand { width: 100%; justify-content: center; }

    /* Gmail steps stack */
    .gmail-steps      { flex-direction: column; align-items: center; }
    .gmail-step-arrow { transform: rotate(90deg); }

    /* Features grid */
    .features-grid      { grid-template-columns: 1fr; }
    .feature-card-large { grid-column: span 1; }

    /* Feature visual stacks */
    .feature-visual { flex-direction: column; }

    /* Hero proof wraps */
    .hero-proof { flex-wrap: wrap; justify-content: center; }

    /* Billing toggle wraps */
    .billing-toggle { flex-wrap: wrap; }

    /* Plan section header stacks */
    .plan-section-header { flex-direction: column; align-items: flex-start; }

    /* Quick actions text truncate */
    .qa-sub { display: none; }

    /* Topbar right — hide notification on very small */
    .notif-btn:first-of-type { display: none; }
}