:root {
    --primary:   #1566B7;
    --primary-d: #0d47a1;
    --gold:      #FFD54F;
    --bg-light:  #f8faff;
    --text:      #2c3e50;
    --muted:     #5f738c;
    --border:    #e5efff;
}

.of-page-wrapper {
    background: var(--bg-light);
    min-height: 60vh;
    padding-bottom: 60px;
}

/* Top header */
.of-header {
    background: linear-gradient(135deg, var(--primary-d) 0%, var(--primary) 100%);
    padding: 64px 0 52px;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}
.of-header::before {
    content: '';
    position: absolute;
    width: 440px; height: 440px;
    right: -120px; top: -120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}
.of-header::after {
    content: '';
    position: absolute;
    width: 320px; height: 320px;
    left: -80px; bottom: -80px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    pointer-events: none;
}
.of-header-inner { position: relative; z-index: 2; }
.of-header-tag {
    display: inline-block;
    color: var(--gold);
    background: rgba(255,213,79,0.12);
    border: 1px solid rgba(255,213,79,0.25);
    padding: 5px 16px; border-radius: 20px;
    margin-bottom: 16px;
    font-size: 11px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase;
}
.of-header h1 {
    font-family: 'Playfair Display', serif;
    color: #fff;
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 12px;
}
.of-header h1 em { font-style: italic; color: var(--gold); }
.of-header-sub {
    font-size: 15px; font-weight: 300;
    color: rgba(255,255,255,0.6);
    margin-bottom: 0; max-width: 580px;
}
.of-header .breadcrumb {
    background: transparent;
    padding: 0; margin-bottom: 20px;
    font-size: 13px;
}
.of-header .breadcrumb a { color: rgba(255,255,255,0.65); text-decoration: none; }
.of-header .breadcrumb a:hover { color: var(--gold); }
.of-header .breadcrumb-item.active { color: #fff; }
.of-header .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,0.35); }

/* Tab nav */
.of-tabs-bar {
    background: var(--primary-d);
    border-bottom: 3px solid var(--gold);
    overflow-x: auto;
    white-space: nowrap;
}
.of-tabs-bar::-webkit-scrollbar { height: 3px; }
.of-tabs-bar::-webkit-scrollbar-track { background: var(--primary-d); }
.of-tabs-bar::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; }

.of-tabs-bar .nav-tabs {
    border: none;
    display: inline-flex;
    flex-wrap: nowrap;
    padding: 0 16px;
}
.of-tabs-bar .nav-tabs .nav-item .nav-link {
    color: rgba(255,255,255,.72);
    border: none;
    border-radius: 0;
    padding: 14px 22px 11px;
    font-size: .93rem;
    font-weight: 500;
    letter-spacing: .2px;
    position: relative;
    transition: color .2s;
    background: transparent;
    white-space: nowrap;
}
.of-tabs-bar .nav-tabs .nav-item .nav-link:hover {
    color: #fff;
}
.of-tabs-bar .nav-tabs .nav-item .nav-link.active {
    color: #fff;
    background: transparent;
}
.of-tabs-bar .nav-tabs .nav-item .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0; right: 0;
    height: 3px;
    background: var(--gold);
}

/* Content */
.of-content {
    padding: 40px 0 20px;
}
.of-section-title {
    font-family: 'Playfair Display', serif;
    color: var(--primary-d);
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    display: inline-block;
}

/* Download table */
.of-download-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(21,102,183,.07);
    border: 1px solid var(--border);
    margin-bottom: 32px;
}
.of-download-table thead tr {
    background: linear-gradient(135deg, var(--primary-d), var(--primary));
    color: #fff;
}
.of-download-table thead th {
    padding: 14px 18px;
    font-size: .92rem;
    font-weight: 600;
    letter-spacing: .2px;
}
.of-download-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background .18s;
}
.of-download-table tbody tr:last-child { border-bottom: none; }
.of-download-table tbody tr:hover { background: #f0f6ff; }
.of-download-table tbody td {
    padding: 13px 18px;
    font-size: .92rem;
    color: var(--text);
    vertical-align: middle;
}
.of-download-table tbody td:first-child {
    width: 48px;
    font-weight: 700;
    color: var(--primary);
    text-align: center;
}
.of-download-table .btn-download {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: linear-gradient(135deg, var(--primary-d), var(--primary));
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 18px;
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .18s, transform .15s;
    letter-spacing: .3px;
}
.of-download-table .btn-download:hover {
    opacity: .88;
    color: #fff;
    transform: translateY(-1px);
}
.of-download-table .btn-download svg {
    width: 15px; height: 15px; flex-shrink: 0;
}

/* Level badge */
.of-level-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-d), var(--primary));
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    letter-spacing: .8px;
    margin-bottom: 14px;
    text-transform: uppercase;
}

/* Document rule card */
.of-doc-content {
    background: #fff;
    border-radius: 14px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(21,102,183,.07);
    padding: 32px 36px;
}
.of-doc-content h4 {
    color: var(--primary-d);
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    margin-bottom: 14px;
}
.of-doc-content p, .of-doc-content li {
    font-size: .93rem;
    color: var(--text);
    line-height: 1.75;
}
.of-doc-content a { color: var(--primary); text-decoration: underline dotted; }
.of-doc-content a:hover { color: var(--primary-d); }

