/* AbbyManager app theme — warm, rounded look layered on top of Bootstrap 5. */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&display=swap');

:root {
    /* Brand palette — shared across the logo, this app, and the Oakling site */
    --bs-primary: #4a148c;
    --bs-primary-rgb: 74, 20, 140;
    --brand-purple-dark: #2f1c54;
    --brand-purple-soft: #efe6f7;
    --brand-blue: #71badb;
    --brand-blue-soft: #d8ecf8;
    --brand-gold: #f0da8e;
    --brand-gold-soft: #f6e7c8;
    --brand-green: #47a275;
    --brand-green-soft: #dcf0e2;
    --bg-cream: #fbf7f0;
    --card-border: #efe6f5;
    --ink: #2a1f3d;
    --ink-soft: #4d4262;
    --ink-muted: #7a6c90;
    --ink-faint: #9a8fae;
}

body {
    font-family: 'Nunito', 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-cream) !important;
}

.material-symbols-rounded {
    font-family: 'Material Symbols Rounded';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    vertical-align: middle;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-weight: 800;
}

.bg-primary { background-color: var(--bs-primary) !important; }
.text-primary { color: var(--bs-primary) !important; }
.border-primary { border-color: var(--bs-primary) !important; }

.btn-primary {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.btn-primary:hover {
    background-color: var(--brand-purple-dark);
    border-color: var(--brand-purple-dark);
}
.btn-outline-primary {
    color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.btn-outline-primary:hover {
    background-color: var(--bs-primary);
    color: #fff;
}
.btn {
    border-radius: 0.75rem;
    font-weight: 600;
}
.btn-sm {
    border-radius: 0.6rem;
}

/* Softer, cosier cards */
.card {
    border: 1px solid var(--card-border);
    border-radius: 1rem;
}
.card-header {
    border-radius: 1rem 1rem 0 0 !important;
}
.shadow-sm {
    box-shadow: 0 2px 10px rgba(74, 20, 140, 0.06) !important;
}

.list-group-item.active {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}

.badge.bg-warning { background-color: var(--brand-gold) !important; color: #6b5310; }
.badge.bg-info { background-color: var(--brand-blue) !important; color: #073a4c; }
.badge.bg-success { background-color: var(--brand-green) !important; }

/* ---------- Top navigation ---------- */
.navbar {
    background-color: var(--bs-primary) !important;
    border-radius: 0;
    border-bottom: 3px solid var(--brand-gold);
    box-shadow: 0 6px 20px rgba(42, 31, 61, 0.22);
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.navbar-brand-logo {
    height: 60px;
    width: auto;
    display: block;
}

.nav-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.nav-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 4.6rem;
    padding: 0.65rem 0.65rem;
    border-radius: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    text-align: center;
    position: relative;
    border: none;
    background: transparent;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-tile i {
    font-size: 1.6rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.nav-tile span {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    white-space: nowrap;
}

.nav-tile:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--brand-gold);
    transform: translateY(-1px);
}

.nav-tile.active {
    background: linear-gradient(135deg, rgba(240, 218, 142, 0.22), rgba(113, 186, 219, 0.14));
    box-shadow: inset 0 0 0 1px rgba(240, 218, 142, 0.45);
    color: var(--brand-gold);
}

.nav-tile.active i,
.nav-tile.active span {
    color: var(--brand-gold) !important;
}

.nav-tile.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 55%;
    height: 2px;
    border-radius: 2px;
    background: var(--brand-gold);
    box-shadow: 0 0 8px rgba(240, 218, 142, 0.6);
}

/* ---------- Standalone login page ---------- */
.login-body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--brand-purple-dark) 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    padding: 2.5rem 2.25rem;
}

.login-logo {
    height: 125px;
    width: auto;
}

.login-brand-title {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--bs-primary);
    line-height: 1;
    margin-top: 0.25rem;
}

.login-brand-subtitle {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #6c757d;
}

.login-heading {
    text-align: center;
    font-weight: 800;
    color: var(--bs-primary);
    font-size: 1.15rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--card-border);
}

