/* ============================================================
   ZonaWise Design System
   Modern light theme • Inter font • Glassmorphism
   ============================================================ */

/* ---- CSS Reset & Variables ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Colors */
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --primary-50: #eef2ff;
    --primary-100: #e0e7ff;
    --accent: #8b5cf6;

    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;

    /* Neutrals */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Layout */
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.15);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--gray-700);
    background: var(--gray-50);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ============================================================
   AUTH PAGES
   ============================================================ */

.auth-body {
    background: var(--gray-900);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Animated Background */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.auth-bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: orbFloat 20s ease-in-out infinite;
}

.auth-bg-orb--1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.auth-bg-orb--2 {
    width: 350px;
    height: 350px;
    background: var(--accent);
    bottom: -100px;
    right: -100px;
    animation-delay: -7s;
}

.auth-bg-orb--3 {
    width: 250px;
    height: 250px;
    background: #06b6d4;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -40px) scale(1.1);
    }

    50% {
        transform: translate(-20px, 30px) scale(0.95);
    }

    75% {
        transform: translate(40px, 20px) scale(1.05);
    }
}

.auth-bg-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

.auth-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 24px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    box-shadow: var(--shadow-xl);
    animation: cardFadeIn 0.6s ease;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }

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

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
}

.auth-logo-text {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 4px;
}

.auth-subtitle {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    margin-bottom: 28px;
    font-size: 13px;
}

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

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.form-label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.form-icon {
    position: absolute;
    left: 14px;
    color: var(--gray-400);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.form-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all var(--transition-base);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.form-input-wrap:focus-within .form-icon {
    color: var(--primary-light);
}

.toggle-password {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    transition: color var(--transition-fast);
}

.toggle-password:hover {
    color: var(--primary-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: all var(--transition-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.btn--primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
}

.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

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

.btn--full {
    width: 100%;
}

.btn--sm {
    padding: 8px 16px;
    font-size: 13px;
}

.auth-alt {
    text-align: center;
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
}

.auth-link {
    color: var(--primary-light);
    font-weight: 500;
}

.auth-link:hover {
    color: #fff;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.2);
    font-size: 12px;
}

/* ============================================================
   ALERTS
   ============================================================ */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    margin-bottom: 16px;
    animation: alertSlide 0.3s ease;
    line-height: 1.5;
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

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

.alert svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.alert--error {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert--success {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Dashboard alert styles (light theme) */
.dashboard-body .alert--error {
    background: var(--danger-light);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.15);
}

.dashboard-body .alert--success {
    background: var(--success-light);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.15);
}

.alert--dismissible {
    position: relative;
    padding-right: 36px;
}

.alert-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

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

/* ============================================================
   DASHBOARD LAYOUT
   ============================================================ */

.dashboard-body {
    display: flex;
    min-height: 100vh;
    background: var(--gray-50);
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: #fff;
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-slow);
}

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

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.sidebar-section-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gray-400);
    padding: 16px 12px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    font-size: 13.5px;
    font-weight: 450;
    transition: all var(--transition-fast);
    position: relative;
}

.sidebar-link:hover {
    background: var(--gray-50);
    color: var(--gray-800);
}

.sidebar-link.active {
    background: var(--primary-50);
    color: var(--primary);
    font-weight: 500;
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    bottom: 6px;
    width: 3px;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-link.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
}

.sidebar-link svg {
    flex-shrink: 0;
}

.badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge--soon {
    background: var(--gray-100);
    color: var(--gray-400);
    margin-left: auto;
}

.badge--green {
    background: var(--success-light);
    color: #059669;
}

.badge--red {
    background: var(--danger-light);
    color: var(--danger);
}

.badge--blue {
    background: var(--info-light);
    color: var(--info);
}

.badge--purple {
    background: #f3e8ff;
    color: #7c3aed;
}

.badge--orange {
    background: #fff7ed;
    color: #ea580c;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

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

.sidebar-username {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-800);
}

.sidebar-role {
    font-size: 11px;
    color: var(--gray-400);
}

