/* SendorX - Main Stylesheet */

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

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1e293b;
    --light: #f8fafc;
    --border: #e2e8f0;
    --text: #334155;
    --text-light: #64748b;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--light);
}

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

a:hover {
    text-decoration: underline;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.logo:hover {
    text-decoration: none;
}

.nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav a {
    color: var(--text);
    font-weight: 500;
}

.nav a:hover {
    color: var(--primary);
    text-decoration: none;
}

/* Footer */
.footer {
    background: white;
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
    color: var(--text-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-outline:hover {
    background: var(--light);
    border-color: var(--secondary);
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.813rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-block {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: white;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group small {
    display: block;
    margin-top: 0.375rem;
    color: var(--text-light);
    font-size: 0.813rem;
}

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

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

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

.table th,
.table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

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

.table tbody tr:hover {
    background: #f8fafc;
}

.table .actions {
    display: flex;
    gap: 0.5rem;
}

.table .truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Badges */
.badge {
    display: inline-flex;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    text-transform: capitalize;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-primary {
    background: #dbeafe;
    color: #1e40af;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

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

.stat-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.stat-card h3 {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
}

.stat-label {
    font-size: 0.813rem;
    color: var(--text-light);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-light);
}

.empty-state p {
    margin-bottom: 1rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
}

.pagination-info {
    color: var(--text-light);
}

/* Inline form */
.inline {
    display: inline;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ===== Home Page ===== */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 5rem 1.5rem;
    text-align: center;
}

.hero-content {
    max-width: 700px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.hero .btn-outline {
    border-color: rgba(255,255,255,0.3);
    color: white;
}

.hero .btn-outline:hover {
    background: rgba(255,255,255,0.1);
}

.features {
    padding: 5rem 0;
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.feature-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-light);
}

.how-it-works {
    background: white;
    padding: 5rem 0;
}

.how-it-works h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.step-number {
    display: inline-flex;
    width: 3rem;
    height: 3rem;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.step h3 {
    margin-bottom: 0.5rem;
}

.step p {
    color: var(--text-light);
}

/* ===== Auth Pages ===== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--light);
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 1.5rem;
}

.auth-logo {
    display: block;
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2rem;
}

.auth-logo:hover {
    text-decoration: none;
}

.auth-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

.auth-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.auth-subtitle {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.auth-footer {
    text-align: center;
    color: var(--text-light);
}

/* ===== Admin Layout (Brevo-style) ===== */
.admin-page,
.dashboard-page {
    background: #f5f5f5;
}

.admin-layout,
.app-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    background: #ffffff;
    border-right: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-header {
    padding: 1.25rem 1rem;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.sidebar-logo:hover {
    text-decoration: none;
}

.sidebar-logo-img {
    height: 32px;
    width: auto;
}

.logo-text {
    font-size: 1.375rem;
    font-weight: 700;
    color: #0b4d2c;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    position: relative;
}

.nav-link:hover {
    background: #f5f5f5;
    text-decoration: none;
    color: #0b4d2c;
}

.nav-link.active {
    color: #0b4d2c;
    background: #e8f5e9;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: #0b4d2c;
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 0.75rem;
    color: inherit;
}

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

.nav-text {
    flex: 1;
}

.nav-arrow {
    display: flex;
    align-items: center;
    transition: transform 0.2s;
}

.nav-arrow svg {
    width: 16px;
    height: 16px;
    opacity: 0.5;
}

/* Submenu */
.has-submenu .nav-submenu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0;
}

.has-submenu.open .nav-submenu {
    display: block;
}

.has-submenu.open > .nav-link .nav-arrow {
    transform: rotate(180deg);
}

.nav-submenu .nav-link {
    padding-left: 3rem;
    font-size: 0.875rem;
    font-weight: 400;
    color: #666;
}

.nav-submenu .nav-link:hover {
    color: #0b4d2c;
}

.nav-submenu .nav-link.active {
    color: #0b4d2c;
    font-weight: 500;
    background: transparent;
}

.nav-submenu .nav-link.active::before {
    display: none;
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid #e5e5e5;
    padding: 0.5rem 0;
}

.sidebar-footer .nav-link {
    color: #666;
    font-size: 0.875rem;
}

.sidebar-footer .nav-link:hover {
    color: #0b4d2c;
}

/* Main Content */
.main-content {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-header {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 1.25rem 2rem;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.content-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* User Menu */
.user-menu {
    position: relative;
}

.user-menu-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: none;
    border: 1px solid #e5e5e5;
    border-radius: 9999px;
    cursor: pointer;
    font-size: 0.875rem;
    color: #333;
    transition: background 0.15s;
}

.user-menu-toggle:hover {
    background: #f5f5f5;
}

.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #0b4d2c;
    color: #fff;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
}

.user-email {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    min-width: 240px;
    z-index: 200;
    overflow: hidden;
}

.user-menu.open .user-dropdown {
    display: block;
}

.user-dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.user-dropdown-email {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    word-break: break-all;
}

.user-dropdown-role {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.125rem;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: #333;
    text-decoration: none;
    transition: background 0.1s;
}

.user-dropdown-item:hover {
    background: #f5f5f5;
    text-decoration: none;
}

.user-dropdown-item svg {
    color: #666;
    flex-shrink: 0;
}

.user-dropdown-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 0.25rem 0;
}

.user-dropdown-logout {
    color: #ef4444;
}

.user-dropdown-logout svg {
    color: #ef4444;
}

.content-body {
    flex: 1;
    padding: 1.5rem 2rem;
    max-width: 1400px;
}

/* ===== Dashboard ===== */
.dashboard-header {
    margin-bottom: 2rem;
}

.dashboard-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.dashboard-header p {
    color: var(--text-light);
}

.smtp-settings {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.setting-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.setting-row label {
    min-width: 100px;
    font-weight: 500;
}

.setting-row code {
    background: var(--light);
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.api-key-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--light);
    padding: 1rem;
    border-radius: var(--radius);
}

.api-key-display code {
    flex: 1;
    font-size: 0.875rem;
    word-break: break-all;
}

/* ===== Error Pages ===== */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-container {
    text-align: center;
}

.error-container h1 {
    font-size: 6rem;
    font-weight: 700;
    color: var(--primary);
}

.error-container p {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero-actions {
        flex-direction: column;
    }

    .admin-layout {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        display: none;
    }

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

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

code {
    background: var(--light);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.875em;
}

/* ===== Dashboard Home ===== */
.home-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.home-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.home-right {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

/* Calendar */
.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #999;
    margin-bottom: 0.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}

.calendar-day {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin: 0 auto;
    font-size: 0.8125rem;
    border-radius: 50%;
    color: #333;
}

.calendar-day.empty {
    visibility: hidden;
}

.calendar-day.today {
    background: #0b4d2c;
    color: white;
    font-weight: 600;
}

/* Planned for today */
.planned-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.planned-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.planned-item:last-child {
    border-bottom: none;
}

.planned-time {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0b4d2c;
    min-width: 45px;
}

.planned-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    font-size: 0.875rem;
}

.empty-state-sm {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #999;
    font-size: 0.875rem;
}

.empty-state-sm p {
    margin-bottom: 0.75rem;
}

/* Plan Usage */
.usage-label {
    font-size: 0.8125rem;
    color: #666;
}

.usage-bar {
    height: 10px;
    background: #e5e5e5;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.usage-fill {
    height: 100%;
    background: linear-gradient(90deg, #0b4d2c, #16a34a);
    border-radius: 5px;
    transition: width 0.3s;
}

.usage-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: #666;
}

/* Contacts overview */
.contacts-summary {
    text-align: center;
    padding: 0.5rem 0;
}

.contacts-summary .contacts-count {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.contacts-summary .contacts-label {
    font-size: 0.8125rem;
    color: #999;
}

/* Campaign list */
.campaign-list {
    display: flex;
    flex-direction: column;
}

.campaign-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid #f0f0f0;
}

.campaign-item:last-child {
    border-bottom: none;
}

.campaign-icon {
    color: #999;
    display: flex;
    align-items: center;
}

.campaign-info {
    flex: 1;
    min-width: 0;
}

.campaign-info strong {
    display: block;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
}

.campaign-meta {
    display: block;
    font-size: 0.75rem;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.campaign-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.campaign-date {
    font-size: 0.75rem;
    color: #999;
}

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

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

    .contacts-overview {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ===== Plans Page (Brevo-style) ===== */
.plans-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    align-items: stretch;
}

.plan-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.plan-card.plan-current {
    border-color: #0b4d2c;
    border-width: 2px;
}

.plan-card.plan-popular {
    border-color: #0b4d2c;
    border-width: 2px;
}

.plan-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
}

.plan-tag-current {
    background: #0b4d2c;
    color: #fff;
}

.plan-tag-popular {
    background: #e8f5e9;
    color: #0b4d2c;
}

.plan-upper {
    padding: 1.75rem 1.5rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}

.plan-name {
    font-size: 1.375rem;
    font-weight: 700;
    color: #0b4d2c;
    margin-bottom: 0.5rem;
}

.plan-tagline {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.5;
    margin-bottom: 1.25rem;
    min-height: 63px;
}

.plan-price {
    margin-bottom: 0.75rem;
    min-height: 60px;
}

.plan-price-amount {
    font-size: 2.25rem;
    font-weight: 700;
    color: #333;
    line-height: 1;
}

.plan-currency {
    font-size: 1.25rem;
    vertical-align: baseline;
}

.plan-price-period {
    font-size: 0.875rem;
    color: #999;
    margin-top: 0.25rem;
}

.plan-email-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #666;
    margin-bottom: 1.25rem;
}

.plan-email-count svg {
    flex-shrink: 0;
    color: #999;
}

.plan-cta form {
    width: 100%;
}

.plan-cta .btn {
    width: 100%;
}

.plan-cta .btn:disabled {
    background: #e5e5e5;
    color: #999;
    cursor: default;
}

.plan-cta {
    margin-top: auto;
}

.plan-lower {
    padding: 1.5rem;
    flex: 1;
}

.plan-features-heading {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1rem;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.plan-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #444;
    line-height: 1.4;
}

.plan-features li svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.plan-badge {
    display: inline-flex;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    background: #0b4d2c;
    color: #fff;
}

.usage-fill.warning {
    background: linear-gradient(90deg, #0b4d2c, #f59e0b);
}

.usage-fill.danger {
    background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.usage-info {
    margin-bottom: 0.5rem;
}

/* ===== Page Header ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.page-header-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.page-header-content p {
    color: var(--text-light);
    font-size: 0.875rem;
}

/* ===== Empty State Enhanced ===== */
.empty-icon {
    color: #ccc;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

/* ===== Progress Bars ===== */
.progress-bars {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text);
}

.progress-bar {
    height: 8px;
    background: #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.success {
    background: var(--success);
}

.progress-fill.danger {
    background: var(--danger);
}

/* ===== Template Grid ===== */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.template-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.template-preview {
    height: 160px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-preview-placeholder {
    color: #ccc;
}

.template-info {
    padding: 1rem;
}

.template-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.template-info p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.template-date {
    display: block;
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 0.75rem;
}

.template-actions {
    display: flex;
    gap: 0.5rem;
}

/* Code Editor */
.code-editor {
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    tab-size: 2;
    background: #fafafa;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    resize: vertical;
}
