:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --border-radius: 12px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--gray-900);
    background: #f4f6fb;
    min-height: 100vh;
}

/* App Shell */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: #0f172a;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.sidebar-brand .logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-weight: 700;
    color: #e2e8f0;
    font-size: 16px;
}

.logo-subtitle {
    font-size: 11px;
    color: #94a3b8;
}

.sidebar-toggle {
    border: none;
    background: transparent;
    color: #e2e8f0;
    font-size: 18px;
    cursor: pointer;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nav-section {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    margin: 16px 0 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.sidebar-link .icon {
    width: 20px;
    text-align: center;
}

.sidebar-link:hover {
    background: rgba(148, 163, 184, 0.15);
    color: #ffffff;
}

.sidebar-link.active {
    background: #1e293b;
    color: #ffffff;
}

.sidebar-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.user-meta {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 13px;
    color: #e2e8f0;
    font-weight: 600;
}

.user-logout {
    font-size: 12px;
    color: #94a3b8;
    text-decoration: none;
}

.user-logout:hover {
    color: #ffffff;
}

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #ffffff;
    border-bottom: 1px solid var(--gray-200);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-search {
    width: 260px;
    padding: 8px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
}

.topbar-search:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.sidebar-toggle.mobile {
    display: none;
    color: var(--gray-900);
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--gray-200);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-link {
    padding: 0.5rem 1rem;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

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

.nav-link.active {
    background: var(--primary);
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Container */
.container {
    max-width: none;
    width: 100%;
    margin: 1.5rem auto;
    padding: 0 24px;
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 1px solid var(--gray-200);
}

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

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.primary {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(139, 92, 246, 0.1));
    color: var(--primary);
}

.stat-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-top: 0.5rem;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* Search & Filters */
.search-bar {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
}

.filter-select {
    padding: 0.625rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Table */
.table-container {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--gray-200);
}

.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    text-decoration: none;
    color: var(--gray-700);
    margin-right: 6px;
}

.page-btn:hover {
    background: var(--gray-100);
}

.pagination-info {
    font-size: 13px;
    color: var(--gray-600);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

table th,
table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-700);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

table tbody tr {
    transition: all 0.2s;
}

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

table tbody tr:last-child td {
    border-bottom: none;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.btn-success:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-300);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary);
    color: white;
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
}

