/* ============================================
   Fonts
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================
   Design Tokens — Суди України
   ============================================ */
:root {
    /* Brand palette */
    --navy: #1a5276;
    --navy-dark: #0f3e5f;
    --navy-darker: #0a2e47;
    --navy-light: #eaf2f9;
    --navy-lighter: #f5f9fc;

    /* Accents */
    --green: #2e8b57;
    --green-light: #e8f5ed;
    --red: #c0392b;
    --red-light: #fbeae7;
    --amber: #d68910;
    --amber-light: #fcf2e0;
    --purple: #7d4ea5;
    --purple-light: #f1e8f7;

    /* Neutrals */
    --ink: #0f1a26;
    --text: #1f2937;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --border: #e5e7eb;
    --border-light: #eef0f3;
    --bg: #ffffff;
    --bg-alt: #f7f9fb;
    --bg-soft: #f1f5f9;

    /* Radii */
    --r-4: 4px;
    --r-6: 6px;
    --r-8: 8px;
    --r-12: 12px;
    --r-16: 16px;
    --r-full: 999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(15,30,50,0.04);
    --shadow: 0 1px 3px rgba(15,30,50,0.06), 0 4px 12px rgba(15,30,50,0.04);
    --shadow-md: 0 4px 16px rgba(15,30,50,0.08);
    --shadow-lg: 0 20px 60px rgba(10,46,71,0.18);

    /* Spacing */
    --sp-1: 4px;
    --sp-2: 8px;
    --sp-3: 12px;
    --sp-4: 16px;
    --sp-5: 20px;
    --sp-6: 24px;
    --sp-8: 32px;
    --sp-10: 40px;
    --sp-12: 48px;
    --sp-16: 64px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg-alt);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--navy);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--navy-dark);
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-top: 0;
}

h1 { font-size: 2rem; letter-spacing: -0.8px; line-height: 1.15; }
h2 { font-size: 1.5rem; letter-spacing: -0.4px; line-height: 1.25; }
h3 { font-size: 1.15rem; line-height: 1.3; }
h4 { font-size: 1rem; }

p { margin: 0 0 1rem; }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
}

@media (max-width: 768px) {
    .container { padding: 0 16px; }
    h1 { font-size: 1.625rem; }
    h2 { font-size: 1.25rem; }
}

/* Header */
.site-header {
    background: #fff;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    padding-top: 0;
    padding-bottom: 0;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    min-height: 72px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--navy);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.4px;
    line-height: 1;
    flex-shrink: 0;
}

.logo:hover {
    text-decoration: none;
    color: var(--navy-dark);
}

.logo-mark {
    width: 36px;
    height: 40px;
    flex-shrink: 0;
}

.logo-text {
    display: block;
    text-transform: uppercase;
}

.logo-sub {
    display: block;
    font-size: 10.5px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0;
    margin-top: 3px;
    text-transform: none;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0 0 0 24px;
    padding: 0;
    gap: 4px;
}

.nav-menu a {
    display: block;
    padding: 8px 14px;
    color: var(--text);
    font-weight: 500;
    font-size: 14px;
    border-radius: 6px;
    position: relative;
    transition: color 0.15s ease, background 0.15s ease;
}

.nav-menu a:hover {
    color: var(--navy);
    background: var(--navy-lighter);
    text-decoration: none;
}

.nav-menu a.active {
    color: var(--navy);
    font-weight: 600;
}

.nav-menu a.active::after {
    content: '';
    position: absolute;
    bottom: -24px;
    left: 12px;
    right: 12px;
    height: 2px;
    background: var(--navy);
    border-radius: 2px;
}

.search-form {
    display: flex;
    margin-left: auto;
    gap: 6px;
}

.search-form input {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    width: 240px;
    font-size: 14px;
    background: #fff;
    color: var(--text);
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s ease;
}

.search-form input:focus {
    border-color: var(--navy);
}

