:root {
    --sidebar-width: 240px;
    --topnav-height: 56px;
    --primary: #1a3a5c;
    --primary-dark: #122840;
    --accent: #2980b9;
    --sidebar-bg: #f8f9fa;
    --sidebar-border: #dee2e6;
    --sidebar-link-active: #1a3a5c;
    --sidebar-link-hover: #e9ecef;
}

body {
    background-color: #f0f2f5;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* --- Topnav --- */
#topnav {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    height: var(--topnav-height);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 1030;
}

#topnav .navbar-brand {
    font-size: 1.1rem;
    letter-spacing: 0.02em;
}

/* --- Sidebar --- */
#wrapper {
    padding-top: var(--topnav-height);
    min-height: 100vh;
}

#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    min-height: calc(100vh - var(--topnav-height));
    background: #fff;
    border-right: 1px solid var(--sidebar-border);
    padding: 1.5rem 0;
    position: sticky;
    top: var(--topnav-height);
    height: calc(100vh - var(--topnav-height));
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 1rem 0.75rem 1rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
}

.sidebar-nav {
    margin: 0;
    padding: 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    color: #495057;
    text-decoration: none;
    border-radius: 0;
    font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--sidebar-link-hover);
    color: var(--primary);
}

.sidebar-link.active {
    background: #e8f0fe;
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

/* --- Page content --- */
#page-content-wrapper {
    flex: 1;
    min-width: 0;
}

/* --- Cards --- */
.card {
    border: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-radius: 10px;
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 10px 10px 0 0 !important;
    padding: 1rem 1.25rem;
}

/* --- Page title --- */
.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

/* --- Company result panel --- */
.company-status-badge {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
}

.detail-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.detail-value {
    font-size: 0.95rem;
    color: #212529;
    font-weight: 500;
}

/* --- Stats cards (admin) --- */
.stat-card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

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

/* --- Auth pages --- */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.auth-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.02em;
}

/* --- Tables --- */
.table th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6c757d;
    font-weight: 600;
    border-top: none;
}

/* --- Search input --- */
.search-input-lg {
    border-radius: 10px 0 0 10px;
    border: 2px solid #dee2e6;
    font-size: 1.1rem;
    padding: 0.65rem 1rem;
    letter-spacing: 0.1em;
}

.search-input-lg:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 0.2rem rgba(41, 128, 185, 0.15);
}

.btn-search {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    border: none;
    border-radius: 0 10px 10px 0;
    font-weight: 600;
    padding: 0.65rem 1.5rem;
}

.btn-search:hover {
    opacity: 0.9;
    color: #fff;
}

/* --- Status colors --- */
.status-active { color: #198754; }
.status-dissolved { color: #dc3545; }
.status-liquidation { color: #fd7e14; }

/* --- Section card headers --- */
.section-header {
    background: #f8f9fb;
    border-bottom: 1px solid #edf0f3;
    padding: 0.65rem 1.25rem;
    font-size: 0.875rem;
}

/* --- Form controls refinements --- */
.form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.3rem;
}

/* --- Sidebar submenu / collapsible --- */
.sidebar-link-toggle {
    cursor: pointer;
    user-select: none;
}

.sidebar-link-toggle .toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.sidebar-link-toggle[aria-expanded="true"] .toggle-icon {
    transform: rotate(-180deg);
}

.sidebar-submenu {
    background: #f8f9fb;
    border-left: 3px solid #dee2e6;
    margin-left: 0;
    padding: 0.25rem 0;
}

.sidebar-sublink {
    display: flex;
    align-items: center;
    padding: 0.45rem 1rem 0.45rem 1.75rem;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.84rem;
    transition: background 0.15s, color 0.15s;
}

.sidebar-sublink:hover {
    background: var(--sidebar-link-hover);
    color: var(--primary);
}

.sidebar-sublink.active {
    color: var(--primary);
    font-weight: 600;
    background: #e8f0fe;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    #sidebar {
        display: none;
    }
}
