body {
    min-height: 100vh;
}

.brand-panel {
    background: linear-gradient(135deg, #0d6efd, #084298);
}

.stat-card {
    border-radius: 0.75rem;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 576px) {
    .btn { min-height: 44px; }
}

/* Auth pages (login/register/forgot-reset password): one centered card
   instead of a full-width split layout. */
.auth-wrapper {
    min-height: calc(100vh - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 380px;
}

/* ── Left sidebar (logged-in layout) ──────────────────────────────
   Same navy sidebar as the finopsdhan sibling project, independent of the
   light/dark content theme toggle. */
:root {
    --sidebar-w: 240px;
    --topbar-h: 56px;
    --sidebar-navy: #1e3a5f;
    --sidebar-navy-light: #2d5a8e;
}

body.has-sidebar {
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-w);
    background: var(--sidebar-navy);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.sidebar-brand {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    min-height: var(--topbar-h);
    flex-shrink: 0;
}

.sidebar-brand .brand-icon {
    font-size: 1.2rem;
}

.sidebar-brand .brand-text {
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1.15;
}

.sidebar-brand .brand-text span {
    display: block;
    font-weight: 500;
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.55);
}

.sidebar-user {
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.sidebar-user-info {
    overflow: hidden;
    flex: 1;
}

.sidebar-user-email {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0;
}

.sidebar-nav .nav-link-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s;
}

.sidebar-nav .nav-link-item i {
    width: 18px;
    text-align: center;
    font-size: 1rem;
}

.sidebar-nav .nav-link-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-nav .nav-link-item.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-left-color: var(--accent-color, #4dabf7);
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-footer button,
.sidebar-footer a {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    border-radius: 8px;
    padding: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}

.sidebar-footer button:hover,
.sidebar-footer a:hover {
    background: rgba(220, 53, 69, 0.3);
    color: #fff;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1040;
}

.sidebar-overlay.show {
    display: block;
}

.app-topbar {
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    padding: 0 12px;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.app-topbar #sidebarToggle {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--sidebar-navy);
    padding: 6px;
    border-radius: 8px;
}

[data-bs-theme="dark"] .app-topbar #sidebarToggle {
    color: var(--bs-body-color);
}

.app-topbar .topbar-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.app-main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        left: calc(-1 * var(--sidebar-w));
        transition: left 0.25s ease;
    }

    .app-sidebar.mobile-open {
        left: 0;
    }

    .app-main-content {
        margin-left: 0;
    }
}

/* Notes page: keep the user's line breaks, wrap long unbroken strings
   (URLs, hashes) instead of overflowing the card on mobile. */
.note-body {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
