:root {
    --primary-color: #3b82f6;
    --primary-dark: #1e40af;
    --primary-light: #60a5fa;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --background-light: #f8fafc;
    --background-white: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --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);
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    --gradient-hero: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--background-light);
}

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

/* Typography */
.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.subtitle {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--primary-color);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    filter: brightness(1.1);
}

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

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

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

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

/* Cards */
.card {
    background: var(--background-white);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

.card:hover {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.card-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.card-description {
    color: var(--text-muted);
    font-size: 0.875rem;
}

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

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

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: var(--background-white);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

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

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* Hero Section */
.hero {
    background: var(--gradient-hero);
    padding: 4rem 0;
    text-align: center;
    color: white;
}

.hero .title {
    color: white;
    font-size: 3rem;
}

.hero .subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.25rem;
}

/* Grid */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 768px) {
    .grid-cols-2,
    .grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-5 { padding-top: 2rem; padding-bottom: 2rem; }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.px-4 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-5 { padding-left: 2rem; padding-right: 2rem; }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border-color: var(--success-color);
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border-color: var(--warning-color);
}

.alert-danger {
    background: #fef2f2;
    color: #b91c1c;
    border-color: var(--danger-color);
}

/* SaaS Cards */
.saas-card {
    background: var(--background-white);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.saas-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

.saas-card.active {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.saas-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    font-size: 2rem;
    color: white;
}

.saas-icon.petcare {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.saas-icon.psychology {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* Dashboard System Actions */
.system-actions-dashboard {
    margin-top: 1rem;
}

.system-actions-dashboard .btn {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}

.flex-1 {
    flex: 1;
}

.d-flex {
    display: flex;
}

.gap-2 {
    gap: 0.5rem;
}

.justify-content-center {
    justify-content: center;
}

.mt-2 {
    margin-top: 0.5rem;
}

/* Color Consistency Fixes - Ensure all elements use primary color correctly */
.btn-primary,
.saas-card .btn-primary,
.action-card .btn,
.testimonial-placeholder .btn-primary,
.card .btn-primary,
.quick-actions .btn-primary,
.hero-section .btn-primary,
.section .btn-primary {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
}

.btn-primary:hover,
.saas-card .btn-primary:hover,
.action-card .btn:hover,
.testimonial-placeholder .btn-primary:hover,
.card .btn-primary:hover,
.quick-actions .btn-primary:hover,
.hero-section .btn-primary:hover,
.section .btn-primary:hover {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    filter: brightness(1.1);
    opacity: 0.9;
}

/* Status badges and accents */
.status-active,
.action-badge,
.nav-item.active,
.status-badge.status-active {
    color: var(--primary-color) !important;
}

.nav-item.active::before,
.action-card::before {
    background: var(--primary-color) !important;
}

/* Links and accents */
a:not(.btn):not(.navbar-brand),
.checkbox-label a {
    color: var(--primary-color);
}

/* Form controls focus */
.form-control:focus,
.form-select:focus,
.color-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
}

/* Icons and decorative elements */
.hero-stat-number,
.action-icon {
    color: var(--primary-color) !important;
}

/* Don't override saas-icon background on index/dashboard */
.saas-icon:not(.petcare):not(.psychology) {
    background: var(--primary-color) !important;
}

/* Gradients should use primary color */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #667eea 100%) !important;
}

.action-icon {
    background: linear-gradient(135deg, var(--primary-color), #667eea) !important;
}

.action-card::before {
    background: linear-gradient(90deg, var(--primary-color), #667eea) !important;
}