.sidebar-logout {
    color: var(--gray-400);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.sidebar-logout:hover {
    color: var(--danger);
    background: var(--danger-light);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Bar */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

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

.topbar-menu {
    display: none;
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    padding: 6px;
}

.topbar-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.topbar-date {
    font-size: 13px;
    color: var(--gray-400);
    font-weight: 450;
}

.topbar-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gray-500);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot--loading {
    background: var(--warning);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-dot--online {
    background: var(--success);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.status-dot--error {
    background: var(--danger);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 32px 36px;
    width: 100%;
}

/* ============================================================
   STATS CARDS (Server Health)
   ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.stat-card--cpu::before {
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.stat-card--memory::before {
    background: linear-gradient(90deg, var(--success), #34d399);
}

.stat-card--disk::before {
    background: linear-gradient(90deg, var(--warning), #fbbf24);
}

.stat-card--uptime::before {
    background: linear-gradient(90deg, var(--info), #60a5fa);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gray-500);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.stat-card-bar {
    width: 100%;
    height: 4px;
    background: var(--gray-100);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.stat-card-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
}

.stat-card--cpu .stat-card-bar-fill {
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.stat-card--memory .stat-card-bar-fill {
    background: linear-gradient(90deg, var(--success), #34d399);
}

.stat-card--disk .stat-card-bar-fill {
    background: linear-gradient(90deg, var(--warning), #fbbf24);
}

.stat-card-sub {
    font-size: 12px;
    color: var(--gray-400);
}

/* ============================================================
   QUICK STATS
   ============================================================ */

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

.quick-stat {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-base);
}

.quick-stat:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.quick-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.quick-stat-icon--users {
    background: var(--primary-50);
    color: var(--primary);
}

.quick-stat-icon--codes {
    background: #faf5ff;
    color: var(--accent);
}

.quick-stat-icon--total {
    background: var(--info-light);
    color: var(--info);
}

.quick-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

.quick-stat-label {
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 450;
}

/* ============================================================
   SECTION TITLE
   ============================================================ */

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.meta-count {
    font-size: 12px;
    color: var(--gray-400);
    font-weight: 450;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================================
   LIGHT-THEME FORM ELEMENTS
   ============================================================ */

.form-label-light {
    font-size: 12px;
    font-weight: 500;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-input-light {
    width: 100%;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    color: var(--gray-800);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: all var(--transition-base);
}

.form-input-light::placeholder {
    color: var(--gray-300);
}

.form-input-light:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-select-light {
    width: 100%;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    color: var(--gray-800);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: all var(--transition-base);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4.5L6 7.5L9 4.5' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-select-light:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.form-actions {
    display: flex;
    gap: 10px;
}

/* Create User Panel */
.create-user-panel {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    animation: slideDown 0.3s ease;
}

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

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

.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 20px;
}

/* Utility */
.text-danger {
    color: var(--danger) !important;
}

.text-muted-soft {
    color: var(--gray-300);
}

.btn--ghost {
    background: transparent;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn--ghost:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

/* ============================================================
   TOOL CARDS
   ============================================================ */

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.tool-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
}

.tool-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--gray-300);
}

.tool-card-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.tool-card-icon--mail {
    background: #fef3c7;
    color: var(--warning);
}

.tool-card-icon--domain {
    background: var(--success-light);
    color: var(--success);
}

.tool-card-icon--trade {
    background: var(--primary-50);
    color: var(--primary);
}

.tool-card-icon--add {
    background: var(--gray-100);
    color: var(--gray-400);
}

.tool-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 6px;
}

.tool-card-desc {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.5;
    margin-bottom: 16px;
}

.tool-card-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--gray-100);
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tool-card-badge--soon {
    background: var(--gray-100);
    color: var(--gray-400);
}

.tool-card-glow {
    position: absolute;
    bottom: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.tool-card:hover .tool-card-glow {
    opacity: 0.07;
}

.tool-card-icon--mail+.tool-card-title~.tool-card-desc~.tool-card-badge~.tool-card-glow {
    background: var(--warning);
}

.tool-card-icon--domain+.tool-card-title~.tool-card-desc~.tool-card-badge~.tool-card-glow {
    background: var(--success);
}

.tool-card-icon--trade+.tool-card-title~.tool-card-desc~.tool-card-badge~.tool-card-glow {
    background: var(--primary);
}

/* ============================================================
   DATA TABLES
   ============================================================ */

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 16px;
}

.search-wrap {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 13px;
    color: var(--gray-700);
    outline: none;
    transition: all var(--transition-base);
}

.search-input::placeholder {
    color: var(--gray-400);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.table-container {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

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

.data-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-400);
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    background: var(--gray-50);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr {
    transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
    background: var(--gray-50);
}

.text-muted {
    color: var(--gray-400);
}

/* User cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}

.user-name {
    font-weight: 500;
    color: var(--gray-800);
}

/* Code cell */
.code-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.invite-code-text {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    background: var(--gray-50);
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--gray-700);
    letter-spacing: 0.05em;
}