/* ---------- List + detail section shell (Clients, Sessions, etc.) ---------- */
.ld-shell {
    display: flex;
    align-items: stretch;
    min-height: calc(100vh - 220px);
    background: #fff;
    border: 1px solid var(--card-border);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(74, 20, 140, 0.06);
}

.ld-sidebar {
    width: 340px;
    flex: 0 0 340px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--card-border);
    background: var(--bg-cream);
}

.ld-sidebar-header {
    padding: 1.1rem 1.1rem 0.9rem;
    border-bottom: 1px solid var(--card-border);
}

.ld-sidebar-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.ld-filter-form {
    flex: 1 1 auto;
    min-width: 0;
}

.ld-sort-select {
    width: 100%;
    border: none;
    background: #fff;
    color: var(--bs-primary);
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 0.6rem;
    padding: 0.5rem 0.65rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    cursor: pointer;
}

.ld-search-toggle {
    border: none;
    background: transparent;
    color: var(--bs-primary);
    font-size: 1.05rem;
    padding: 0.3rem 0.45rem;
    border-radius: 0.5rem;
    line-height: 1;
    flex: 0 0 auto;
}
.ld-search-toggle:hover {
    background: var(--brand-purple-soft);
}

.ld-search-box {
    margin-top: 0.75rem;
    position: relative;
}
.ld-search-box .input-group {
    border-radius: 0.7rem;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}
.ld-search-box .input-group-text {
    background: #fff;
    border: none;
    color: var(--bs-primary);
    cursor: pointer;
}
.ld-search-box .input-group-text:hover {
    background: var(--brand-purple-soft);
}
.ld-search-box .form-control {
    border: none;
    box-shadow: none;
}

.ld-autocomplete-results {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: #fff;
    border-radius: 0.7rem;
    box-shadow: 0 10px 28px rgba(47, 28, 84, 0.18);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1050;
    padding: 0.35rem;
}
.ld-autocomplete-results.show {
    display: block;
}
.ld-autocomplete-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.55rem 0.7rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: inherit;
}
.ld-autocomplete-item:hover,
.ld-autocomplete-item.active {
    background: var(--brand-purple-soft);
}
.ld-autocomplete-label {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--brand-purple-dark);
}
.ld-autocomplete-sub {
    font-size: 0.78rem;
    color: #6c757d;
}
.ld-autocomplete-empty {
    padding: 0.6rem 0.7rem;
    font-size: 0.85rem;
    color: var(--ink-faint);
}

.ld-items {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ld-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.75rem;
    background: #fff;
    border: 1px solid var(--card-border);
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.ld-item:hover {
    background-color: var(--brand-purple-soft);
    border-color: var(--brand-purple-soft);
    transform: translateX(3px);
    color: inherit;
}
.ld-item.selected {
    background-color: var(--brand-purple-soft);
    border-color: var(--bs-primary);
    box-shadow: inset 3px 0 0 var(--bs-primary);
}
.ld-item-title {
    font-weight: 700;
    color: var(--brand-purple-dark);
    font-size: 0.93rem;
    margin-bottom: 0.15rem;
}
.ld-item-sub {
    font-size: 0.78rem;
    color: #6c757d;
}
.ld-item-chevron {
    color: var(--brand-gold);
    font-size: 1rem;
    flex: 0 0 auto;
}

.ld-empty-list {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--ink-faint);
    font-size: 0.88rem;
}

.ld-pager {
    padding: 0.65rem;
    border-top: 1px solid var(--card-border);
    display: flex;
    justify-content: center;
}
.ld-pager .pagination { margin-bottom: 0; }
.ld-pager .page-link { color: var(--bs-primary); }
.ld-pager .page-item.active .page-link {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.ld-pager .page-item.disabled .page-link {
    color: #c9c2d6;
}

.ld-panel {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.75rem;
	background: var(--bg-cream);
}

.ld-panel-empty {
    height: 100%;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--ink-faint);
    text-align: center;
    gap: 0.5rem;
}
.ld-panel-empty i { font-size: 2.75rem; color: var(--card-border); }

.ld-back-link {
    display: none;
}

/* On narrow / collapsed nav, go back to a compact icon+label row, pin the bar
   to the top of the viewport so it stays reachable while scrolling, and drop
   the list/detail shell (Clients, Sessions, etc.) to a single stacked column. */
