@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300&display=swap');

:root {
    --bg-primary: #FFF8F6;
    --text-primary: #1F1F1F;
    --text-secondary: #5A5A5A;
    --accent: #cf5454;
    --accent-light: rgba(207, 84, 84, 0.1);
    --surface: #FFFFFF;
    --surface-secondary: #FAFAFA;
    --border: #F2E6E4;
    --shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.08);
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --nav-width: 260px;
    --nav-collapsed: 72px;
}

[data-theme="dark"] {
    --bg-primary: #131316;
    --text-primary: #FFF8F6;
    --text-secondary: #9CA3AF;
    --accent: #cf5454;
    --accent-light: rgba(207, 84, 84, 0.2);
    --surface: #1C1C1F;
    --surface-secondary: #17171A;
    --border: #2E2E32;
    --shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
    height: 100vh;
    overflow: hidden;
    display: flex;
}

h1, h2, h3, h4, .font-serif {
    font-family: 'Merriweather', serif;
}

/* Layout */
.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--nav-width);
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px;
    z-index: 50;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    text-decoration: none;
    color: var(--text-primary);
}

.sidebar-logo span {
    font-size: 20px;
    font-weight: 800;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.nav-link svg {
    width: 20px;
    height: 20px;
}

.nav-link:hover {
    background-color: var(--bg-primary);
    color: var(--accent);
}

.nav-link.active {
    background-color: var(--accent-light);
    color: var(--accent);
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    height: 100vh;
    overflow-y: auto;
    position: relative;
    padding: 40px;
}

.view-container {
    max-width: 1100px;
    margin: 0 auto;
    animation: fadeIn 0.4s ease-out;
}

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

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header-title h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 4px;
}

.header-title p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Premium Cards */
.premium-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.card-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-item {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    font-family: 'Merriweather', serif;
    color: var(--accent);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background-color: #b34646;
    transform: translateY(-1px);
}

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

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

/* Tables */
.premium-table {
    width: 100%;
    border-collapse: collapse;
}

.premium-table th {
    text-align: left;
    padding: 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

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

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

/* Wizard Steps */
.wizard-stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.wizard-stepper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--border);
    z-index: 0;
    transform: translateY(-50%);
}

.step-indicator {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--surface);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    z-index: 1;
    transition: all 0.3s ease;
}

.step-indicator.active {
    background-color: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 0 4px var(--accent-light);
}

.step-indicator.completed {
    background-color: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

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

/* Badges */
.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-sent { background-color: #E8F5E9; color: #2E7D32; }
.badge-draft { background-color: #F5F5F5; color: #616161; }
.badge-active { background-color: #E3F2FD; color: #1565C0; }
.badge-error { background-color: #FFEBEE; color: #C62828; }

/* Theme Toggle */
.theme-toggle-wrap {
    position: absolute;
    bottom: 24px;
    left: 24px;
    right: 24px;
}

.switch {
    font-size: 14px;
    position: relative;
    display: inline-block;
    width: 3.5em;
    height: 2em;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--text-primary);
    transition: .4s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 1.4em;
    width: 1.4em;
    border-radius: 50%;
    left: 10%;
    bottom: 15%;
    box-shadow: inset 15px -4px 0px 15px var(--bg-primary);
    background: var(--text-primary);
    transition: .4s;
}

input:checked + .slider:before {
    transform: translateX(100%);
    box-shadow: inset 8px -4px 0px 0px var(--bg-primary);
}