/* Malaka card links */
.of-link-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}
.of-link-card {
    flex: 1 1 220px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px 24px;
    text-decoration: none;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color .2s, box-shadow .2s, transform .2s;
    font-weight: 600;
    font-size: .95rem;
}
.of-link-card:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 24px rgba(21,102,183,.11);
    transform: translateY(-3px);
    color: var(--primary-d);
    text-decoration: none;
}
.of-link-card .of-link-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-d), var(--primary));
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(21,102,183,.28);
}
.of-link-card .of-link-icon svg {
    width: 22px; height: 22px; color: #fff;
}

/* Sidebar */
.of-sidebar {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(21,102,183,.07);
    padding: 0;
    overflow: hidden;
}
.of-sidebar .of-sidebar-title {
    background: linear-gradient(135deg, var(--primary-d), var(--primary));
    color: var(--gold);
    padding: 13px 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.of-sidebar .list-group-item {
    border-left: none; border-right: none;
    border-radius: 0 !important;
    padding: 11px 20px;
    font-size: .88rem;
    color: var(--text);
    transition: background .15s, color .15s;
}
.of-sidebar .list-group-item:first-child { border-top: none; }
.of-sidebar .list-group-item.active {
    background: linear-gradient(90deg, #e8f1ff, #f0f6ff);
    color: var(--primary);
    font-weight: 600;
    border-left: 3px solid linear-gradient(180deg, var(--primary-d), var(--primary));
    padding-left: 17px;
    position: relative;
}
.of-sidebar .list-group-item.active::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary-d), var(--primary));
    border-radius: 0 2px 2px 0;
}
.of-sidebar .list-group-item:hover:not(.active) {
    background: #f0f6ff;
    color: var(--primary);
}
.of-sidebar .list-group-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Animated entrance */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.tab-pane.active { animation: fadeUp .3s ease; }


/* =============================================
   lex.uz qonun matni uchun CSS
   oquv-faoliyat.css ga qo'shing
   ============================================= */

/* Asosiy wrapper */
.lex-law-content {
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-size: .93rem;
    color: var(--text, #2c3e50);
    line-height: 1.8;
}

/* Qonun shakli (sarlavha yuqori) */
.lex-law-content .ACT_FORM {
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--muted, #5f738c);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* Qonun asosiy nomi */
.lex-law-content .ACT_TITLE {
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-d, #0d47a1);
    margin-bottom: 10px;
}

/* Parlament grifi (qabul qilgan organ) */
.lex-law-content .GRIF_PARLAMENT {
    text-align: center;
    font-size: .85rem;
    color: var(--muted, #5f738c);
    font-style: italic;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border, #e5efff);
}

/* Bob sarlavhalari (1-bob, 2-bob ...) */
.lex-law-content .TEXT_HEADER_DEFAULT {
    background: linear-gradient(135deg, var(--primary-d, #0d47a1), var(--primary, #1566B7));
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: .95rem;
    font-weight: 700;
    margin-top: 28px;
    margin-bottom: 14px;
    letter-spacing: .2px;
}

.lex-law-content .TEXT_HEADER_DEFAULT a {
    color: #fff !important;
    text-decoration: none;
}

/* Modda sarlavhalari (1-modda, 2-modda ...) */
.lex-law-content .CLAUSE_DEFAULT {
    font-weight: 700;
    color: var(--primary, #1566B7);
    font-size: .95rem;
    margin-top: 18px;
    margin-bottom: 6px;
    padding-left: 4px;
    border-left: 3px solid var(--primary, #1566B7);
    padding-left: 10px;
}

.lex-law-content .CLAUSE_DEFAULT a {
    color: var(--primary, #1566B7) !important;
    text-decoration: none;
}

/* Modda matni */
.lex-law-content .ACT_TEXT {
    margin-bottom: 6px;
    padding: 4px 0 4px 13px;
    border-left: 2px solid transparent;
    transition: border-color .15s, background .15s;
    border-radius: 0 4px 4px 0;
}

.lex-law-content .ACT_TEXT:hover {
    border-left-color: var(--border, #e5efff);
    background: #f8faff;
}

.lex-law-content .ACT_TEXT a {
    color: inherit;
    text-decoration: none;
}

/* Bo'sh separator qatorlar */
.lex-law-content .BY_DEFAULT {
    margin: 2px 0;
}

/* Ichki havolalar */
.lex-law-content a[href*="lex.uz"] {
    color: var(--primary, #1566B7);
    text-decoration: underline dotted;
    transition: color .15s;
}

.lex-law-content a[href*="lex.uz"]:hover {
    color: var(--primary-d, #0d47a1);
    text-decoration: underline;
}

/* Xatolik (fallback) holati */
.lex-law-fallback {
    text-align: center;
    padding: 32px;
    color: var(--muted, #5f738c);
    font-style: italic;
}

.lex-law-fallback a {
    color: var(--primary, #1566B7);
    font-weight: 600;
}

/* Loading holati */
.lex-law-loading {
    text-align: center;
    padding: 40px;
    color: var(--muted, #5f738c);
}

/* Responsive */
@media (max-width: 576px) {
    .lex-law-content {
        font-size: .88rem;
    }
    .lex-law-content .ACT_TITLE {
        font-size: 1.2rem;
    }
    .lex-law-content .TEXT_HEADER_DEFAULT {
        font-size: .88rem;
        padding: 8px 14px;
    }
}