:root {
    --bg-main: #0b0f19;
    --bg-secondary: #111827;
    --bg-surface: #172033;
    --bg-surface-hover: #1e293b;
    --bg-card: #141d2f;
    --border-color: #243049;
    --border-subtle: #1e293b;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent: #38bdf8;
    --accent-hover: #0ea5e9;
    --accent-glow: rgba(56, 189, 248, 0.15);
    
    --brand-gradient: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
    --otp-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px;

    --shadow-subtle: 0 4px 20px rgba(0, 0, 0, 0.25);
    --shadow-pop: 0 10px 30px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    font-size: 13.5px;
    line-height: 1.5;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* App Wrapper */
.app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Top Navigation Bar */
.top-nav {
    height: 54px;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 50;
    gap: 14px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-tag {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.brand-tag-icon {
    font-size: 15px;
    color: var(--accent);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.admin-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.walamail-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 11.5px;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.walamail-chip:hover {
    border-color: var(--accent);
    background: var(--bg-surface-hover);
    box-shadow: 0 0 10px var(--accent-glow);
}

.chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
}

.chip-balance {
    font-weight: 700;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}

.chip-btn {
    font-size: 10.5px;
    color: var(--text-muted);
}

.user-profile-widget {
    display: flex;
    align-items: center;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 12px;
}

.user-pill .avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--accent);
}

.user-pill .user-name {
    font-weight: 600;
    color: var(--text-primary);
}

.user-pill .admin-badge {
    font-size: 9px;
    font-weight: 700;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 1px 5px;
    border-radius: 3px;
    letter-spacing: 0.04em;
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 12px;
    margin-left: 2px;
    transition: color 0.15s ease;
}

.btn-logout:hover {
    color: var(--danger);
}

/* Proxy Header Badge */
.proxy-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: var(--success);
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}

.proxy-badge:hover {
    background: rgba(16, 185, 129, 0.2);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.proxy-badge.disabled {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.25);
    color: var(--text-muted);
}

/* Proxy Settings Card */
.proxy-settings-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.proxy-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.proxy-title-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
}

.proxy-info-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    color: var(--text-secondary);
}

.proxy-info-line code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10.5px;
    color: var(--accent);
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    transition: .2s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: #fff;
    transition: .2s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--success);
    border-color: var(--success);
}

input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

/* Order Sync Box */
.order-sync-box {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 14px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
}

.order-sync-box h4 {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12.5px;
    font-weight: 500;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 11.5px;
}

.btn-lg {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
}

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-main);
    border-color: var(--text-primary);
}

.btn-primary:hover {
    background: #e2e8f0;
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
    border-color: var(--text-muted);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

.btn-accent {
    background: var(--brand-gradient);
    color: #fff;
    border: none;
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
}

.btn-accent:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-icon:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}

.btn-icon-sm {
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-icon-sm:hover {
    color: var(--text-primary);
    background: var(--bg-surface);
    border-color: var(--border-color);
}

.btn:disabled, .btn-icon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* 3-Column Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 310px 380px 1fr;
    height: calc(100vh - 54px);
    overflow: hidden;
}

/* Column 1: Accounts Sidebar */
.sidebar-accounts {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-btns {
    display: flex;
    gap: 4px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 10px;
    color: var(--text-muted);
    font-size: 12px;
}

.search-box input {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 10px 6px 30px;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    transition: border-color 0.15s ease;
}

.search-box input:focus {
    border-color: var(--accent);
}

.search-box.sm input {
    padding: 4px 8px 4px 28px;
    font-size: 11.5px;
}

.accounts-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Account Card Item */
.account-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.account-card:hover {
    background: var(--bg-surface);
    border-color: var(--border-subtle);
}

.account-card.active {
    background: var(--bg-surface-hover);
    border-color: var(--accent);
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.1);
}

.acc-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--accent);
    flex-shrink: 0;
}

.acc-avatar.hotmail {
    color: #0078d4;
}

.acc-avatar.outlook {
    color: #00a4ef;
}

.btn-icon-xs {
    width: 20px;
    height: 20px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-muted);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10.5px;
    transition: all 0.15s ease;
}

.btn-icon-xs:hover {
    color: var(--accent);
    background: var(--bg-surface-hover);
}