.btn-copy {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.btn-copy:hover {
    color: var(--primary);
    background: var(--primary-50);
}

/* Action buttons */
.action-group {
    display: flex;
    gap: 6px;
}

.inline-form {
    display: inline;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon--danger {
    background: var(--gray-50);
    color: var(--gray-400);
}

.btn-icon--danger:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.btn-icon--warn {
    background: var(--gray-50);
    color: var(--gray-400);
}

.btn-icon--warn:hover {
    background: var(--warning-light);
    color: var(--warning);
}

.btn-icon--success {
    background: var(--gray-50);
    color: var(--gray-400);
}

.btn-icon--success:hover {
    background: var(--success-light);
    color: var(--success);
}

.btn-icon--info {
    background: var(--gray-50);
    color: var(--gray-400);
}

.btn-icon--info:hover {
    background: var(--info-light);
    color: var(--info);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-400);
}

.empty-state svg {
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
}

/* ============================================================
   INVITE GENERATOR
   ============================================================ */

.invite-generator {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.invite-form-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.invite-generator .form-label {
    color: var(--gray-500);
}

.invite-generator .form-select {
    background: var(--gray-50);
    color: var(--gray-700);
    border-color: var(--gray-200);
}

.invite-generator .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.invite-generator .form-input {
    background: var(--gray-50);
    color: var(--gray-700);
    border-color: var(--gray-200);
    padding-left: 14px;
}

.invite-generator .form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ============================================================
   SETTINGS TABS
   ============================================================ */

.settings-tabs {
    display: flex;
    gap: 4px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 24px;
    width: fit-content;
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.settings-tab:hover {
    color: var(--gray-700);
    background: rgba(255, 255, 255, 0.6);
}

.settings-tab.active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ============================================================
   SETTINGS CARDS & PANELS
   ============================================================ */

.settings-panel {
    animation: fadeInUp 0.3s ease;
}

.settings-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 20px;
}

.settings-card-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-100);
}

.settings-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.settings-card-desc {
    font-size: 13px;
    color: var(--gray-500);
    line-height: 1.5;
}

.settings-form-group {
    margin-bottom: 20px;
}

.settings-row {
    display: flex;
    gap: 24px;
}

.settings-save {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

/* Light form inputs */
.form-textarea-light {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    color: var(--gray-700);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    transition: all var(--transition-fast);
}

.form-textarea-light:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    background: #fff;
}

.form-select-light {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    background: var(--gray-50);
    color: var(--gray-700);
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.form-select-light:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ============================================================
   TOGGLE SWITCHES
   ============================================================ */

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    background: var(--gray-300);
    border-radius: 12px;
    position: relative;
    transition: background 0.25s ease;
    flex-shrink: 0;
}

.toggle-slider::after {
    content: '';
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--primary);
}

.toggle-switch input:checked+.toggle-slider::after {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 14px;
    color: var(--gray-700);
    font-weight: 500;
}

/* Toggle rows (Platform tab) */
.settings-toggles {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.settings-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-100);
}

.settings-toggle-row:last-child {
    border-bottom: none;
}

.settings-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.settings-toggle-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-800);
}

.settings-toggle-desc {
    font-size: 12px;
    color: var(--gray-500);
}

/* ============================================================
   BROADCAST TYPE SELECTOR
   ============================================================ */

.broadcast-types {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.broadcast-type-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.broadcast-type-option input {
    display: none;
}

.broadcast-type-option:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

.broadcast-type-option.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.04);
}

.broadcast-type-icon {
    font-size: 24px;
    line-height: 1;
}

.broadcast-type-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-700);
}

.broadcast-type-desc {
    font-size: 10px;
    color: var(--gray-500);
}

/* ============================================================
   BROADCAST BANNER (Dashboard)
   ============================================================ */

.broadcast-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    animation: fadeInUp 0.3s ease;
    position: relative;
}

.broadcast-banner-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.broadcast-banner-text {
    flex: 1;
    line-height: 1.5;
}

.broadcast-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 4px;
    transition: opacity 0.2s;
}

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