.badge-activ {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.badge-suspendat {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.badge-inchis {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.badge-creditor {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.badge-debitor {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.badge-tert {
    background: rgba(107, 114, 128, 0.1);
    color: var(--gray-600);
}

/* Messages */
.messages {
    margin-bottom: 1.5rem;
    animation: slideIn 0.3s ease-out;
}

.message {
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
    animation: slideIn 0.3s ease-out;
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border-left: 4px solid var(--success);
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.message.warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.message.info {
    background: rgba(37, 99, 235, 0.1);
    color: #1e40af;
    border-left: 4px solid var(--primary);
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-item {
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.info-item strong {
    display: block;
    color: var(--gray-600);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-item-value {
    font-size: 1rem;
    color: var(--gray-900);
    font-weight: 500;
}

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

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

.form-group label span {
    color: var(--danger);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-control.error {
    border-color: var(--danger);
}

.form-help {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.875rem;
    color: var(--danger);
    margin-top: 0.25rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-600);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Loading */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 1200;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle.mobile {
        display: inline-flex;
    }

    .topbar-search {
        width: 160px;
    }

    .container {
        padding: 0 1rem;
    }

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

    .card {
        padding: 1.5rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .btn-group {
        width: 100%;
    }

    .btn {
        flex: 1;
        justify-content: center;
    }

    table {
        font-size: 0.875rem;
    }

    table th,
    table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Utility Classes */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-600); }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.font-bold { font-weight: 700; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Case detail layout */
.case-shell {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.case-header {
    background: #f8fafc;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.case-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.case-badge {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: #1f2937;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.case-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--gray-900);
}

.case-status {
    display: flex;
    gap: 8px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.badge-neutral {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
}

.case-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.case-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    background: #ffffff;
    border-bottom: 1px solid var(--gray-200);
    padding: 0 8px;
}

.case-tab {
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.06em;
    padding: 14px 2px;
    color: var(--gray-600);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.case-tab.active {
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
}

.case-section {
    scroll-margin-top: 90px;
}

.section-card {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--gray-600);
    margin-bottom: 16px;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-muted {
    color: var(--gray-600);
}

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

.role-card {
    background: #ffffff;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.role-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.role-title {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--primary);
    color: #ffffff;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.role-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--gray-200);
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

.role-add:hover {
    background: var(--gray-50);
}

.role-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.role-item {
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
}

.role-name {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-weight: 600;
}

.role-name a {
    color: var(--gray-900);
    text-decoration: none;
}

.role-meta {
    font-size: 12px;
    color: var(--gray-600);
    font-weight: 500;
}

.role-details {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--gray-600);
}

.role-empty {
    color: var(--gray-600);
    font-size: 13px;
    padding: 12px;
}

.section-block {
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    background: #fff;
}

.block-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.block-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.block-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.table-clean th {
    background: #f8fafc;
}

.note-empty {
    padding: 16px;
    color: var(--gray-600);
    background: var(--gray-50);
    border: 1px dashed var(--gray-200);
    border-radius: 10px;
    font-size: 14px;
}

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

.split-card {
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 14px;
    background: var(--gray-50);
}

.split-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    margin-bottom: 10px;
}

.template-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.variable-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid var(--gray-200);
    font-size: 12px;
    color: var(--gray-700);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 24px;
}

.modal-overlay.open {
    display: flex;
}

.modal-card {
    background: #ffffff;
    border-radius: 14px;
    width: min(900px, 95vw);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    color: var(--gray-600);
}

.modal-body {
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.modal-row label,
.modal-grid label,
.modal-grid-3 label {
    display: block;
    font-size: 12px;
    color: var(--gray-600);
    margin-bottom: 6px;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.modal-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.modal-actions {
    padding: 16px 22px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--gray-200);
    background: #f9fafb;
}

.section-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.section-total {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 12px;
}

.claim-table td {
    vertical-align: middle;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 6px;
}

.row-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
}

.party-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.party-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray-700);
}

.party-item input {
    width: 16px;
    height: 16px;
}

.modal-body select[name="creditor_party"],
.modal-body select[name="debtor_party"] {
    display: none;
}

.input-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.input-group .form-control {
    flex: 1;
}

.input-group .currency-select {
    max-width: 120px;
}

.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.filter-bar .input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #fff;
    font-size: 13px;
    color: var(--gray-700);
}

.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.borderou-shell {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.borderou-hero {
    padding: 18px 22px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.borderou-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20px 20px, rgba(255,255,255,0.08) 2px, transparent 2px),
        radial-gradient(circle at 60px 60px, rgba(255,255,255,0.08) 2px, transparent 2px),
        radial-gradient(circle at 100px 30px, rgba(255,255,255,0.06) 2px, transparent 2px);
    background-size: 120px 120px;
    opacity: 0.8;
    pointer-events: none;
}

.borderou-hero-top {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.borderou-title {
    font-size: 20px;
    font-weight: 700;
}

.borderou-subtitle {
    font-size: 12px;
    opacity: 0.85;
}

.borderou-toggle {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 12px;
    cursor: pointer;
}

.borderou-filters {
    position: relative;
    z-index: 1;
}

.borderou-filters.collapsed {
    display: none;
}

.borderou-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.borderou-input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.4);
    background: #ffffff;
    font-size: 13px;
    color: var(--gray-700);
}

.borderou-filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.borderou-hero-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn.btn-light {
    background: #ffffff;
    color: #1e3a8a;
    border: none;
}

.borderou-select-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.borderou-select-scroll {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 10px;
    background: #f9fafb;
}

.borderou-select-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    font-size: 13px;
    color: var(--gray-700);
}

.borderou-select-item input {
    width: 16px;
    height: 16px;
}

.borderou-table-card {
    padding-top: 18px;
}

.borderou-table td {
    vertical-align: top;
}

.borderou-pagination {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    padding: 12px 6px 4px;
    color: var(--gray-600);
    font-size: 12px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--gray-200);
    background: #fff;
    color: var(--gray-700);
    text-decoration: none;
}

.page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    margin-right: 8px;
}

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

@media (max-width: 768px) {
    .case-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .case-header-actions {
        width: 100%;
    }

    .case-tabs {
        gap: 12px;
    }
}