.search-form input::placeholder {
    color: var(--text-light);
}

.search-form button {
    padding: 8px 18px;
    background: var(--navy);
    border: none;
    color: white;
    cursor: pointer;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    transition: background 0.15s ease;
}

.search-form button:hover {
    background: var(--navy-dark);
}

/* Hero Section */
.hero {
    background: linear-gradient(180deg, var(--navy-lighter) 0%, var(--navy-light) 100%);
    color: var(--text);
    padding: 72px 0 64px;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3rem;
    line-height: 1.05;
    font-weight: 800;
    color: var(--navy-darker);
    letter-spacing: -1.2px;
    margin: 0 0 16px;
    max-width: 760px;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text);
    opacity: 0.85;
    margin-bottom: 28px;
    line-height: 1.5;
    max-width: 700px;
}

@media (max-width: 768px) {
    .hero { padding: 48px 0 40px; text-align: center; }
    .hero h1 { font-size: 2rem; }
    .hero-subtitle { font-size: 1rem; margin-left: auto; margin-right: auto; }
}

.hero-search {
    max-width: 720px;
    display: flex;
    gap: 10px;
    margin: 0;
}

.hero-search input {
    flex: 1;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    background: #fff;
    color: var(--text);
    font-family: inherit;
    outline: none;
    box-shadow: var(--shadow);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hero-search input:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26, 82, 118, 0.12);
}

.hero-search input::placeholder {
    color: var(--text-light);
}