@media (max-width: 991.98px) {
    :root {
        --mobile-navbar-height: 5rem;
    }

    body {
        padding-top: var(--mobile-navbar-height);
    }

    .navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1030;
        border-radius: 0;
        margin-bottom: 0 !important;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    #navbarNav.show {
        max-height: calc(100vh - var(--mobile-navbar-height));
        overflow-y: auto;
    }

    .nav-tiles {
        flex-direction: column;
        align-items: stretch;
        gap: 0.15rem;
    }
    .nav-tile {
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.6rem;
        min-width: 0;
    }
    .nav-tile i {
        font-size: 1.15rem;
        width: 1.5rem;
        text-align: center;
    }
    .nav-tile span {
        font-size: 0.8rem;
        text-transform: none;
        letter-spacing: normal;
    }

    .ld-shell {
        flex-direction: column;
        min-height: 0;
    }
    .ld-sidebar {
        width: 100%;
        flex: 1 1 auto;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
    }
    .ld-shell.has-selection .ld-sidebar {
        display: none;
    }
    .ld-shell.has-selection .ld-panel {
        display: block;
    }
    .ld-back-link {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        margin-bottom: 1rem;
        color: var(--bs-primary);
        font-weight: 700;
        text-decoration: none;
    }
}

/* Clickable toggle pill — e.g. the "filter by user" row on the audit log.
   Distinct from .dash-chip, which is a static read-only label. */
.filter-pill {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    border: 1.5px solid var(--brand-purple-soft);
    color: var(--bs-primary);
    background: #fff;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}
.filter-pill:hover {
    background: var(--brand-purple-soft);
    color: var(--bs-primary);
}

/* Practice Files landing page: one clickable "folder" tile per category. */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}
.folder-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.5rem 1rem;
    text-align: center;
    text-decoration: none;
    color: var(--ink);
    background: #fff;
    border-radius: 1.25rem;
    box-shadow: 0 2px 14px -6px rgba(42, 31, 61, 0.14);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.folder-tile:hover {
    color: var(--ink);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -8px rgba(42, 31, 61, 0.22);
}
.folder-tile .material-symbols-rounded {
    font-size: 2.75rem;
    color: var(--brand-gold);
}
.folder-tile.folder-tile-all .material-symbols-rounded {
    color: var(--bs-primary);
}
.folder-tile-name {
    font-weight: 700;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}
.folder-tile-count {
    font-size: 0.78rem;
    color: var(--ink-muted);
    font-weight: 600;
}
.filter-pill.active {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

/* Small inline tip/info box — e.g. the "changes save automatically" note
   under an autosave form. Reuses the same blue used for .dash-chip-blue /
   .dash-icon-blue elsewhere for consistency. */
.tip-box {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--brand-blue-soft);
    color: #1d4a66;
    border-radius: 0.75rem;
    padding: 0.65rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}
.tip-box .bi, .tip-box .material-symbols-rounded {
    font-size: 1.1rem;
    flex: 0 0 auto;
}

/* Styled confirm()/alert() replacement — see confirm-modal.js. */
.app-confirm-modal {
    border: none;
    border-radius: 1.25rem;
    box-shadow: 0 10px 40px -10px rgba(42, 31, 61, 0.3);
}
.app-confirm-icon .material-symbols-rounded {
    font-size: 2.75rem;
}
.app-confirm-icon.variant-danger .material-symbols-rounded { color: var(--bs-danger); }
.app-confirm-icon.variant-primary .material-symbols-rounded { color: var(--bs-primary); }
.app-confirm-message {
    font-size: 1rem;
    color: var(--ink);
    white-space: pre-line;
}
.app-confirm-modal .btn-danger {
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
}

/* Small shared utilities replacing repeated inline styles. */
.ms-18 { font-size: 18px; }
.ms-20 { font-size: 20px; }
.text-ink-muted { color: var(--ink-muted); }

/* Inactivity-logout warning: must sit above the navbar (1030), the modal
   backdrop/modals (1050-1055) and toasts (1090), or it's easy to miss. */
.idle-warning {
    z-index: 2000;
    width: max-content;
    max-width: calc(100vw - 2rem);
}