.broadcast-banner--info {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.broadcast-banner--info .broadcast-close {
    color: #1e40af;
}

.broadcast-banner--success {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #166534;
    border: 1px solid #86efac;
}

.broadcast-banner--success .broadcast-close {
    color: #166534;
}

.broadcast-banner--warning {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.broadcast-banner--warning .broadcast-close {
    color: #92400e;
}

.broadcast-banner--critical {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    color: #991b1b;
    border: 1px solid #fca5a5;
    animation: criticalPulse 3s ease-in-out infinite;
}

.broadcast-banner--critical .broadcast-close {
    color: #991b1b;
}

@keyframes criticalPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }

    50% {
        box-shadow: 0 0 16px rgba(239, 68, 68, 0.15);
    }
}

/* Preview in settings */
.broadcast-preview {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px dashed var(--gray-200);
}

/* ============================================================
   CONFIRM MODAL
   ============================================================ */

.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.confirm-overlay.active {
    display: flex;
}

.confirm-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 32px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
    animation: confirmSlideUp 0.25s ease;
}

@keyframes confirmSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }

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

.confirm-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fef2f2;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.confirm-message {
    font-size: 14px;
    color: var(--gray-500);
    line-height: 1.5;
    margin-bottom: 24px;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn--danger {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.btn--danger:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ============================================================
   PAGE SECTION
   ============================================================ */

.page-section {
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-xl);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: block;
    }

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

    .topbar-menu {
        display: block;
    }

    .topbar-date {
        display: none;
    }

    .page-content {
        padding: 20px 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .quick-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
    }

    .invite-form-row {
        flex-direction: column;
        align-items: stretch;
    }

    /* Mobile overlay */
    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 99;
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-base);
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 28px 20px;
    }

    .action-group {
        flex-direction: column;
    }
}

/* ============================================================
   ANIMATIONS & UTILITIES
   ============================================================ */

/* Entrance animations for dashboard cards */
.stat-card,
.quick-stat,
.tool-card {
    animation: fadeInUp 0.5s ease backwards;
}

.stat-card:nth-child(1) {
    animation-delay: 0.05s;
}

.stat-card:nth-child(2) {
    animation-delay: 0.1s;
}

.stat-card:nth-child(3) {
    animation-delay: 0.15s;
}

.stat-card:nth-child(4) {
    animation-delay: 0.2s;
}

.quick-stat:nth-child(1) {
    animation-delay: 0.25s;
}

.quick-stat:nth-child(2) {
    animation-delay: 0.3s;
}

.quick-stat:nth-child(3) {
    animation-delay: 0.35s;
}

.tool-card:nth-child(1) {
    animation-delay: 0.4s;
}

.tool-card:nth-child(2) {
    animation-delay: 0.45s;
}

.tool-card:nth-child(3) {
    animation-delay: 0.5s;
}

.tool-card:nth-child(4) {
    animation-delay: 0.55s;
}

/* Toast notification for copy */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--gray-900);
    color: #fff;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2s forwards;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.95);
    }

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

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(16px);
    }
}

/* ============================================================
   MAILING TOOL — mt-* DESIGN SYSTEM
   ============================================================ */

/* Page */
.mt-page {
    padding: 0;
}

.mt-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.mt-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mt-logo {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    border-radius: 12px;
    color: #fff;
}

.mt-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.mt-subtitle {
    font-size: 13px;
    color: var(--gray-500);
    margin: 0;
}

.mt-content {
    animation: mtFadeIn 0.3s ease;
}

@keyframes mtFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Navigation */
.mt-nav {
    display: flex;
    gap: 2px;
    background: var(--gray-100);
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.mt-nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.mt-nav-item:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.6);
}

.mt-nav-item.active {
    color: var(--primary);
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    font-weight: 600;
}

/* Shortcuts */
.mt-shortcuts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.mt-shortcut {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}

.mt-shortcut:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.mt-shortcut-ico {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mt-shortcut--purple {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #6366f1;
}

.mt-shortcut--green {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #16a34a;
}

.mt-shortcut--blue {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #2563eb;
}

.mt-shortcut--amber {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #d97706;
}

.mt-shortcut div:last-child {
    display: flex;
    flex-direction: column;
}

.mt-shortcut strong {
    font-size: 13px;
    font-weight: 600;
}

.mt-shortcut span {
    font-size: 11px;
    color: var(--gray-500);
}

/* Stats */
.mt-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.mt-stat {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.mt-stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.mt-stat--sent::before {
    background: linear-gradient(90deg, #6366f1, #818cf8);
}

.mt-stat--failed::before {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.mt-stat--opened::before {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.mt-stat--count::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.mt-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}

.mt-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
}

.mt-stat-bar {
    height: 3px;
    background: var(--gray-100);
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}

.mt-stat--sent .mt-stat-bar>div {
    background: #6366f1;
    height: 100%;
    border-radius: 2px;
}

.mt-stat--failed .mt-stat-bar>div {
    background: #ef4444;
    height: 100%;
    border-radius: 2px;
}

.mt-stat--opened .mt-stat-bar>div {
    background: #10b981;
    height: 100%;
    border-radius: 2px;
}

.mt-stat--count .mt-stat-bar>div {
    background: #f59e0b;
    height: 100%;
    border-radius: 2px;
}

/* Health */
.mt-health {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.mt-health-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}

.mt-health-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.mt-health-sub {
    font-size: 11px;
    color: var(--gray-500);
}

/* Card */
.mt-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 14px;
}

.mt-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 14px;
}

.mt-card-head h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin: 0;
}

