/* =============================================
   FINNID FOUNDATION DESIGN SYSTEM
   Consolidated CSS - replaces: site.css, Style.css, AdminPanel.css, app.css (partial)
   ============================================= */

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
    /* Brand Colors */
    --ff-primary: #0f834d;
    --ff-primary-dark: #0b6b3f;
    --ff-primary-light: #63c57e;
    --ff-accent: #f7c948;
    --ff-accent-dark: #e5b733;

    /* Neutral Colors */
    --ff-text: #1f2937;
    --ff-text-muted: #6b7280;
    --ff-text-light: #9ca3af;
    --ff-bg: #ffffff;
    --ff-bg-light: #f9fafb;
    --ff-bg-muted: #f3f4f6;
    --ff-border: #e5e7eb;
    --ff-border-light: #f0f0f0;

    /* Semantic Colors */
    --ff-success: #10b981;
    --ff-warning: #f59e0b;
    --ff-danger: #ef4444;
    --ff-info: #3b82f6;

    /* Typography */
    --ff-font-body: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    --ff-font-heading: 'Poppins', 'Segoe UI', sans-serif;

    /* Spacing */
    --ff-radius: 12px;
    --ff-radius-sm: 8px;
    --ff-radius-lg: 16px;
    --ff-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    --ff-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --ff-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* --- Base Reset & Typography --- */
body {
    font-family: var(--ff-font-body);
    color: var(--ff-text);
    background: var(--ff-bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--ff-font-heading);
    font-weight: 600;
    color: var(--ff-text);
    line-height: 1.3;
}

a {
    color: var(--ff-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--ff-primary-dark);
}

/* --- Accessibility --- */
:focus-visible {
    outline: 2px solid var(--ff-primary);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Skip to content link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0;
    z-index: 9999;
    padding: 0.5rem 1rem;
    background: var(--ff-primary);
    color: #fff;
    font-weight: 600;
}

.skip-link:focus {
    top: 0;
}

/* Minimum touch target size (44x44px) for mobile accessibility */
.btn, button, [role="button"], a.nav-link {
    min-height: 44px;
    min-width: 44px;
}

/* --- Button System --- */
.btn--primary, .btn-finnid {
    background: var(--ff-primary);
    color: #fff;
    border: none;
    border-radius: var(--ff-radius-sm);
    padding: 0.625rem 1.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(15, 131, 77, 0.25);
}

.btn--primary:hover, .btn-finnid:hover {
    background: var(--ff-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(15, 131, 77, 0.35);
    color: #fff;
}

.btn--accent {
    background: var(--ff-accent);
    color: var(--ff-text);
    border: none;
    border-radius: var(--ff-radius-sm);
    padding: 0.625rem 1.5rem;
    font-weight: 600;
}

.btn--accent:hover {
    background: var(--ff-accent-dark);
}

.btn--ghost, .btn--outline {
    background: transparent;
    border: 2px solid var(--ff-primary);
    color: var(--ff-primary);
    border-radius: var(--ff-radius-sm);
    padding: 0.5rem 1.5rem;
    font-weight: 600;
}

.btn--ghost:hover, .btn--outline:hover {
    background: var(--ff-primary);
    color: #fff;
}

/* --- Card System --- */
.card {
    border: 1px solid var(--ff-border);
    border-radius: var(--ff-radius);
    box-shadow: var(--ff-shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--ff-shadow);
}

.card-header {
    background: var(--ff-bg-muted);
    border-bottom: 1px solid var(--ff-border);
    font-weight: 600;
}

/* --- Dashboard Metric Cards --- */
.metric-card {
    border-radius: var(--ff-radius);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--ff-shadow-sm);
}

.metric-card h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.metric-card small {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Badge System --- */
.badge-finnid {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* --- Form Controls --- */
.form-control, .form-select {
    border-radius: var(--ff-radius-sm);
    border: 1px solid var(--ff-border);
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--ff-primary);
    box-shadow: 0 0 0 3px rgba(15, 131, 77, 0.15);
}

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--ff-text);
    margin-bottom: 0.375rem;
}

/* --- Table Enhancements --- */
.table {
    border-radius: var(--ff-radius);
    overflow: hidden;
}

.table thead th {
    background: var(--ff-bg-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ff-text-muted);
    border-bottom: 2px solid var(--ff-border);
}

.table tbody tr:hover {
    background: rgba(15, 131, 77, 0.04);
}

/* --- Admin Panel Overrides --- */
.t_head {
    background: var(--ff-primary-dark);
    color: white;
    font-weight: 700;
}

.btn_color {
    background: var(--ff-primary) !important;
    color: white !important;
}

.search_input_pg_report {
    height: 2.7rem;
}

/* --- Sidebar Enhancements --- */
.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    color: var(--ff-text-muted);
    border-radius: var(--ff-radius-sm);
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: rgba(15, 131, 77, 0.1);
    color: var(--ff-primary);
}

.sidebar .nav-link .menu-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

/* --- Chat Panel Styles --- */
.chat-session {
    transition: background 0.15s ease;
    border-radius: var(--ff-radius-sm);
}

.chat-session:hover {
    background: var(--ff-bg-muted);
}

.chat-session.bg-light {
    background: rgba(15, 131, 77, 0.08);
    border-left: 3px solid var(--ff-primary);
}

/* --- Footer Overrides --- */
.site-footer {
    background: #1a1a2e;
    color: #ccc;
}

.site-footer a {
    color: #ddd;
}

.site-footer a:hover {
    color: var(--ff-accent);
}

/* --- Responsive Utilities --- */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    .btn { font-size: 0.875rem; padding: 0.5rem 1rem; }
}

@media (min-width: 769px) {
    .hide-desktop { display: none !important; }
}

/* --- Print Styles --- */
@media print {
    .sidebar, .navbar, .site-footer, .btn { display: none !important; }
    .main-panel { margin: 0; padding: 0; }
    body { font-size: 12pt; }
}

/* --- Loading & Animation --- */
.skeleton {
    background: linear-gradient(90deg, var(--ff-bg-muted) 25%, var(--ff-border-light) 50%, var(--ff-bg-muted) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--ff-radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- Stat Cards (Home page) --- */
.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--ff-primary);
}
