:root {
    --primary: #110a5c;
    --primary-dark: #110a5c;
    --bg-soft: #eef2f6;
    --card-border: #dbe2ea;
    --text-muted: #6c7b8c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    color: #1f2937;
    background: var(--bg-soft);
}

.login-page {
    min-height: 100vh;
    background: linear-gradient(174deg, var(--primary) 0 42%, #d7dde5 42% 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(23, 33, 52, 0.12);
    border: 1px solid #e5eaf0;
    padding: 26px;
}

.login-logo-wrap {
    width: 100%;
    max-width: 200px;
    height: 88px;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo-img {
    max-width: 100%;
    max-height: 88px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.logo-badge {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 24px;
    font-weight: 700;
}

.login-title {
    text-align: center;
    color: var(--primary);
    margin: 0;
}

.login-subtitle {
    text-align: center;
    margin: 6px 0 22px;
    color: var(--text-muted);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.login-links {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #e6ebf2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.login-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border-radius: 10px;
    border: 1px solid #d6deea;
    background: #f8fafe;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all .2s ease;
}

.login-link-btn:hover {
    background: #eef3ff;
    border-color: #c3d0e6;
    color: var(--primary);
}

.login-link-btn--ghost {
    background: #fff;
}

.login-site-link-wrap {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #e1e7f0;
}

.internal-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
    align-items: stretch;
}

.sidebar {
    background: #fff;
    border-right: 1px solid var(--card-border);
    padding: 0;
}

.sidebar-inner {
    padding: 22px 16px;
    position: sticky;
    top: 0;
}

.sidebar-brand {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 1.05rem;
    line-height: 1.2;
}

.sidebar-brand-mark {
    font-size: 1.25rem;
}

.sidebar-nav-heading {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 18px 0 8px;
    font-weight: 700;
}

.sidebar-nav-heading:first-of-type {
    margin-top: 0;
}

.sidebar-nav a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: #364152;
    text-decoration: none;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.95rem;
}

.sidebar-nav a.active {
    background: var(--primary);
    color: #fff;
}

.sidebar-nav a:hover:not(.active) {
    background: #edf3fb;
}

.sidebar-link-muted {
    color: var(--text-muted) !important;
    font-weight: 600;
}

.main-with-sidebar {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.content {
    padding: 28px;
    flex: 1;
}

.layout-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 1030;
}

body.layout-sidebar-open .layout-backdrop {
    display: block;
}

.topbar-mobile {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #fff;
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-mobile-title {
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 0.95rem;
}

.topbar-mobile-btn {
    flex-shrink: 0;
}

.page-title {
    color: var(--primary-dark);
    margin: 0;
}

.page-subtitle {
    color: var(--text-muted);
    margin: 6px 0 22px;
}

.grid-docs {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 18px;
}

.panel,
.doc-card {
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(31, 41, 55, 0.05);
}

.panel {
    padding: 16px;
}

.doc-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.doc-card {
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.doc-title {
    font-size: 24px;
}

.chip {
    font-size: 12px;
    background: #f4f6f8;
    border-radius: 999px;
    padding: 3px 10px;
    margin-right: 6px;
}

@media (max-width: 991.98px) {
    .layout-responsive.internal-layout {
        display: block;
        position: relative;
    }

    .layout-responsive .main-with-sidebar {
        width: 100%;
    }

    .layout-responsive .topbar-mobile {
        display: flex;
    }

    .layout-responsive .content {
        padding: 18px 16px 28px;
    }

    .grid-docs {
        grid-template-columns: 1fr;
    }
}