.acc-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.acc-title-name {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.acc-title-email {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.acc-subline {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.account-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.account-email-sub {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.acc-status-tag {
    font-size: 10px;
    padding: 0 4px;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}
.status-expired {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}
.status-no_token {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}
.status-unknown {
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-muted);
}

.acc-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    align-items: center;
    gap: 3px;
    background: var(--bg-surface);
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 5;
}

.account-card:hover .acc-actions {
    display: flex;
}

/* Column 2: Messages List Pane */
.messages-pane {
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pane-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-secondary);
}

.active-account-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.account-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.domain-icon {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 12px;
}

.account-details h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

.account-status-pill {
    font-size: 10px;
    color: var(--text-muted);
}

.account-actions {
    display: flex;
    gap: 6px;
}

.folders-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.folder-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.folder-tab:hover {
    color: var(--text-primary);
    background: var(--bg-surface-hover);
}

.folder-tab.active {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: rgba(56, 189, 248, 0.4);
}

.folder-badge {
    background: var(--accent);
    color: #000;
    font-size: 9.5px;
    font-weight: 700;
    padding: 0 5px;
    border-radius: var(--radius-full);
}

.messages-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.auto-refresh-control {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.auto-refresh-control select {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    outline: none;
}

.messages-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Message Card Item */
.message-card {
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.message-card:hover {
    background: var(--bg-surface);
    border-color: var(--border-color);
}

.message-card.active {
    background: var(--bg-surface-hover);
    border-color: var(--accent);
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.1);
}

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

.message-card.is-pinned {
    background: rgba(56, 189, 248, 0.05);
    border-color: rgba(56, 189, 248, 0.35);
}

.message-card.is-pinned.unread {
    border-left: 3px solid #fbbf24;
}

.pinned-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9.5px;
    font-weight: 700;
    color: var(--accent);
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 1px 5px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.btn-pin {
    opacity: 0.45;
    transition: all 0.15s ease;
    font-size: 11px;
}

.message-card:hover .btn-pin {
    opacity: 0.9;
}

.btn-pin.active {
    opacity: 1;
    color: #fbbf24;
    transform: rotate(-35deg);
}

.btn-pin:hover {
    opacity: 1;
    color: var(--accent);
}

.msg-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3px;
}

.msg-from {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.msg-date {
    font-size: 10.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

.msg-subject {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.message-card.unread .msg-subject {
    color: var(--text-primary);
    font-weight: 600;
}

.msg-preview {
    font-size: 11px;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

/* Quick OTP Chip on Message Card */
.msg-otp-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: var(--success);
    font-size: 11px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

/* Column 3: Email Viewer Pane */
.email-viewer-pane {
    background: var(--bg-main);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.empty-viewer {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.empty-state-card {
    max-width: 420px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--text-muted);
}

.empty-state-card h2 {
    font-size: 18px;
    font-weight: 600;
}

.empty-state-card p {
    font-size: 13px;
    color: var(--text-muted);
}

.quick-tips {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    width: 100%;
}

.tip-item {
    font-size: 11.5px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tip-item i {
    color: var(--accent);
}

/* Email Content View */
.email-content-view {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.email-toolbar {
    height: 48px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
}

.toolbar-left {
    display: flex;
    gap: 6px;
}

.view-mode-toggle {
    display: flex;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    padding: 2px;
    border: 1px solid var(--border-subtle);
}

.btn-mode {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-mode.active {
    background: var(--accent-glow);
    color: var(--accent);
}

/* OTP Banner */
.otp-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(6, 78, 59, 0.25) 100%);
    border-bottom: 1px solid rgba(16, 185, 129, 0.3);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.otp-badge-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--otp-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
    flex-shrink: 0;
}

.otp-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.otp-title {
    font-size: 10px;
    font-weight: 700;
    color: var(--success);
    letter-spacing: 0.05em;
}

.otp-codes-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.otp-chip-card {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
}

.otp-chip-card:hover {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.2);
    transform: translateY(-1px);
}

.otp-chip-card i {
    font-size: 12px;
    color: var(--success);
}

/* Verify Links Banner */
.verify-links-banner {
    background: rgba(56, 189, 248, 0.08);
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.link-label {
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.verify-link-btn {
    background: var(--accent-glow);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--accent);
    padding: 3px 8px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 11.5px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    max-width: 450px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.verify-link-btn:hover {
    background: var(--accent);
    color: #000;
}

/* Email Metadata Header */
.email-header-card {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.email-subject {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 12px;
}

.sender-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sender-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--brand-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

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

.sender-name-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.sender-name-line strong {
    font-size: 13.5px;
    color: var(--text-primary);
}

.sender-email {
    font-size: 11.5px;
    color: var(--text-muted);
}

.recipient-line {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

.email-time-stamp {
    font-size: 11.5px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Attachments */
.attachments-row {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 8px;
}

.att-label {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 600;
}

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

.attachment-chip {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Email Body */
.email-body-wrapper {
    flex: 1;
    overflow-y: auto;
    position: relative;
    background: #ffffff;
}

.email-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
    display: block;
}

.email-text-view {
    padding: 20px;
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    background: #ffffff;
    height: 100%;
    overflow-y: auto;
}

/* ================= MODALS ================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.modal-overlay.show {
    display: flex;
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-pop);
    width: 100%;
    max-width: 540px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card.modal-lg {
    max-width: 780px;
}

.modal-card.modal-md {
    max-width: 600px;
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title-wrap h2 {
    font-size: 16px;
    font-weight: 600;
}

.icon-accent {
    color: var(--accent);
    font-size: 18px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    padding: 0 16px;
    gap: 8px;
}

.modal-tab {
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.modal-tab:hover {
    color: var(--text-primary);
}

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

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 75vh;
}

.modal-desc {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.code-examples {
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 14px;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.6;
}

.code-examples code {
    color: var(--accent);
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-row {
    display: flex;
    gap: 12px;
}

.flex-1 {
    flex: 1;
}

.w-full {
    width: 100%;
}

.form-input, .form-textarea {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 12.5px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s ease;
}

.form-textarea {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    resize: vertical;
}

.form-input:focus, .form-textarea:focus {
    border-color: var(--accent);
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.form-hint a {
    color: var(--accent);
    text-decoration: none;
}

.input-with-btn {
    display: flex;
    gap: 6px;
}

.input-with-btn input {
    flex: 1;
}

/* WalaMail Banner in Modal */
.walamail-status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    gap: 10px;
}

.status-box {
    display: flex;
    flex-direction: column;
}

.status-title {
    font-size: 10.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
}

.status-number {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

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

/* Domain Radio Cards */
.domain-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.radio-card {
    position: relative;
    cursor: pointer;
}

.radio-card input {
    position: absolute;
    opacity: 0;
}

.radio-card .card-content {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 12px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    transition: all 0.15s ease;
}

.radio-card input:checked + .card-content {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.radio-card .card-content i {
    font-size: 20px;
    color: var(--accent);
    margin-bottom: 4px;
}

.radio-card .card-content strong {
    font-size: 12.5px;
}

.radio-card .card-content span {
    font-size: 10.5px;
    color: var(--text-muted);
}

/* Cost Summary */
.cost-summary-card {
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
}

.modal-actions-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.danger-zone {
    margin-top: 20px;
    padding: 14px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.05);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.danger-zone h4 {
    color: var(--danger);
    font-size: 13px;
}

.danger-zone p {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

/* Catalog Grid */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.catalog-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.catalog-card h4 {
    font-size: 13px;
    font-weight: 600;
}

.catalog-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
}

.catalog-stock {
    font-size: 11.5px;
    color: var(--text-muted);
}

/* Progress bar */
.custom-job-progress {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    padding: 12px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 14px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 8px;
}

.progress-bar-bg {
    height: 6px;
    background: var(--border-color);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 25%;
    background: var(--brand-gradient);
    transition: width 0.3s ease;
    animation: progressAnim 2s infinite ease-in-out;
}

@keyframes progressAnim {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* Orders Table */
.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.orders-table th, .orders-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.orders-table th {
    color: var(--text-muted);
    font-weight: 600;
}

/* Wala tab contents */
.wala-tab-content {
    display: none;
}

.wala-tab-content.active {
    display: block;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 200;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-pop);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 12.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 220px;
}

.toast.toast-success {
    border-left: 3px solid var(--success);
}
.toast.toast-error {
    border-left: 3px solid var(--danger);
}
.toast.toast-info {
    border-left: 3px solid var(--accent);
}

@keyframes toastIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.empty-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
    gap: 10px;
}

.empty-placeholder i {
    font-size: 28px;
    opacity: 0.6;
}

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 30px 10px;
    color: var(--text-muted);
    font-size: 12px;
}

/* Authcord / Multi-Tenant Badges & Notices */
body.public-mode .admin-only {
    display: none !important;
}

.acc-user-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(88, 101, 242, 0.15);
    color: #7289da;
    border: 1px solid rgba(88, 101, 242, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.acc-unassigned-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px dashed var(--border-color);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.authcord-user-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 4px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.authcord-user-widget img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.empty-state-notice {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px 15px;
    gap: 8px;
}

.empty-state-notice h3 {
    font-size: 14px;
    margin: 0;
    color: var(--text-primary);
}

.empty-state-notice p {
    font-size: 12px;
    margin: 0;
    color: var(--text-secondary);
}

/* Authentication Modal & Forms */
.auth-modal-card {
    max-width: 420px;
}

.auth-modal-body {
    padding: 20px 24px 24px;
}

.auth-tabs {
    display: flex;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    gap: 8px;
}

.auth-tab {
    flex: 1;
    padding: 12px 10px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s ease;
}

.auth-tab:hover {
    color: var(--text-primary);
}

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

.auth-form-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-with-icon i.fa-solid {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}

.input-with-icon .form-input {
    width: 100%;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 9px 36px 9px 34px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease;
}

.input-with-icon .form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.btn-toggle-pw {
    position: absolute;
    right: 8px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.btn-toggle-pw:hover {
    color: var(--text-primary);
}

.auth-remember-row {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
}

.remember-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: default;
    user-select: none;
}

.remember-label input[type="checkbox"] {
    display: none;
}

.auth-error-box {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    line-height: 1.4;
}

.btn-block {
    width: 100%;
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 600;
}

.form-hint {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

