/* Repromeda Statistiky - Clean Light Theme */
/* Inspired by shadcn/ui, Tremor, healthcare best practices */

:root {
    --bg-primary: #f8fafc;
    --bg-card: #ffffff;
    --bg-sidebar: #1e293b;
    --bg-hover: #f1f5f9;
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --nav-width: 260px;

    /* Semantic colors */
    --color-primary: #3b82f6;
    --color-primary-light: #eff6ff;
    --color-primary-muted: #93c5fd;
    --color-success: #10b981;
    --color-success-light: #ecfdf5;
    --color-warning: #f59e0b;
    --color-warning-light: #fffbeb;
    --color-danger: #ef4444;
    --color-danger-light: #fef2f2;
    --color-info: #0ea5e9;
    --color-info-light: #f0f9ff;

    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;

    /* Legacy compatibility aliases */
    --glass-bg: var(--bg-card);
    --glass-bg-hover: var(--bg-hover);
    --glass-border: var(--border-color);
    --glass-blur: 0px;
    --glass-shadow: var(--shadow-md);
    --gradient-bg: var(--bg-primary);
    --gradient-primary: var(--color-primary);
    --gradient-accent: var(--color-info);
    --gradient-success: var(--color-success);
    --gradient-warning: var(--color-warning);
    --gradient-danger: var(--color-danger);
    --status-active: var(--color-success);
    --status-pending: var(--color-warning);
    --status-complete: var(--color-primary);
    --status-cancelled: var(--color-danger);
    --score-excellent: var(--color-success);
    --score-good: #84cc16;
    --score-fair: var(--color-warning);
    --score-poor: var(--color-danger);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: #2563eb; }

/* ===== SIDEBAR (stays dark for contrast) ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--nav-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid #334155;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #e2e8f0;
}

.sidebar-brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f1f5f9;
}

.sidebar-version {
    font-size: 0.7rem;
    color: #64748b;
}

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

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #334155;
    text-align: center;
    color: #64748b;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 1.25rem;
    color: #94a3b8;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
}

.nav-icon { flex-shrink: 0; width: 20px; height: 20px; }
.nav-arrow { margin-left: auto; transition: transform 0.2s ease; }
.nav-group.open .nav-arrow { transform: rotate(180deg); }
.nav-group-items { display: none; }
.nav-group.open .nav-group-items { display: block; }
.nav-child { padding-left: 3.25rem; font-size: 0.8rem; }

/* ===== MAIN CONTENT ===== */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    margin-left: var(--nav-width);
    padding: 1.5rem 2rem;
    min-height: 100vh;
    max-width: calc(100vw - var(--nav-width));
}

/* ===== MOBILE ===== */
.mobile-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-sidebar);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    z-index: 999;
    border-bottom: 1px solid #334155;
}

.topbar-brand {
    font-weight: 700;
    font-size: 1rem;
    color: #f1f5f9;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999;
}

.sidebar-overlay.show { display: block; }

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 72px 1rem 1rem; max-width: 100vw; }
}

/* ===== CARDS ===== */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
    transition: box-shadow 0.2s ease;
}

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

.glass-card-static {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
}

.glass-card .card-title, .glass-card-static .card-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

/* Stat cards */
.stat-card {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 12px 12px 0 0;
}

.stat-card.primary::before { background: var(--color-primary); }
.stat-card.accent::before { background: var(--color-info); }
.stat-card.success::before { background: var(--color-success); }
.stat-card.warning::before { background: var(--color-warning); }

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    margin: 0.5rem 0 0.25rem;
}

.stat-card.primary .stat-value { color: var(--color-primary); }
.stat-card.accent .stat-value { color: var(--color-info); }
.stat-card.success .stat-value { color: var(--color-success); }
.stat-card.warning .stat-value { color: var(--color-warning); }

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

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.08;
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--text-secondary);
}

/* ===== TABLE ===== */
.glass-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.glass-table {
    width: 100%;
    margin: 0;
    color: var(--text-primary);
    border-collapse: collapse;
}

.glass-table thead th {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.glass-table tbody td {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.8125rem;
    vertical-align: middle;
}

.glass-table tbody tr {
    transition: background 0.1s ease;
}

.glass-table tbody tr:hover {
    background: var(--bg-hover);
}

.glass-table tbody tr.clickable { cursor: pointer; }
.glass-table tbody tr:last-child td { border-bottom: none; }

/* ===== BADGES ===== */
.badge {
    font-size: 0.675rem;
    font-weight: 600;
    padding: 0.25em 0.65em;
    border-radius: 6px;
    letter-spacing: 0.01em;
}

.badge-active { background: var(--color-success-light); color: #059669; }
.badge-complete { background: var(--color-primary-light); color: #2563eb; }
.badge-cancelled { background: var(--color-danger-light); color: #dc2626; }
.badge-positive { background: var(--color-success-light); color: #059669; }
.badge-negative { background: var(--color-danger-light); color: #dc2626; }
.badge-warning { background: var(--color-warning-light); color: #d97706; }
.badge-info { background: var(--color-info-light); color: #0284c7; }
.badge-default { background: #f1f5f9; color: #475569; }

/* ===== BREADCRUMB ===== */
.glass-breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.glass-breadcrumb .breadcrumb-item { font-size: 0.8rem; }
.glass-breadcrumb .breadcrumb-item a { color: var(--color-primary); }
.glass-breadcrumb .breadcrumb-item.active { color: var(--text-muted); }
.glass-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* ===== PAGE HEADER ===== */
.page-header {
    margin-bottom: 1.25rem;
}

.page-title {
    font-size: 1.375rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ===== SEARCH ===== */
.glass-search {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    font-size: 0.8125rem;
    width: 100%;
    transition: border-color 0.15s;
}

.glass-search:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.glass-search::placeholder { color: var(--text-muted); }

.search-wrapper {
    position: relative;
}

.search-wrapper .iconify {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ===== DETAIL ===== */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.detail-label {
    font-size: 0.675rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.detail-value {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* ===== MISC ===== */
.text-gradient {
    color: var(--color-primary);
    font-weight: 600;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 1rem 0;
}

.icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.icon-circle.primary { background: var(--color-primary-light); color: var(--color-primary); }
.icon-circle.accent { background: var(--color-info-light); color: var(--color-info); }
.icon-circle.success { background: var(--color-success-light); color: var(--color-success); }
.icon-circle.warning { background: var(--color-warning-light); color: var(--color-warning); }
.icon-circle.danger { background: var(--color-danger-light); color: var(--color-danger); }

/* Chart canvas */
.chart-container {
    position: relative;
    height: 250px;
}

/* ===== ANIMATIONS ===== */
.page-enter {
    animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 767.98px) {
    .main-content { padding: 0.75rem; }
    .glass-card { padding: 1rem; border-radius: 10px; }
    .stat-value { font-size: 1.5rem; }
    .page-title { font-size: 1.15rem; }
    .glass-table { font-size: 0.75rem; }
    .glass-table thead th, .glass-table tbody td { padding: 0.5rem 0.5rem; }
    .detail-grid { grid-template-columns: 1fr; }
}
