/* Standalone SMTP Email Management Web Application - Modern Clean Stylesheet */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --sidebar-bg: #1e293b;
    --sidebar-hover: #334155;
    --sidebar-active: #2563eb;
    --sidebar-text: #94a3b8;
    --sidebar-text-active: #ffffff;
    --body-bg: #f8fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
}

body {
    background-color: var(--body-bg);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
}

/* Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 1000;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.sidebar-brand:hover {
    color: #ffffff;
}

.sidebar-menu {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
    flex-grow: 1;
    overflow-y: auto;
}

.sidebar-heading {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    padding: 0.75rem 1.5rem 0.25rem;
    font-weight: 700;
}

.sidebar-item {
    margin: 0.15rem 0.75rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-link:hover {
    background-color: var(--sidebar-hover);
    color: #ffffff;
}

.sidebar-link.active {
    background-color: var(--sidebar-active);
    color: var(--sidebar-text-active);
}

.sidebar-link .badge {
    margin-left: auto;
    font-size: 0.75rem;
}

/* Main Content */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Header */
.app-header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.content-body {
    padding: 1.75rem;
    flex-grow: 1;
}

/* Cards & Stats */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.stat-card {
    padding: 1.25rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

/* Tables */
.table {
    vertical-align: middle;
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.825rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom-width: 1px;
    background-color: #f8fafc;
}

/* Form controls */
.form-control, .form-select {
    border-radius: 0.5rem;
    border-color: var(--border-color);
    padding: 0.6rem 0.85rem;
    font-size: 0.925rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.btn {
    border-radius: 0.5rem;
    padding: 0.55rem 1rem;
    font-weight: 500;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Tags Badge & Inserters */
.tag-badge {
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s ease;
}

.tag-badge:hover {
    transform: scale(1.05);
}

/* Responsive Mobile Navigation */
@media (max-width: 991.98px) {
    .app-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: -260px;
    }
    
    .app-sidebar.show {
        left: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
}

/* Rich Editor Styling */
.editor-toolbar {
    background-color: #f1f5f9;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 0.5rem 0.5rem 0 0;
    padding: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.editor-btn {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 0.35rem;
    padding: 0.25rem 0.6rem;
    font-size: 0.85rem;
    color: #334155;
    cursor: pointer;
}

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

.editor-canvas {
    min-height: 280px;
    max-height: 550px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 0 0 0.5rem 0.5rem;
    padding: 1rem;
    background: #ffffff;
    outline: none;
}

/* Live Preview Device Frames */
.preview-modal-body {
    background: #f1f5f9;
    padding: 2rem;
    display: flex;
    justify-content: center;
}

.device-desktop {
    width: 100%;
    max-width: 800px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-height: 400px;
    padding: 20px;
}

.device-mobile {
    width: 375px;
    background: #ffffff;
    border-radius: 24px;
    border: 10px solid #1e293b;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    min-height: 550px;
    padding: 15px;
    overflow-y: auto;
}