.mt-card-head p {
    margin: 0;
}

.mt-card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px;
}

/* Form Elements */
.mt-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-bottom: 6px;
}

.mt-input {
    width: 100%;
    padding: 9px 12px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
    transition: border-color 0.2s;
}

.mt-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.mt-input--sm {
    width: 140px;
    padding: 6px 10px;
    font-size: 12px;
}

.mt-select {
    width: 100%;
    padding: 9px 12px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
}

.mt-textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 13px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    line-height: 1.6;
    resize: vertical;
    color: var(--text);
}

.mt-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
}

.mt-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin: 0;
}

.mt-hint code {
    background: var(--gray-100);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
    color: var(--primary);
}

.mt-hint a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.mt-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.mt-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 12px;
}

.mt-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

/* Buttons */
.mt-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.mt-btn--primary {
    background: var(--primary);
    color: #fff;
}

.mt-btn--primary:hover {
    background: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.mt-btn--outline {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--text);
}

.mt-btn--outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.mt-btn--outline-danger {
    background: transparent;
    border: 1px solid #fca5a5;
    color: #ef4444;
}

.mt-btn--outline-danger:hover {
    background: #fef2f2;
}

.mt-btn--sm {
    padding: 5px 12px;
    font-size: 12px;
}

.mt-btn--full {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
}

.mt-btn-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

/* Icon Button */
.mt-icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--gray-500);
}

.mt-icon-btn:hover {
    background: var(--gray-50);
}

.mt-icon-btn--danger {
    color: #ef4444;
    border-color: #fca5a5;
}

.mt-icon-btn--danger:hover {
    background: #fef2f2;
}

/* Badge */
.mt-badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.mt-badge--green {
    background: #dcfce7;
    color: #15803d;
}

.mt-badge--red {
    background: #fee2e2;
    color: #dc2626;
}

.mt-badge--blue {
    background: #dbeafe;
    color: #2563eb;
}

.mt-badge--yellow {
    background: #fef3c7;
    color: #d97706;
}

.mt-badge--orange {
    background: #ffedd5;
    color: #ea580c;
}

/* Table */
.mt-table-wrap {
    overflow-x: auto;
}

.mt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mt-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    border-bottom: 1px solid var(--gray-200);
}

.mt-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--text);
}

.mt-table tr:last-child td {
    border-bottom: none;
}

.mt-muted {
    color: var(--gray-500);
}

/* Mini Progress Bar */
.mt-mini-bar {
    width: 60px;
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    overflow: hidden;
    display: inline-block;
    vertical-align: middle;
}

.mt-mini-bar>div {
    height: 100%;
    background: #6366f1;
    border-radius: 2px;
}

.mt-mini-text {
    font-size: 11px;
    color: var(--gray-500);
    margin-left: 6px;
}

/* Campaign Progress */
.mt-progress-card {
    border-left: 3px solid #6366f1 !important;
}

.mt-progress-wrap {
    height: 6px;
    background: var(--gray-100);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.mt-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    border-radius: 3px;
    transition: width 0.5s;
}

.mt-progress-info {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--gray-500);
}

.mt-progress-info strong {
    color: var(--text);
}

/* Activity Log */
.mt-live {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #10b981;
}

.mt-live::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    animation: mtPulse 2s infinite;
}

@keyframes mtPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

.mt-log {
    max-height: 260px;
    overflow-y: auto;
}

.mt-log-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 13px;
}

.mt-log-row:last-child {
    border-bottom: none;
}

.mt-log-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mt-log--sent .mt-log-dot {
    background: #6366f1;
}

.mt-log--opened .mt-log-dot {
    background: #10b981;
}

.mt-log--failed .mt-log-dot {
    background: #ef4444;
}