.hero-search button {
    padding: 0 36px;
    background: var(--navy);
    border: none;
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    font-family: inherit;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.hero-search button:hover {
    background: var(--navy-dark);
}

.hero-examples {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
}

.hero-example-chip {
    padding: 6px 12px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.hero-example-chip:hover {
    border-color: var(--navy);
    text-decoration: none;
}

@media (max-width: 640px) {
    .hero-search {
        flex-direction: column;
        margin: 0 auto;
    }
    .hero-search input,
    .hero-search button {
        border-radius: 8px;
        padding: 14px 16px;
    }
}

/* Statistics */
.statistics-section {
    padding: 48px 0;
    background: transparent;
}

.statistics-section h2 {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.stat-card {
    text-align: left;
    padding: 22px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-8);
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--navy-darker);
    letter-spacing: -0.8px;
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 6px 0 12px;
    font-weight: 500;
}

.stat-link {
    font-size: 0.8125rem;
    color: var(--navy);
    font-weight: 600;
}

.stat-link:hover {
    color: var(--navy-dark);
}

/* Features */
.features-section {
    padding: 56px 0;
}

.features-section h2 {
    text-align: left;
    margin-bottom: 24px;
    font-size: 1.5rem;
    color: var(--navy-darker);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.feature-card {
    background: white;
    padding: 28px 24px;
    border: 1px solid var(--border);
    border-radius: var(--r-12);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.feature-card:hover {
    border-color: var(--navy);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.feature-card h3 {
    color: var(--text);
    margin: 0 0 10px;
    font-size: 1.0625rem;
    font-weight: 700;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: 16px;
}

.feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    margin-bottom: 16px;
    background: var(--navy-light);
    color: var(--navy);
}

.feature-icon svg { width: 22px; height: 22px; }

.feature-icon-navy   { background: var(--navy-light);   color: var(--navy); }
.feature-icon-green  { background: var(--green-light);  color: var(--green); }
.feature-icon-amber  { background: var(--amber-light);  color: var(--amber); }
.feature-icon-purple { background: var(--purple-light); color: var(--purple); }
.feature-icon-red    { background: var(--red-light);    color: var(--red); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--navy);
    color: white;
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid var(--navy);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
}

.btn:hover {
    background: var(--navy-dark);
    border-color: var(--navy-dark);
    color: white;
    text-decoration: none;
}

.btn:active {
    transform: translateY(1px);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-outline {
    background: #fff;
    color: var(--text);
    border-color: var(--border);
}

.btn-outline:hover {
    background: var(--bg-alt);
    color: var(--navy);
    border-color: var(--navy);
}

.btn-primary {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-soft);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover {
    background: var(--bg-alt);
    color: var(--navy);
    border-color: var(--navy);
}

.btn-success {
    background: var(--green);
    border-color: var(--green);
    color: #fff;
}

.btn-success:hover {
    background: #246e45;
    border-color: #246e45;
    color: #fff;
}

.btn-danger {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}

.btn-danger:hover {
    background: #9b2e22;
    border-color: #9b2e22;
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
    gap: 4px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* Page Header */
.page-header {
    background: linear-gradient(180deg, var(--navy-lighter) 0%, var(--navy-light) 100%);
    color: var(--text);
    padding: 32px 0 28px;
    border-bottom: 1px solid var(--border-light);
}

.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.page-header-main {
    flex: 1;
    min-width: 0;
}

.page-header h1 {
    margin: 0 0 8px;
    color: var(--navy-darker);
    font-size: 2rem;
    letter-spacing: -0.6px;
}

.page-header p, .subtitle {
    opacity: 0.75;
    color: var(--text);
    margin: 0;
    font-size: 15px;
}

.breadcrumb,
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.breadcrumb a,
.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb a:hover,
.breadcrumbs a:hover {
    color: var(--navy);
    text-decoration: underline;
}

.breadcrumb-text {
    color: var(--text);
    font-weight: 500;
}

/* Page Content */
.page-content {
    padding: 40px 0;
}

.page-content.with-sidebar {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 40px;
}

.sidebar {
    order: -1;
}

/* Cards / Panels */
.card {
    background: white;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: var(--r-8);
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.card h2 {
    margin-top: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 18px;
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.sidebar-card {
    background: white;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--r-8);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.sidebar-card h3 {
    margin-top: 0;
    font-size: 0.9rem;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 14px;
    color: var(--text);
    font-weight: 700;
}

.panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-8);
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border-light);
}

.panel-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.1px;
}

.panel-body {
    padding: 20px;
}

/* Lists */
.court-card, .judge-card, .case-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.court-card:last-child, .judge-card:last-child, .case-item:last-child {
    border-bottom: none;
}

.court-name, .judge-name {
    font-size: 1.1rem;
    margin: 0 0 10px;
}

.court-meta, .judge-meta, .result-meta {
    display: flex;
    gap: 15px;
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 10px;
}

.court-address, .court-contacts {
    font-size: 0.875rem;
    color: #666;
    margin: 5px 0;
}

/* Status badges */
.status-active { color: var(--green); }
.status-suspended { color: var(--amber); }
.status-dismissed { color: var(--red); }
.status-retired { color: var(--text-muted); }

/* Court type tile (circular icon) */
.court-tile {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    background: var(--navy);
}

.court-tile svg {
    width: 52%;
    height: 52%;
}

.court-tile-lg { width: 80px; height: 80px; }
.court-tile-sm { width: 36px; height: 36px; }

.court-tile-vs    { background: var(--green); }
.court-tile-ksu   { background: #2874a6; }
.court-tile-apel  { background: var(--purple); }
.court-tile-local { background: #a04668; }
.court-tile-gosp  { background: var(--amber); }
.court-tile-adm   { background: #1abc9c; }

/* Court type card link (grid tile) */
.court-type-card {
    display: block;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-12);
    color: inherit;
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.court-type-card:hover {
    border-color: var(--navy);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: inherit;
}

.court-type-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-top: 14px;
}

.court-type-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.court-type-count {
    font-size: 13px;
    color: var(--navy);
    margin-top: 12px;
    font-weight: 600;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.status-badge.status-active { background: var(--green-light); color: var(--green); }
.status-badge.status-suspended { background: var(--amber-light); color: var(--amber); }
.status-badge.status-dismissed { background: var(--red-light); color: var(--red); }
.status-badge.status-retired { background: var(--bg-soft); color: var(--text-muted); }

/* Chips */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-soft);
    color: var(--text);
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.chip-sm { padding: 2px 8px; font-size: 11px; }
.chip-navy { background: var(--navy-light); color: var(--navy); }
.chip-green { background: var(--green-light); color: var(--green); }
.chip-red { background: var(--red-light); color: var(--red); }
.chip-amber { background: var(--amber-light); color: var(--amber); }
.chip-purple { background: var(--purple-light); color: var(--purple); }
.chip-outline { background: #fff; color: var(--text); border: 1px solid var(--border); }

/* Generic badge (moderation, etc) */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.badge-approved { background: var(--green-light); color: var(--green); }
.badge-pending  { background: var(--amber-light); color: var(--amber); }
.badge-rejected { background: var(--red-light); color: var(--red); }

/* Info list */
.info-list {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 10px;
}

.info-list dt {
    font-weight: 600;
    color: #666;
}

.info-list dd {
    margin: 0;
}

/* Stats inline */
.stats-grid-inline {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a237e;
}

/* Case type distribution */
.case-types-stats {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.case-types-stats h3,
.top-judges-stats h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: #333;
}

.case-type-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.case-type-bar {
    display: grid;
    grid-template-columns: 130px 1fr 100px;
    align-items: center;
    gap: 10px;
}

.case-type-label {
    font-size: 0.875rem;
    color: #333;
}

.case-type-progress {
    height: 20px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

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

.case-type-civil { background: #4CAF50; }
.case-type-criminal { background: #f44336; }
.case-type-administrative { background: #FF9800; }
.case-type-commercial { background: #2196F3; }

.case-type-count {
    font-size: 0.875rem;
    color: #666;
    text-align: right;
}

/* Top judges */
.top-judges-stats {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.top-judges-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-judge-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f9f9f9;
    border-radius: 6px;
}

.top-judge-rank {
    width: 24px;
    height: 24px;
    background: #1a237e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.top-judge-name {
    flex: 1;
}

.top-judge-cases {
    font-size: 0.875rem;
    color: #666;
    white-space: nowrap;
}

/* Timeline */
.timeline {
    border-left: 2px solid #1a237e;
    padding-left: 20px;
}

.timeline-item {
    margin-bottom: 20px;
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 5px;
    width: 10px;
    height: 10px;
    background: #1a237e;
    border-radius: 50%;
}

.timeline-date {
    font-size: 0.875rem;
    color: #666;
    margin-bottom: 5px;
}

/* Filters */
.filter-form {
    background: white;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--r-8);
    box-shadow: var(--shadow-sm);
}

.filter-section h3 {
    margin-top: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 12px;
    color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px rgba(26, 82, 118, 0.08);
}

.form-group textarea {
    min-height: 120px;
    resize: vertical;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--r-6);
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid transparent;
}

.alert-success {
    background: var(--green-light);
    color: var(--green);
    border-color: rgba(46,139,87,0.2);
}

.alert-error {
    background: var(--red-light);
    color: var(--red);
    border-color: rgba(192,57,43,0.2);
}

/* Pagination */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    align-items: center;
    margin-top: 32px;
    flex-wrap: wrap;
}

.page-link {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: all 0.15s ease;
}

.page-link:hover {
    border-color: var(--navy);
    color: var(--navy);
    text-decoration: none;
}

.page-link.active {
    background: var(--navy);
    color: white;
    border-color: var(--navy);
    font-weight: 700;
}

.pagination-prev,
.pagination-next {
    min-width: 36px;
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    transition: all 0.15s ease;
}

.pagination-prev:hover,
.pagination-next:hover {
    border-color: var(--navy);
    color: var(--navy);
    background: var(--navy-lighter);
    text-decoration: none;
}

.pagination-info {
    padding: 8px 14px;
    color: var(--text-muted);
    font-size: 13px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

/* Results info */
.results-info {
    margin-bottom: 20px;
    color: #666;
}

/* Judges grid */
.judges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.judge-mini-card {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.judge-mini-card .judge-name {
    font-size: 0.95rem;
    margin: 0 0 5px;
    display: block;
}

.judge-position {
    font-size: 0.8rem;
    color: #666;
    display: block;
}

/* Cases list */
.cases-list {
    margin-bottom: 20px;
}

.case-number {
    font-weight: 600;
}

/* Cases table */
.cases-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.cases-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.cases-table thead {
    background: var(--bg-alt);
    color: var(--text-muted);
}

.cases-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    border-bottom: 1px solid var(--border);
}

.cases-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    text-align: left;
    font-size: 13px;
}

.cases-table tbody tr:hover {
    background: var(--navy-lighter);
}

.cases-table-number a {
    color: var(--navy);
    font-weight: 600;
}

.cases-table-number a:hover {
    color: var(--navy-dark);
    text-decoration: underline;
}

.cases-table-judge a { color: var(--navy); }
.cases-table-judge a:hover { color: var(--navy-dark); text-decoration: underline; }

.cases-table-date {
    white-space: nowrap;
    min-width: 100px;
}

.cases-table-number {
    white-space: nowrap;
    font-weight: 600;
}

.cases-table-number a {
    color: #003366;
    text-decoration: none;
}

.cases-table-number a:hover {
    text-decoration: underline;
}

.cases-table-judge {
    white-space: nowrap;
    font-size: 0.85rem;
}

.cases-table-judge a {
    color: #003366;
    text-decoration: none;
}

.cases-table-judge a:hover {
    text-decoration: underline;
}

.cases-table-description {
    text-align: left;
    max-width: 400px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.cases-table-type {
    white-space: nowrap;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .cases-table {
        font-size: 0.8rem;
    }
    .cases-table th,
    .cases-table td {
        padding: 8px 10px;
    }
    .cases-table-description {
        max-width: 200px;
    }
}

/* Regions */
.regions-section {
    padding: 56px 0;
    background: transparent;
}

.regions-section h2 {
    text-align: left;
    margin-bottom: 24px;
    font-size: 1.5rem;
    color: var(--navy-darker);
}

.regions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.region-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-8);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.region-card:hover {
    border-color: var(--navy);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: inherit;
}

.region-name {
    display: block;
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.region-count {
    display: block;
    font-size: 12px;
    color: var(--navy);
    font-weight: 600;
    background: var(--navy-light);
    padding: 2px 8px;
    border-radius: var(--r-full);
    white-space: nowrap;
}

/* Recent cases section */
.recent-section {
    padding: 48px 0 8px;
}

.recent-section h2 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: var(--navy-darker);
}

.recent-section .case-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-8);
    margin-bottom: 8px;
    transition: border-color 0.15s ease;
}

.recent-section .case-item:hover {
    border-color: var(--navy);
}

.recent-section .case-number {
    min-width: 140px;
}

.recent-section .case-number a {
    color: var(--navy);
    font-weight: 600;
    font-size: 13px;
}

.recent-section .case-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
}

.recent-section .case-court { color: var(--text); font-weight: 500; }
.recent-section .case-judge { color: var(--text-muted); font-size: 12px; }

.recent-section .case-date {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Footer */
.site-footer {
    background: var(--navy-darker);
    color: rgba(255,255,255,0.75);
    padding: 56px 0 24px;
    margin-top: 64px;
    font-size: 14px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 40px;
}

.footer-section p {
    font-size: 13px;
    opacity: 0.75;
    line-height: 1.6;
    max-width: 380px;
    color: rgba(255,255,255,0.8);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-brand .logo-mark {
    width: 36px;
    height: 40px;
}

.footer-brand-title {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.4px;
    color: #fff;
}

.footer-brand-sub {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 2px;
    color: rgba(255,255,255,0.8);
}

.footer-section h4 {
    color: white;
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-section li {
    font-size: 13px;
    opacity: 0.75;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 32px;
    }
}

@media (max-width: 520px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-section a {
    color: rgba(255,255,255,0.75);
    transition: opacity 0.15s ease;
}

.footer-section a:hover {
    color: white;
    opacity: 1;
    text-decoration: none;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 20px;
    margin-top: 40px;
    border-top: 1px solid rgba(255,255,255,0.12);
    font-size: 12px;
    opacity: 0.6;
}

.footer-bottom p {
    margin: 0;
}

/* Search results */
.search-section {
    margin-bottom: 40px;
}

.search-section h2 {
    margin-bottom: 20px;
}

.search-results-list {
    background: white;
    border-radius: 8px;
    margin-bottom: 15px;
}

.search-result-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item h3 {
    margin: 0 0 10px;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .nav-menu {
        flex-wrap: wrap;
    }

    .search-form {
        margin-left: 0;
        width: 100%;
    }

    .search-form input {
        width: 100%;
    }

    .page-content.with-sidebar {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: 0;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero-search {
        flex-direction: column;
    }

    .hero-search input,
    .hero-search button {
        border-radius: 4px;
    }

    .info-list {
        grid-template-columns: 1fr;
    }

    .info-list dt {
        margin-top: 10px;
    }
}

/* ============================================
   Rating & Reviews
   ============================================ */

/* Stars */
.star {
    color: var(--border);
    font-size: 16px;
    line-height: 1;
}

.star-filled {
    color: #f5a623;
}

.star-empty {
    color: var(--border);
}

/* Rating summary (inline in cards) */
.rating-summary-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.rating-stars-big {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.rating-stars-big .star {
    font-size: 20px;
}

.rating-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--navy-darker);
    margin-left: 8px;
}

.rating-count {
    font-size: 13px;
    color: var(--text-muted);
}

/* Rating card (sidebar) */
.sidebar-rating {
    text-align: center;
    padding: 16px;
    background: var(--navy-lighter);
    border-radius: var(--r-8);
    margin-bottom: 16px;
}

.sidebar-rating-stars {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-bottom: 8px;
}

.sidebar-rating-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--navy-darker);
    line-height: 1;
}

.sidebar-rating-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Big rating display (like 78/100) */
.rating-score {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--green);
    letter-spacing: -1px;
    line-height: 1;
}

.rating-score-max {
    font-size: 1.125rem;
    color: var(--text-muted);
    font-weight: 500;
}

.rating-level {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--green-light);
    color: var(--green);
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

/* Review preview cards */
.reviews-preview {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
}

.review-preview-card {
    padding: 14px;
    background: var(--bg-alt);
    border-radius: var(--r-8);
    border: 1px solid var(--border-light);
}

.review-preview-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    font-size: 13px;
}

.review-preview-rating .star {
    font-size: 12px;
}

.review-preview-author {
    font-weight: 600;
    color: var(--text);
}

.review-preview-date {
    color: var(--text-light);
    font-size: 12px;
    margin-left: auto;
}

.review-preview-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.review-preview-content {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.reviews-count {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.no-reviews-text {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 16px;
}

.reviews-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* ============================================
   Favorites (Обране)
   ============================================ */
.favorite-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-6);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.favorite-btn:hover {
    border-color: var(--red);
    color: var(--red);
}

.favorite-btn.is-favorited {
    background: var(--red-light);
    border-color: var(--red);
    color: var(--red);
}

.favorite-btn svg {
    width: 16px;
    height: 16px;
}

.favorite-btn.is-favorited svg {
    fill: var(--red);
}

/* ============================================
   Quick Filters (pill tabs)
   ============================================ */
.quick-filters {
    margin: 24px 0;
}

.quick-filters-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.filter-chip:hover {
    border-color: var(--navy);
    color: var(--navy);
    text-decoration: none;
}

.filter-chip.active {
    background: var(--navy);
    border-color: var(--navy);
    color: #fff;
}

.filter-chip-count {
    background: var(--bg-soft);
    color: var(--text-muted);
    padding: 2px 8px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 600;
}

.filter-chip.active .filter-chip-count {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.filter-chip-icon {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.filter-chip-icon-vs    { background: var(--green); }
.filter-chip-icon-ksu   { background: #2874a6; }
.filter-chip-icon-apel  { background: var(--purple); }
.filter-chip-icon-local { background: #a04668; }
.filter-chip-icon-gosp  { background: var(--amber); }
.filter-chip-icon-adm   { background: #1abc9c; }

/* Active filters tags */
.active-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 16px;
    background: var(--navy-lighter);
    border-radius: var(--r-8);
    margin-bottom: 20px;
    font-size: 13px;
}

.active-filters-label {
    color: var(--text-muted);
    font-weight: 500;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
}

.remove-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    transition: all 0.15s ease;
}

.remove-filter:hover {
    background: var(--red-light);
    color: var(--red);
    text-decoration: none;
}

/* Results header */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.results-info {
    font-size: 14px;
    color: var(--text-muted);
}

.results-info strong {
    color: var(--text);
    font-weight: 700;
}

/* Courts grid */
.courts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 16px;
}

.court-card-new {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-12);
    padding: 20px;
    transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.court-card-new:hover {
    border-color: var(--navy);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.court-card-header {
    display: flex;
    gap: 14px;
    margin-bottom: 14px;
}

.court-tile {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    background: var(--navy);
}

.court-tile svg {
    width: 24px;
    height: 24px;
}

.court-tile-vs    { background: var(--green); }
.court-tile-ksu   { background: #2874a6; }
.court-tile-apel  { background: var(--purple); }
.court-tile-local { background: #a04668; }
.court-tile-gosp  { background: var(--amber); }
.court-tile-adm   { background: #1abc9c; }

.court-card-title {
    flex: 1;
    min-width: 0;
}

.court-card-title .court-name {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.3;
}

.court-card-title .court-name a {
    color: var(--text);
}

.court-card-title .court-name a:hover {
    color: var(--navy);
}

.court-card-title .chip {
    font-size: 11px;
}

.chip-vs    { background: var(--green-light); color: var(--green); }
.chip-ksu   { background: #e1eef7; color: #2874a6; }
.chip-apel  { background: var(--purple-light); color: var(--purple); }
.chip-local { background: #f7e8ee; color: #a04668; }
.chip-gosp  { background: var(--amber-light); color: var(--amber); }
.chip-adm   { background: #e0f5f1; color: #1abc9c; }

.court-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.court-info-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.court-info-row svg {
    flex-shrink: 0;
    color: var(--text-light);
    margin-top: 2px;
}

.court-card-footer {
    display: flex;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
}

/* Quick links in sidebar */
.quick-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quick-links li {
    border-bottom: 1px solid var(--border-light);
}

.quick-links li:last-child {
    border-bottom: none;
}

.quick-links a {
    display: flex;
    align-items: center;
    padding: 10px 0;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.quick-links a:hover {
    color: var(--navy);
}

/* Filter actions */
.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--r-12);
}

.empty-state-icon {
    color: var(--text-light);
    margin-bottom: 16px;
}

.empty-state h3 {
    color: var(--text);
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.empty-state p {
    color: var(--text-muted);
    margin: 0;
    font-size: 14px;
}

.empty-state a {
    color: var(--navy);
}

@media (max-width: 768px) {
    .quick-filters-row {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 12px;
        margin: 0 -16px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .courts-grid {
        grid-template-columns: 1fr;
    }
}
