:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #a5b4fc;
    --secondary: #10b981;
    --secondary-light: #34d399;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #111827;
    --gray-900: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    --border: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 2.5rem;
}

.navbar {
    background: var(--white);
    padding: 0.875rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand a {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.025em;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

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

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

.user-info {
    color: var(--gray-500);
    font-size: 0.875rem;
    font-weight: 500;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    font-size: 0.875rem;
    gap: 0.5rem;
}

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

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

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

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

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

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

.btn-full {
    width: 100%;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.header-content h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.025em;
    margin-bottom: 0.25rem;
}

.subtitle {
    color: var(--gray-500);
    font-size: 0.9375rem;
}

.header-stats {
    display: flex;
    gap: 1.5rem;
}

.header-stat {
    text-align: right;
}

.header-stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.header-stat-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-weight: 500;
}

.dashboard-grid-new {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.metric-icon.icon-growth {
    background: linear-gradient(135deg, var(--secondary) 0%, #059669 100%);
}

.metric-icon.icon-loyalty {
    background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
}

.metric-icon.icon-segments {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}

.metric-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-badge-prime, .metric-badge-vip {
    background: #fef3c7;
    color: #92400e;
}

.metric-badge-ready, .metric-badge-high {
    background: #d1fae5;
    color: #065f46;
}

.metric-badge-emerging, .metric-badge-medium {
    background: #dbeafe;
    color: #1e40af;
}

.metric-badge-not-ready, .metric-badge-low {
    background: #fee2e2;
    color: #991b1b;
}

.metric-badge-growing {
    background: #d1fae5;
    color: #065f46;
}

.metric-badge-stable {
    background: #e0e7ff;
    color: #3730a3;
}

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

.card-link {
    font-size: 0.8125rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.card-link:hover {
    text-decoration: underline;
}

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

.metric-score {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.score-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.score-max {
    font-size: 1.25rem;
    color: var(--gray-400);
    font-weight: 500;
}

.metric-description {
    font-size: 0.875rem;
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.metric-highlight {
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 0.875rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.highlight-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    font-weight: 500;
}

.highlight-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--secondary);
}

.growth-rate-display {
    margin-bottom: 1.25rem;
}

.growth-rate {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.growth-rate.positive {
    color: var(--secondary);
}

.growth-rate.negative {
    color: var(--danger);
}

.growth-rate.neutral {
    color: var(--gray-500);
}

.growth-period {
    display: block;
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.growth-metrics {
    display: flex;
    align-items: stretch;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.growth-metric {
    flex: 1;
    padding: 1rem;
    text-align: center;
}

.growth-metric-divider {
    width: 1px;
    background: var(--gray-200);
}

.growth-metric-label {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.growth-metric-value {
    display: block;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
}

.loyalty-bars {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.loyalty-bar-row {
    display: grid;
    grid-template-columns: 70px 1fr 80px;
    gap: 0.75rem;
    align-items: center;
}

.loyalty-bar-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-700);
}

.tier-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.tier-dot-vip { background: #fbbf24; }
.tier-dot-high { background: #34d399; }
.tier-dot-medium { background: #60a5fa; }
.tier-dot-low { background: #f87171; }

.loyalty-bar-track {
    height: 8px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}

.loyalty-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
}

.tier-fill-vip { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.tier-fill-high { background: linear-gradient(90deg, #34d399, #10b981); }
.tier-fill-medium { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.tier-fill-low { background: linear-gradient(90deg, #f87171, #ef4444); }

.loyalty-bar-stats {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    justify-content: flex-end;
}

.loyalty-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
}

.loyalty-percent {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.segment-chips {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.segment-chip {
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    padding: 0.875rem;
    border: 1px solid var(--gray-100);
}

.segment-chip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.segment-chip-id {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-900);
}

.segment-chip-percent {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
}

.segment-chip-bar {
    height: 4px;
    background: var(--gray-200);
    border-radius: 2px;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.segment-chip-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
}

.segment-chip-count {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.action-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.action-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.action-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.action-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.action-icon.icon-rec {
    color: var(--secondary);
}

.action-icon.icon-loyalty {
    color: #ec4899;
}

.action-text {
    flex: 1;
}

.action-title {
    display: block;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.125rem;
}

.action-desc {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.action-arrow {
    color: var(--gray-400);
    flex-shrink: 0;
}

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

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

.card-header h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
}

.card-body {
    padding: 1.5rem;
}

.card-primary {
    border-left: 3px solid var(--primary);
}

.card-secondary {
    border-left: 3px solid var(--secondary);
}

.card-wide {
    grid-column: span 2;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-prime, .badge-vip {
    background: #fef3c7;
    color: #92400e;
}

.badge-ready, .badge-high {
    background: #d1fae5;
    color: #065f46;
}

.badge-emerging, .badge-medium {
    background: #dbeafe;
    color: #1e40af;
}

.badge-not-ready, .badge-low {
    background: #fee2e2;
    color: #991b1b;
}

.badge-growing {
    background: #d1fae5;
    color: #065f46;
}

.badge-stable {
    background: #e0e7ff;
    color: #3730a3;
}

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

.login-page {
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

.login-split {
    display: flex;
    min-height: 100vh;
}

.login-brand {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.login-brand::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.login-brand::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 50%);
    pointer-events: none;
}

.login-brand-content {
    position: relative;
    z-index: 1;
    color: var(--white);
    max-width: 400px;
}

.login-brand-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
    line-height: 1.2;
}

.login-brand-content .tagline {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 3rem;
    font-weight: 400;
}

.login-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    opacity: 0.9;
}

.feature-icon {
    font-size: 1.25rem;
}

.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--white);
}

.login-form-container {
    width: 100%;
    max-width: 400px;
}

.login-form-header {
    margin-bottom: 2rem;
}

.login-form-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.login-form-header p {
    color: var(--gray-500);
    font-size: 1rem;
}

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

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

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    transition: all 0.15s ease;
    background: var(--white);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.login-form .btn {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
}

.login-help {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.login-help h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.login-help p {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.credentials-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.credential-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
}

.credential-item code {
    background: var(--white);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.75rem;
    border: 1px solid var(--border);
}

.credential-divider {
    color: var(--gray-400);
}

.credentials-table {
    width: 100%;
    font-size: 0.8125rem;
}

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

.credentials-table th {
    color: var(--gray-500);
    font-weight: 500;
}

.credentials-table code {
    background: var(--gray-100);
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.75rem;
}

.alert {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

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

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.score-display {
    text-align: center;
    margin-bottom: 1rem;
}

.score-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

.score-label {
    font-size: 1.25rem;
    color: var(--gray-400);
}

.explanation {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.loan-estimate {
    background: var(--gray-50);
    padding: 0.875rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: space-between;
}

.loan-estimate .label {
    color: var(--gray-500);
}

.loan-estimate .value {
    font-weight: 700;
    color: var(--secondary);
}

.growth-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    text-align: center;
}

.stat {
    padding: 0.5rem;
}

.stat .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat .stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    line-height: 1.3;
}

.stat-value.positive {
    color: var(--secondary);
}

.stat-value.negative {
    color: var(--danger);
}

.stat-large {
    text-align: center;
    padding: 1rem 0;
}

.stat-large .stat-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-large .stat-label {
    display: block;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.tier-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.tier-item {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-sm);
}

.tier-vip { background: #fef3c7; }
.tier-high { background: #d1fae5; }
.tier-medium { background: #dbeafe; }
.tier-low { background: #fee2e2; }

.tier-count {
    font-weight: 700;
}

.segment-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.segment-badge {
    background: var(--gray-50);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid var(--gray-100);
}

.segment-id {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--gray-900);
}

.segment-count {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.quick-actions {
    margin-top: 2rem;
}

.quick-actions h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

.segments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.segment-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.segment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.segment-size {
    background: var(--gray-100);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
}

.segment-description {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.segment-stats {
    margin-bottom: 1rem;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.875rem;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row .stat-label {
    color: var(--gray-500);
}

.stat-row .stat-value {
    font-weight: 600;
    color: var(--gray-900);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
    transition: color 0.15s ease;
}

.close-btn:hover {
    color: var(--gray-600);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--gray-500);
}

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

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

.data-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
}

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

.warning-row {
    background: #fef3c7 !important;
}

.insights-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.insight-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    border: 1px solid var(--border);
}

.insight-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.loan-icon {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.growth-icon {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.insight-content h4 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.insight-content p {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.6;
}

.insight-content .highlight {
    color: var(--secondary);
    font-weight: 600;
    margin-top: 0.5rem;
}

.recommendations-section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.recommendations-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.section-desc {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.action-tag {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.action-offer {
    background: #d1fae5;
    color: #065f46;
}

.action-winback {
    background: #fef3c7;
    color: #92400e;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.loyalty-overview {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.overview-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    text-align: center;
    border: 1px solid var(--border);
}

.overview-card h3 {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.big-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
}

.tier-breakdown {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.tier-breakdown h3 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.tier-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tier-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    height: 32px;
    position: relative;
}

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

.tier-bar.tier-vip .bar-fill { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.tier-bar.tier-high .bar-fill { background: linear-gradient(90deg, #34d399, #10b981); }
.tier-bar.tier-medium .bar-fill { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.tier-bar.tier-low .bar-fill { background: linear-gradient(90deg, #f87171, #ef4444); }

.tier-label {
    width: 60px;
    font-weight: 500;
    font-size: 0.875rem;
}

.tier-value {
    font-weight: 600;
}

.rfm-explanation {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border);
}

.rfm-explanation h3 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.rfm-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.rfm-card {
    text-align: center;
    padding: 1.25rem 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

.rfm-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.rfm-card h4 {
    margin-bottom: 0.375rem;
    font-weight: 600;
}

.rfm-card p {
    font-size: 0.8125rem;
    color: var(--gray-500);
    line-height: 1.4;
}

.top-customers-section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.top-customers-section h2 {
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.75rem;
}

.footer {
    text-align: center;
    padding: 2rem;
    color: var(--gray-400);
    font-size: 0.8125rem;
}

@media (max-width: 1024px) {
    .dashboard-grid-new {
        grid-template-columns: 1fr;
    }
    
    .action-bar {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .header-stat {
        text-align: left;
    }
    
    .dashboard-grid, .insights-row {
        grid-template-columns: 1fr;
    }
    
    .card-wide {
        grid-column: span 1;
    }
    
    .navbar {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 0.75rem 1rem;
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .loyalty-overview {
        grid-template-columns: 1fr;
    }
    
    .rfm-cards {
        grid-template-columns: 1fr;
    }
    
    .growth-metrics {
        flex-direction: column;
    }
    
    .growth-metric-divider {
        width: 100%;
        height: 1px;
    }
    
    .loyalty-bar-row {
        grid-template-columns: 60px 1fr 70px;
        gap: 0.5rem;
    }
}

/* AI Summary Button Styles */
.ai-summary-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.ai-summary-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.4);
}

.ai-summary-btn:active {
    transform: translateY(0);
}

.ai-summary-btn svg {
    width: 14px;
    height: 14px;
}

/* AI Summary Modal */
.ai-modal {
    max-width: 500px;
}

.ai-modal .modal-header h3 {
    display: flex;
    align-items: center;
    color: var(--primary);
}

.ai-modal .modal-body {
    padding: 1.5rem;
}

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem;
    color: var(--gray-500);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.summary-text {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--gray-700);
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
}

/* Page-level AI Summary Button */
.page-ai-summary {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.page-ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.page-ai-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.page-ai-btn svg {
    width: 18px;
    height: 18px;
}

/* AI Summary Container within cards */
.ai-summary-container {
    margin-top: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #faf5ff, #eef2ff);
    border-radius: var(--radius-sm);
    border: 1px solid #e0e7ff;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--gray-700);
}

/* Updated AI Summary Button - Subtle with Pulse */
.ai-summary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 50%;
    font-size: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none;
    animation: subtle-pulse 3s ease-in-out infinite;
}

.ai-summary-btn svg {
    width: 14px;
    height: 14px;
}

.ai-summary-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    transform: scale(1.1);
    animation: none;
}

@keyframes subtle-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
        opacity: 0.7;
    }
    50% {
        box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
        opacity: 1;
    }
}

/* Updated Page AI Button - Subtle */
.page-ai-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: rgba(139, 92, 246, 0.08);
    color: #7c3aed;
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none;
    animation: subtle-pulse 3s ease-in-out infinite;
}

.page-ai-btn:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-1px);
    animation: none;
}

.page-ai-btn svg {
    width: 16px;
    height: 16px;
    opacity: 0.8;
}

/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Viewport meta is in HTML templates */

/* Improved base mobile styles */
@media (max-width: 480px) {
    :root {
        --radius: 10px;
        --radius-sm: 6px;
    }
    
    body {
        font-size: 15px;
    }
    
    .container {
        padding: 1rem;
    }
    
    /* Mobile Header */
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1.25rem;
    }
    
    .header-content h1 {
        font-size: 1.375rem;
        line-height: 1.3;
    }
    
    .subtitle {
        font-size: 0.8125rem;
    }
    
    .header-stats {
        width: 100%;
        justify-content: flex-start;
        gap: 1.5rem;
    }
    
    .header-stat {
        text-align: left;
    }
    
    .header-stat-value {
        font-size: 1.5rem;
    }
    
    .header-stat-label {
        font-size: 0.75rem;
    }
    
    /* Mobile Metric Cards */
    .metric-card {
        padding: 1.125rem;
    }
    
    .metric-header {
        margin-bottom: 0.75rem;
    }
    
    .metric-icon {
        width: 36px;
        height: 36px;
    }
    
    .metric-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .metric-title {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .score-number {
        font-size: 2.25rem;
    }
    
    .score-max {
        font-size: 1rem;
    }
    
    .metric-description {
        font-size: 0.8125rem;
    }
    
    .metric-highlight {
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-start;
    }
    
    /* Mobile Growth Display */
    .growth-rate {
        font-size: 2rem;
    }
    
    .growth-metrics {
        flex-direction: column;
    }
    
    .growth-metric {
        padding: 0.75rem;
    }
    
    .growth-metric-divider {
        width: 100%;
        height: 1px;
    }
    
    /* Mobile Loyalty Bars */
    .loyalty-bars {
        gap: 0.625rem;
    }
    
    .loyalty-bar-row {
        grid-template-columns: 55px 1fr 65px;
        gap: 0.375rem;
    }
    
    .loyalty-bar-label {
        font-size: 0.75rem;
        gap: 0.375rem;
    }
    
    .tier-dot {
        width: 6px;
        height: 6px;
    }
    
    .loyalty-bar-track {
        height: 6px;
    }
    
    .loyalty-count {
        font-size: 0.8125rem;
    }
    
    .loyalty-percent {
        font-size: 0.6875rem;
    }
    
    /* Mobile Segment Chips */
    .segment-chips {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .segment-chip {
        padding: 0.625rem;
    }
    
    .segment-chip-id {
        font-size: 0.75rem;
    }
    
    .segment-chip-percent {
        font-size: 0.6875rem;
    }
    
    /* Mobile Action Cards */
    .action-bar {
        gap: 0.75rem;
    }
    
    .action-card {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .action-icon {
        width: 40px;
        height: 40px;
    }
    
    .action-title {
        font-size: 0.875rem;
    }
    
    .action-desc {
        font-size: 0.75rem;
    }
    
    /* Mobile Cards */
    .card-header {
        padding: 0.875rem 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* Mobile Login */
    .login-card {
        padding: 1.5rem;
    }
    
    .login-header h1 {
        font-size: 1.25rem;
    }
    
    .credentials-table th, 
    .credentials-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }
    
    .credentials-table code {
        font-size: 0.6875rem;
        padding: 0.125rem 0.375rem;
    }
    
    /* Mobile Segments Page */
    .segments-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .segment-card {
        padding: 1.125rem;
    }
    
    .segment-header h3 {
        font-size: 1rem;
    }
    
    /* Mobile RFM Cards */
    .rfm-cards {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .rfm-card {
        padding: 1rem;
    }
    
    .rfm-letter {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }
    
    .rfm-card h4 {
        font-size: 0.9375rem;
    }
    
    .rfm-card p {
        font-size: 0.75rem;
    }
    
    /* Mobile Loyalty Overview */
    .loyalty-overview {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .overview-card {
        padding: 1.25rem;
    }
    
    .big-number {
        font-size: 2.5rem;
    }
    
    /* Mobile Insights */
    .insights-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .insight-card {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
    }
    
    .insight-icon {
        margin: 0 auto;
    }
    
    /* Mobile Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0 -1rem;
        padding: 0 1rem;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    .data-table th, 
    .data-table td {
        padding: 0.625rem 0.5rem;
        font-size: 0.8125rem;
    }
    
    /* Mobile Modal */
    .modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 0.5rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .summary-text {
        font-size: 0.875rem;
        padding: 0.875rem;
    }
    
    /* Mobile AI Buttons */
    .ai-summary-btn {
        width: 32px;
        height: 32px;
    }
    
    .page-ai-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .page-ai-summary {
        margin-bottom: 0.75rem;
    }
    
    /* Mobile Footer */
    .footer {
        padding: 1.5rem 1rem;
        font-size: 0.75rem;
    }
}

/* Tablet styles (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 1.25rem;
    }
    
    .dashboard-grid-new {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .segment-chips {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .action-bar {
        grid-template-columns: 1fr;
    }
    
    .rfm-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .segments-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Navigation - Hamburger Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--gray-700);
}

.mobile-menu-toggle svg {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        padding: 0.75rem 1rem;
        position: relative;
    }
    
    .mobile-menu-toggle {
        display: block;
        order: 2;
    }
    
    .nav-brand {
        order: 1;
        flex: 1;
    }
    
    .nav-user {
        order: 3;
        width: 100%;
        justify-content: space-between;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border);
        margin-top: 0.75rem;
        display: none;
    }
    
    .nav-user.show {
        display: flex;
    }
    
    .nav-links {
        order: 4;
        width: 100%;
        flex-direction: column;
        gap: 0.25rem;
        padding-top: 0.75rem;
        display: none;
    }
    
    .nav-links.show {
        display: flex;
    }
    
    .nav-link {
        padding: 0.75rem 1rem;
        text-align: center;
        border-radius: var(--radius-sm);
        background: var(--gray-50);
    }
    
    .nav-link:hover {
        background: var(--gray-100);
    }
    
    .user-info {
        font-size: 0.8125rem;
    }
    
    .btn-outline {
        padding: 0.5rem 1rem;
    }
}

/* Touch-friendly elements - minimum 44px touch targets */
@media (max-width: 768px) {
    .btn {
        min-height: 44px;
        padding: 0.625rem 1rem;
    }
    
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .close-btn {
        min-width: 44px;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .action-card {
        min-height: 70px;
    }
    
    .metric-badge {
        padding: 0.375rem 0.75rem;
    }
    
    .card-link {
        padding: 0.5rem;
        display: inline-block;
    }
    
    /* Improve tap spacing */
    .tier-item {
        padding: 0.75rem 1rem;
    }
    
    .stat-row {
        padding: 0.75rem 0;
    }
    
    .segment-badge {
        padding: 0.875rem 1rem;
    }
}

/* Prevent horizontal scroll on mobile */
html, body {
    overflow-x: hidden;
}

/* Smooth scrolling for mobile */
@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
    }
    
    * {
        -webkit-tap-highlight-color: transparent;
    }
}

/* Safe area padding for notched devices */
@supports (padding: max(0px)) {
    .navbar {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .footer {
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    }
}

/* Login page mobile styles */
@media (max-width: 768px) {
    .login-split {
        flex-direction: column;
        min-height: 100vh;
    }
    
    .login-brand {
        padding: 2.5rem 1.5rem 2rem;
        min-height: auto;
        text-align: center;
    }
    
    .login-brand-content {
        max-width: 100%;
    }
    
    .login-brand-content h1 {
        font-size: 1.75rem;
        margin-bottom: 0.5rem;
    }
    
    .login-brand-content .tagline {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .login-features {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
    }
    
    .login-feature {
        font-size: 0.8125rem;
        background: rgba(255, 255, 255, 0.15);
        padding: 0.5rem 0.75rem;
        border-radius: 2rem;
        gap: 0.5rem;
    }
    
    .login-feature .feature-icon {
        font-size: 1rem;
    }
    
    .login-form-side {
        padding: 2rem 1.5rem 3rem;
        flex: 1;
    }
    
    .login-form-container {
        max-width: 100%;
    }
    
    .login-form-header {
        text-align: center;
        margin-bottom: 1.5rem;
    }
    
    .login-form-header h2 {
        font-size: 1.5rem;
    }
    
    .login-form-header p {
        font-size: 0.9375rem;
    }
    
    /* Touch-friendly inputs */
    .login-form .form-group input {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    /* Touch-friendly button */
    .login-form .btn {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .login-help {
        margin-top: 2rem;
    }
    
    .login-help h3 {
        text-align: center;
    }
    
    .login-help p {
        text-align: center;
    }
    
    .credentials-list {
        gap: 0.625rem;
    }
    
    .credential-item {
        justify-content: center;
        padding: 0.75rem 1rem;
        min-height: 44px;
    }
    
    .credential-item code {
        font-size: 0.8125rem;
        padding: 0.25rem 0.625rem;
    }
}

/* Small phones */
@media (max-width: 380px) {
    .login-brand {
        padding: 2rem 1rem 1.5rem;
    }
    
    .login-brand-content h1 {
        font-size: 1.5rem;
    }
    
    .login-brand-content .tagline {
        font-size: 0.9375rem;
    }
    
    .login-feature {
        font-size: 0.75rem;
        padding: 0.375rem 0.625rem;
    }
    
    .login-form-side {
        padding: 1.5rem 1rem 2.5rem;
    }
    
    .login-form-header h2 {
        font-size: 1.375rem;
    }
}

/* Landscape phone orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .login-split {
        flex-direction: row;
        min-height: 100vh;
    }
    
    .login-brand {
        padding: 1.5rem;
        text-align: left;
        flex: 0.8;
    }
    
    .login-brand-content h1 {
        font-size: 1.25rem;
    }
    
    .login-brand-content .tagline {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }
    
    .login-features {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .login-feature {
        padding: 0.375rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .login-form-side {
        padding: 1.5rem;
        flex: 1;
        overflow-y: auto;
    }
    
    .login-form-header {
        margin-bottom: 1rem;
        text-align: left;
    }
    
    .login-form-header h2 {
        font-size: 1.25rem;
    }
    
    .login-form-header p {
        font-size: 0.875rem;
    }
    
    .login-form .form-group {
        margin-bottom: 0.875rem;
    }
    
    .login-form .form-group input {
        padding: 0.75rem;
        min-height: 44px;
    }
    
    .login-form .btn {
        padding: 0.75rem;
        min-height: 44px;
    }
    
    .login-help {
        margin-top: 1rem;
        padding-top: 1rem;
    }
    
    .login-help h3,
    .login-help p {
        text-align: left;
    }
    
    .credential-item {
        justify-content: flex-start;
    }
    
    .modal-content {
        max-height: 95vh;
    }
}

/* Safe area support for login page on notched devices */
@supports (padding: max(0px)) {
    .login-brand {
        padding-left: max(1.5rem, env(safe-area-inset-left));
        padding-right: max(1.5rem, env(safe-area-inset-right));
    }
    
    .login-form-side {
        padding-left: max(1.5rem, env(safe-area-inset-left));
        padding-right: max(1.5rem, env(safe-area-inset-right));
        padding-bottom: max(2rem, env(safe-area-inset-bottom));
    }
}

/* Print styles */
@media print {
    .navbar,
    .mobile-menu-toggle,
    .ai-summary-btn,
    .page-ai-btn,
    .btn,
    .action-bar {
        display: none !important;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .metric-card,
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