.mt-log-email {
    flex: 1;
    font-weight: 500;
    color: var(--text);
}

.mt-log-err {
    cursor: help;
    flex-shrink: 0;
}

.mt-log-time {
    font-size: 11px;
    color: var(--gray-400);
    font-family: monospace;
}

.mt-empty {
    padding: 24px;
    text-align: center;
    color: var(--gray-400);
    font-size: 13px;
}

/* Compose */
.mt-compose {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 14px;
}

.mt-compose-main {
    min-width: 0;
}

.mt-compose-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Toggle */
.mt-toggle {
    display: inline-flex;
    gap: 2px;
    background: var(--gray-100);
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 10px;
}

.mt-toggle-btn {
    display: flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--gray-500);
    transition: all 0.2s;
}

.mt-toggle-btn input {
    display: none;
}

.mt-toggle-btn.active {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Toolbar */
.mt-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px 8px 0 0;
}

.mt-tb {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border: none;
    background: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    color: var(--gray-600);
    transition: all 0.15s;
}

.mt-tb:hover {
    background: var(--gray-200);
    color: var(--text);
}

.mt-tb--var {
    font-family: monospace;
    font-size: 11px;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
}

.mt-tb-div {
    width: 1px;
    height: 20px;
    background: var(--gray-200);
    margin: 4px 4px;
    align-self: center;
}

/* Editor */
.mt-editor {
    min-height: 300px;
    padding: 16px;
    border: 1px solid var(--gray-200);
    border-top: none;
    border-radius: 0 0 8px 8px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text);
    outline: none;
}

.mt-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--gray-400);
}

.mt-editor-text {
    width: 100%;
    min-height: 300px;
    padding: 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 13px;
    font-family: monospace;
    line-height: 1.6;
    color: var(--text);
    resize: vertical;
}

.mt-editor-text:focus {
    outline: none;
    border-color: var(--primary);
}

/* Dropzone */
.mt-dropzone {
    border: 2px dashed var(--gray-300);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--gray-400);
}

.mt-dropzone:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.02);
}

.mt-dropzone p {
    margin: 6px 0 2px;
    font-size: 13px;
    color: var(--gray-500);
}

.mt-dropzone span {
    font-size: 11px;
    color: var(--gray-400);
}

/* Template preview */
.mt-tpl-preview {
    margin-top: 8px;
    padding: 8px;
    background: var(--gray-50);
    border-radius: 6px;
    font-size: 12px;
    color: var(--gray-600);
}

/* SMTP Grid */
.mt-smtp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
}

.mt-smtp-card {
    padding: 16px;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--white);
}

.mt-smtp--inactive {
    opacity: 0.6;
}

.mt-smtp-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.mt-smtp-top strong {
    font-size: 14px;
}

.mt-smtp-email {
    font-size: 13px;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.mt-smtp-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-100);
}

.mt-smtp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

/* Import Tabs */
.mt-import-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gray-200);
    margin: 14px 0 0;
}

.mt-import-tab {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 9px 18px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
    transition: all 0.2s;
}

.mt-import-tab:hover {
    color: var(--primary);
}

.mt-import-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.mt-import-panel {
    padding: 18px 0 0;
}

/* Hints */
.mt-hints {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 14px 0;
    padding: 12px 14px;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.mt-hint-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--gray-600);
}

.mt-hint-row code {
    background: var(--white);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 11px;
    color: var(--primary);
    border: 1px solid var(--gray-200);
}

/* Charts */
.mt-charts {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

.mt-chart-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 14px;
}

.mt-chart-card h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 12px;
}

.mt-chart--small {
    max-height: 320px;
}

.mt-chart--wide {
    min-height: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .mt-shortcuts {
        grid-template-columns: repeat(2, 1fr);
    }

    .mt-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .mt-health {
        grid-template-columns: repeat(2, 1fr);
    }

    .mt-compose {
        grid-template-columns: 1fr;
    }

    .mt-charts {
        grid-template-columns: 1fr;
    }

    .mt-grid-2 {
        grid-template-columns: 1fr;
    }

    .mt-row-3 {
        grid-template-columns: 1fr;
    }

    .mt-smtp-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 550px) {
    .mt-shortcuts {
        grid-template-columns: 1fr;
    }

    .mt-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .mt-health {
        grid-template-columns: 1fr;
    }

    .mt-nav {
        gap: 0;
    }

    .mt-nav-item {
        padding: 8px 10px;
        font-size: 12px;
    }
}

