/**
 * Modern Dashboard Design - Inspired by Attio & Softr
 * Professional, clean, high-end interface
 */

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Primary Colors - ConformPDF Brand */
    --primary-600: #09235c;
    --primary-700: #061938;
    --primary-50: #e6e9f1;
    --primary-100: #ccd3e3;

    /* Accent Color - Pink */
    --accent-600: #fe3960;
    --accent-700: #e5334d;
    --accent-50: #ffe8ed;
    --accent-100: #ffd1db;

    /* Neutral Scale */
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Status Colors */
    --success-50: #ECFDF5;
    --success-600: #059669;
    --warning-50: #FFFBEB;
    --warning-600: #D97706;
    --error-50: #FEF2F2;
    --error-600: #DC2626;

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Spacing Scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

body {
    font-family: var(--font-sans);
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === LAYOUT === */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid var(--gray-200);
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding-bottom: var(--space-6);
    margin-bottom: var(--space-6);
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.sidebar-logo-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    color: var(--gray-700);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-item.active {
    background: var(--primary-50);
    color: var(--primary-600);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--primary-600);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    font-size: 1.25rem;
    width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Plan Badge in Sidebar */
.sidebar-plan-badge {
    margin-top: auto;
    padding: var(--space-4);
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

.plan-badge-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: var(--space-2);
    font-weight: 600;
}

.plan-badge-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-600);
    margin-bottom: var(--space-1);
}

.plan-badge-usage {
    font-size: 0.8125rem;
    color: var(--gray-600);
}

/* === MAIN CONTENT === */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: var(--space-8);
    max-width: 100%;
}

/* Page Header */
.page-header {
    margin-bottom: var(--space-8);
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-2);
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--gray-600);
    font-weight: 400;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-6);
    font-size: 0.875rem;
}

.breadcrumb-link {
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-link:hover {
    color: var(--primary-600);
}

.breadcrumb-separator {
    color: var(--gray-400);
}

/* === CARDS === */
.card {
    background: white;
    border-radius: var(--radius-xl);
    border: 1px solid var(--gray-200);
    padding: var(--space-8);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 1px solid var(--gray-200);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.card-description {
    font-size: 0.9375rem;
    color: var(--gray-600);
    line-height: 1.6;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-6);
    margin-bottom: var(--space-8);
}

.stat-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.stat-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-3);
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: var(--space-2);
}

.stat-change {
    font-size: 0.875rem;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.stat-change.positive {
    color: var(--success-600);
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-600);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-700);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

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

.btn-danger {
    background: var(--error-600);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    background: #B91C1C;
    box-shadow: var(--shadow-md);
}

.btn-accent {
    background: var(--accent-600);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-accent:hover {
    background: var(--accent-700);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: 1rem;
}

/* === FORMS === */
.form-group {
    margin-bottom: var(--space-6);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: var(--gray-900);
    background: white;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-600);
    box-shadow: 0 0 0 3px var(--primary-50);
}

.form-input:disabled {
    background: var(--gray-50);
    color: var(--gray-500);
    cursor: not-allowed;
}

.form-helper {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin-top: var(--space-2);
}

/* === ALERTS === */
.alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-6);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.alert-success {
    background: var(--success-50);
    color: var(--success-600);
    border: 1px solid var(--success-600);
}

.alert-warning {
    background: var(--warning-50);
    color: var(--warning-600);
    border: 1px solid var(--warning-600);
}

.alert-error {
    background: var(--error-50);
    color: var(--error-600);
    border: 1px solid var(--error-600);
}

/* === TABLES === */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
}

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

.table thead {
    background: var(--gray-50);
}

.table th {
    padding: var(--space-4) var(--space-5);
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    border-bottom: 1px solid var(--gray-200);
}

.table td {
    padding: var(--space-4) var(--space-5);
    font-size: 0.9375rem;
    color: var(--gray-900);
    border-bottom: 1px solid var(--gray-200);
}

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

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

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.badge-success {
    background: var(--success-50);
    color: var(--success-600);
}

.badge-warning {
    background: var(--warning-50);
    color: var(--warning-600);
}

.badge-primary {
    background: var(--primary-50);
    color: var(--primary-600);
}

.badge-accent {
    background: var(--accent-50);
    color: var(--accent-600);
}

.badge-error {
    background: var(--error-50);
    color: var(--error-600);
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: var(--space-16) var(--space-8);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--space-6);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: var(--space-3);
}

.empty-state-description {
    font-size: 1rem;
    color: var(--gray-600);
    margin-bottom: var(--space-8);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }

    .main-content {
        margin-left: 220px;
        padding: var(--space-6);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

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

    .main-content {
        margin-left: 0;
        padding: var(--space-4);
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .page-title {
        font-size: 1.5rem;
    }
}
