@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&family=Sora:wght@500;600;700;800&display=swap');

:root {
    --clr-bg: #f3f7f8;
    --clr-bg-alt: #e6eff1;
    --clr-surface: #ffffff;
    --clr-surface-soft: #f8fbfc;
    --clr-text: #102129;
    --clr-text-soft: #4d636c;
    --clr-brand-900: #103543;
    --clr-brand-700: #1d5b6f;
    --clr-brand-500: #2f8098;
    --clr-brand-300: #8fb9c7;
    --clr-accent-600: #c07131;
    --clr-accent-500: #d28a4b;
    --clr-accent-100: #f6e9dd;
    --clr-success-600: #1b7b4f;
    --clr-success-100: #e8f5ee;
    --clr-danger-600: #b33c3c;
    --clr-danger-100: #faecec;
    --clr-warning-600: #9a620e;
    --clr-warning-100: #fff4df;
    --clr-info-600: #235f84;
    --clr-info-100: #eaf4fb;
    --clr-border: #d6e2e7;
    --clr-border-strong: #bccdd4;
    --font-display: 'Sora', 'Trebuchet MS', sans-serif;
    --font-body: 'Source Sans 3', 'Verdana', sans-serif;
    --shadow-sm: 0 4px 12px rgba(16, 53, 67, 0.08);
    --shadow-md: 0 14px 28px rgba(16, 53, 67, 0.13);
    --shadow-lg: 0 22px 42px rgba(16, 53, 67, 0.16);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-body);
    background:
        radial-gradient(circle at 3% 4%, rgba(47, 128, 152, 0.16), transparent 32%),
        radial-gradient(circle at 98% 1%, rgba(210, 138, 75, 0.16), transparent 36%),
        linear-gradient(160deg, var(--clr-bg), var(--clr-bg-alt));
    color: var(--clr-text);
    line-height: 1.55;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    color: var(--clr-brand-900);
    letter-spacing: -0.02em;
    margin-top: 0;
}

p {
    color: var(--clr-text-soft);
}

a {
    color: var(--clr-brand-700);
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
    color: var(--clr-brand-900);
}

.text-primary {
    color: var(--clr-brand-700) !important;
}

.text-info {
    color: var(--clr-info-600) !important;
}

.text-warning {
    color: var(--clr-warning-600) !important;
}

.text-success {
    color: var(--clr-success-600) !important;
}

.text-danger {
    color: var(--clr-danger-600) !important;
}

small,
.small,
.text-muted {
    color: var(--clr-text-soft) !important;
}

.reveal-in {
    animation: reveal-in 0.5s ease backwards;
}

@keyframes reveal-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Shared Navbar */

.navbar {
    border-bottom: 1px solid var(--clr-border);
    background: rgba(255, 255, 255, 0.93) !important;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
    padding: 0.7rem 1.3rem !important;
}

.navbar-brand {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--clr-brand-900) !important;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.navbar-nav .nav-link {
    color: var(--clr-text) !important;
    font-weight: 600;
    border-radius: 999px;
    padding: 0.38rem 0.92rem !important;
    margin: 0 0.15rem;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--clr-brand-900) !important;
    background: var(--clr-accent-100);
}

/* Buttons */

.btn {
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:focus,
.btn.focus {
    box-shadow: 0 0 0 0.2rem rgba(47, 128, 152, 0.2);
}

.btn-primary {
    color: #fff;
    border-color: var(--clr-brand-700);
    background: linear-gradient(135deg, var(--clr-brand-700), var(--clr-brand-500));
}

.btn-primary:hover {
    color: #fff;
    border-color: var(--clr-brand-900);
    background: linear-gradient(135deg, var(--clr-brand-900), var(--clr-brand-700));
    box-shadow: 0 12px 24px rgba(29, 91, 111, 0.22);
}

.btn-secondary {
    color: var(--clr-brand-900);
    border-color: var(--clr-border-strong);
    background: var(--clr-surface);
}

.btn-secondary:hover {
    color: var(--clr-brand-900);
    border-color: var(--clr-brand-300);
    background: var(--clr-surface-soft);
}

.btn-success {
    color: #fff;
    border-color: var(--clr-success-600);
    background: linear-gradient(135deg, #1b7b4f, #269663);
}

.btn-success:hover {
    color: #fff;
    background: linear-gradient(135deg, #14663f, #1b7b4f);
}

.btn-danger {
    color: #fff;
    border-color: var(--clr-danger-600);
    background: linear-gradient(135deg, #b33c3c, #c65151);
}

.btn-danger:hover {
    color: #fff;
    background: linear-gradient(135deg, #8f2d2d, #b33c3c);
}

.btn-warning {
    color: #1c1d1f;
    border-color: var(--clr-warning-600);
    background: linear-gradient(135deg, #ffda88, #f3be58);
}

.btn-warning:hover {
    color: #1c1d1f;
    background: linear-gradient(135deg, #f0c967, #e5ad40);
}

.btn-info {
    color: #fff;
    border-color: var(--clr-info-600);
    background: linear-gradient(135deg, #245f84, #2f81b2);
}

.btn-info:hover {
    color: #fff;
    background: linear-gradient(135deg, #1b4e6d, #245f84);
}

.btn-outline-primary {
    color: var(--clr-brand-700);
    border-color: var(--clr-brand-500);
}

.btn-outline-primary:hover {
    color: #fff;
    background: var(--clr-brand-700);
    border-color: var(--clr-brand-700);
}

.btn-link {
    color: var(--clr-brand-700);
    font-weight: 600;
}

.btn-link:hover {
    color: var(--clr-brand-900);
}

/* Forms */

.form-group label,
label {
    color: var(--clr-brand-900);
    font-weight: 600;
    margin-bottom: 0.42rem;
}

.form-control,
select.form-control,
textarea.form-control {
    border: 1px solid var(--clr-border-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--clr-text);
    min-height: 2.8rem;
}

.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
    border-color: var(--clr-brand-500);
    box-shadow: 0 0 0 0.2rem rgba(47, 128, 152, 0.14);
}

textarea.form-control {
    min-height: 6rem;
}

.form-check-label {
    color: var(--clr-text);
}

/* Cards */

.card {
    border: 1px solid var(--clr-border);
    border-radius: 16px;
    background: var(--clr-surface);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--clr-surface-soft);
    border-bottom: 1px solid var(--clr-border);
    color: var(--clr-brand-900);
    font-weight: 700;
}

.card-title,
.section-title {
    color: var(--clr-brand-900);
    font-weight: 700;
}

/* Alerts and Badges */

.alert {
    border: 1px solid transparent;
    border-left-width: 4px;
    border-radius: 12px;
    color: var(--clr-text);
}

.alert-success {
    border-color: #bfe5d2;
    border-left-color: var(--clr-success-600);
    background: var(--clr-success-100);
    color: #135538;
}

.alert-danger {
    border-color: #efc8c8;
    border-left-color: var(--clr-danger-600);
    background: var(--clr-danger-100);
    color: #7e2b2b;
}

.alert-warning {
    border-color: #f7dfb3;
    border-left-color: var(--clr-warning-600);
    background: var(--clr-warning-100);
    color: #764c0b;
}

.alert-info {
    border-color: #c6def0;
    border-left-color: var(--clr-info-600);
    background: var(--clr-info-100);
    color: #18496a;
}

.badge {
    border-radius: 999px;
    padding: 0.36rem 0.62rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.badge-success {
    background: var(--clr-success-100);
    color: #135538;
    border: 1px solid #bee2d2;
}

.badge-danger {
    background: var(--clr-danger-100);
    color: #7e2b2b;
    border: 1px solid #e7c5c5;
}

.badge-warning {
    background: var(--clr-warning-100);
    color: #704607;
    border: 1px solid #f0d8ac;
}

.badge-info {
    background: var(--clr-info-100);
    color: #1a4f70;
    border: 1px solid #cae0f0;
}

.badge-secondary {
    background: #eef2f4;
    color: #435862;
    border: 1px solid #d8e1e5;
}

/* Tables */

.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 1px solid var(--clr-border);
    background: linear-gradient(180deg, #f7fafb, #edf4f6);
    color: var(--clr-brand-900);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.table tbody tr {
    border-bottom: 1px solid #ebf1f4;
}

.table tbody tr:hover {
    background: #f7fbfc;
}

.table td,
.table th {
    padding: 0.92rem 0.96rem;
    vertical-align: middle;
}

.table-responsive {
    border-radius: 12px;
}

/* Modal */

.modal-content {
    border: 1px solid var(--clr-border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--clr-border);
}

.modal-footer {
    border-top: 1px solid var(--clr-border);
}

/* Base layout */

.content-shell {
    margin-top: 2rem;
    margin-bottom: 2.5rem;
}

.site-footer {
    border-top: 1px solid var(--clr-border);
    background: rgba(255, 255, 255, 0.78);
    color: var(--clr-text-soft);
}

.site-footer p,
.site-footer small {
    color: var(--clr-text-soft) !important;
}

/* Home dashboard card */

.jumbotron {
    border: 1px solid var(--clr-border);
    border-radius: 20px;
    background:
        radial-gradient(circle at 90% 4%, rgba(47, 128, 152, 0.14), transparent 33%),
        radial-gradient(circle at 6% 88%, rgba(210, 138, 75, 0.14), transparent 36%),
        var(--clr-surface);
    box-shadow: var(--shadow-md);
}

.jumbotron .display-4 {
    font-size: clamp(1.95rem, 3.5vw, 2.7rem);
}

.jumbotron hr {
    border-top: 1px solid #d4e0e5;
}

/* Public pages */

.public-page {
    min-height: 100vh;
}

.public-page .navbar {
    border-bottom: 1px solid rgba(16, 53, 67, 0.12);
}

.public-page .btn-admin-login {
    border-radius: 999px;
    font-weight: 700;
    color: #fff !important;
    padding: 0.56rem 1.22rem;
    background: linear-gradient(135deg, var(--clr-brand-700), var(--clr-brand-500));
    border: 1px solid rgba(16, 53, 67, 0.18);
}

.public-page .btn-admin-login:hover {
    box-shadow: 0 10px 22px rgba(29, 91, 111, 0.24);
    color: #fff !important;
}

.public-hero {
    margin: 2.15rem auto 0;
    border: 1px solid var(--clr-border);
    border-radius: 24px;
    background:
        linear-gradient(136deg, rgba(16, 53, 67, 0.95), rgba(29, 91, 111, 0.92)),
        radial-gradient(circle at 88% 10%, rgba(210, 138, 75, 0.45), transparent 36%);
    color: #f8fbfc;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.public-hero .hero-inner {
    padding: clamp(2rem, 5vw, 4rem);
}

.public-hero .hero-title {
    color: #fff;
    font-size: clamp(2.1rem, 5vw, 3.6rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.public-hero .hero-subtitle {
    color: rgba(245, 249, 251, 0.9);
    max-width: 800px;
    font-size: clamp(1rem, 2vw, 1.25rem);
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.4rem;
}

.hero-cta .btn {
    border-radius: 999px;
    padding: 0.62rem 1.3rem;
    font-weight: 700;
}

.hero-cta .btn-outline-light {
    color: #f7fcff;
    border-color: rgba(247, 252, 255, 0.8);
}

.hero-cta .btn-outline-light:hover {
    color: #132f3a;
    background: #fff;
}

.public-glass {
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
}

.stats-band {
    margin-top: 1.5rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.stat-tile {
    padding: 1.15rem 1rem;
    border-radius: 14px;
    border: 1px solid var(--clr-border);
    background: var(--clr-surface);
    text-align: center;
}

.stat-tile .number {
    display: block;
    font-family: var(--font-display);
    color: var(--clr-brand-900);
    font-size: clamp(1.4rem, 3vw, 2.1rem);
    font-weight: 800;
}

.stat-tile .label {
    display: block;
    color: var(--clr-text-soft);
    font-weight: 600;
    font-size: 0.87rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.public-section {
    margin-top: 2rem;
    padding: clamp(1.3rem, 2.2vw, 2rem);
    border: 1px solid var(--clr-border);
    border-radius: 18px;
    background: var(--clr-surface);
    box-shadow: var(--shadow-sm);
}

.public-section .section-title {
    font-size: clamp(1.45rem, 2.6vw, 2.2rem);
    margin-bottom: 0.3rem;
}

.public-section .section-subtitle {
    color: var(--clr-text-soft);
    margin-bottom: 1.4rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.95rem;
}

.feature-card {
    border: 1px solid var(--clr-border);
    border-radius: 14px;
    background: var(--clr-surface-soft);
    padding: 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
    border-color: var(--clr-brand-300);
}

.feature-card .icon {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--clr-accent-100);
    color: var(--clr-accent-600);
    margin-bottom: 0.6rem;
}

.feature-card h3,
.feature-card h4 {
    font-size: 1.05rem;
    margin-bottom: 0.38rem;
}

.feature-card p {
    margin-bottom: 0;
    font-size: 0.96rem;
}

.public-footer {
    margin-top: 2.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(140deg, var(--clr-brand-900), #152f38);
    color: rgba(244, 250, 252, 0.9);
}

.public-footer p,
.public-footer a {
    color: rgba(244, 250, 252, 0.86);
}

.public-footer a:hover {
    color: #ffffff;
}

/* Public catalog */

.catalog-controls {
    border: 1px solid var(--clr-border);
    border-radius: 16px;
    background: var(--clr-surface);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
}

.catalog-count {
    font-weight: 600;
    color: var(--clr-text-soft);
}

.catalog-table {
    border: 1px solid var(--clr-border);
    border-radius: 16px;
    overflow: hidden;
    background: var(--clr-surface);
    box-shadow: var(--shadow-sm);
}

.catalog-table .table {
    margin: 0;
}

.badge-available,
.badge-checked-out {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-weight: 700;
    font-size: 0.8rem;
}

.badge-available {
    background: var(--clr-success-100);
    border: 1px solid #bee4d3;
    color: #135538;
}

.badge-checked-out {
    background: var(--clr-danger-100);
    border: 1px solid #ebc5c5;
    color: #7a2a2a;
}

.instrument-uuid {
    font-family: var(--font-display);
    letter-spacing: 0.03em;
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
}

.empty-state i {
    font-size: 2.3rem;
    color: var(--clr-brand-300);
    margin-bottom: 0.55rem;
}

/* Auth pages */

.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-panel {
    width: min(460px, 100%);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.auth-head {
    background:
        radial-gradient(circle at 85% 15%, rgba(210, 138, 75, 0.5), transparent 42%),
        linear-gradient(130deg, var(--clr-brand-900), var(--clr-brand-700));
    color: #fff;
    text-align: center;
    padding: 2rem 1.4rem 1.6rem;
}

.auth-head h1,
.auth-head h2,
.auth-head p {
    color: #fff;
    margin-bottom: 0.4rem;
}

.auth-head i {
    font-size: 2.5rem;
    margin-bottom: 0.7rem;
    opacity: 0.95;
}

.auth-body {
    padding: 1.5rem;
}

.auth-credit {
    text-align: center;
    margin: 0;
    padding: 0.75rem 1.5rem;
    border-top: 1px solid var(--clr-border);
    color: rgba(16, 33, 41, 0.55);
    font-size: 0.76rem;
}

.signup-divider {
    border-top: 1px solid var(--clr-border);
    margin-top: 2rem;
    padding-top: 1.5rem;
    text-align: center;
}

/* Admin shell */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 272px;
    z-index: 1000;
    overflow-y: auto;
    background:
        radial-gradient(circle at 90% -10%, rgba(210, 138, 75, 0.28), transparent 38%),
        linear-gradient(172deg, #102f39, #173f4d 62%, #102f39);
    color: rgba(246, 251, 252, 0.92);
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 10px 0 28px rgba(0, 0, 0, 0.24);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.2rem 1.2rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-brand {
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-weight: 700;
    display: inline-block;
}

.sidebar-brand:hover {
    color: #fff;
    opacity: 0.9;
}

.sidebar-subtitle {
    margin-top: 0.22rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.72rem;
    color: rgba(244, 251, 252, 0.72);
}

.sidebar-menu {
    padding: 0.6rem;
    display: grid;
    gap: 0.32rem;
}

.sidebar-menu-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-radius: 10px;
    color: rgba(244, 251, 252, 0.86);
    padding: 0.62rem 0.72rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.sidebar-menu-item i {
    width: 1.2rem;
    color: #f2ba84;
}

.sidebar-menu-item:hover,
.sidebar-menu-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-menu-item.active i {
    color: #ffd8b5;
}

.sidebar-footer {
    margin-top: auto;
    padding: 0.9rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.72rem;
    color: rgba(244, 251, 252, 0.72);
    text-align: center;
}

.top-bar {
    position: fixed;
    top: 0;
    left: 272px;
    right: 0;
    height: 70px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 1.2rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--clr-border);
    z-index: 999;
}

.main-content {
    margin-left: 272px;
    margin-top: 70px;
    padding: 1.3rem;
    min-height: calc(100vh - 70px);
}

.mobile-menu-toggle {
    display: none;
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: none;
    color: #fff;
    background: linear-gradient(135deg, var(--clr-brand-700), var(--clr-brand-500));
    box-shadow: var(--shadow-md);
    z-index: 1001;
}

.user-menu-wrapper {
    position: relative;
}

.user-menu-toggle {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(16, 53, 67, 0.15);
    color: #fff;
    background: linear-gradient(135deg, var(--clr-brand-700), var(--clr-brand-500));
}

.user-menu-dropdown {
    position: absolute;
    top: 54px;
    right: 0;
    width: 230px;
    border-radius: 12px;
    border: 1px solid var(--clr-border);
    box-shadow: var(--shadow-md);
    background: var(--clr-surface);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.user-menu-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.68rem 0.82rem;
    color: var(--clr-text);
    border-bottom: 1px solid var(--clr-border);
}

.user-menu-item:last-child {
    border-bottom: none;
}

.user-menu-item i {
    width: 1.1rem;
    color: var(--clr-brand-700);
}

.user-menu-item:hover {
    background: #f3f8fa;
    color: var(--clr-brand-900);
}

.user-menu-item.danger {
    color: #8a2c2c;
}

.user-menu-item.danger i {
    color: #b33c3c;
}

.user-menu-item.danger:hover {
    background: #fdf1f1;
    color: #7f2323;
}

/* Admin page helpers */

.page-header,
.welcome-card,
.quick-actions-card,
.activity-card,
.settings-section,
.filter-section,
.storage-info-box {
    border: 1px solid var(--clr-border);
    border-radius: 16px;
    background: var(--clr-surface);
    box-shadow: var(--shadow-sm);
}

.page-header,
.welcome-card,
.quick-actions-card,
.activity-card,
.filter-section,
.section-body {
    padding: 1.25rem;
}

.page-header h2,
.welcome-title,
.page-title {
    margin-bottom: 0.3rem;
}

.stat-card {
    border: 1px solid var(--clr-border);
    border-radius: 16px;
    background: var(--clr-surface);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-primary .stat-icon,
.action-primary {
    background: #e8f2f7;
    color: #276f9c;
}

.stat-success .stat-icon {
    background: #e8f5ee;
    color: #19784e;
}

.stat-danger .stat-icon {
    background: #faecec;
    color: #a33737;
}

.stat-warning .stat-icon,
.action-warning {
    background: #fff3de;
    color: #9b630d;
}

.stat-number {
    color: var(--clr-brand-900);
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    margin: 0;
}

.stat-label {
    color: var(--clr-text-soft);
    margin: 0;
    font-weight: 600;
}

.action-btn {
    width: 100%;
    border: 1px solid var(--clr-border);
    border-radius: 14px;
    padding: 1rem;
    background: #f7fafb;
    color: var(--clr-brand-900);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    font-weight: 700;
}

.action-btn i {
    font-size: 1.55rem;
}

.action-btn:hover {
    text-decoration: none;
    color: var(--clr-brand-900);
    border-color: var(--clr-brand-300);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.action-info {
    background: #eaf4fb;
    color: #1f5f84;
}

.action-secondary {
    background: #eef3f5;
    color: #516873;
}

.info-item {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e8eef1;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--clr-brand-900);
    font-weight: 600;
}

.info-badge {
    border: 1px solid var(--clr-border-strong);
    border-radius: 12px;
    background: var(--clr-surface-soft);
    padding: 0.68rem 0.78rem;
    text-align: center;
}

.info-badge strong {
    display: block;
    font-family: var(--font-display);
    color: var(--clr-brand-900);
    font-size: 1.3rem;
}

.storage-info-box {
    padding: 1rem;
}

.storage-details {
    color: var(--clr-text-soft);
}

/* Settings page */

.settings-section {
    overflow: hidden;
}

.section-header {
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, var(--clr-brand-900), var(--clr-brand-700));
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.04rem;
    font-weight: 700;
}

.section-header i {
    margin-right: 0.35rem;
}

.section-body {
    padding: 0;
}

.setting-item {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid #e7edf1;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item:hover {
    background: #fbfdfe;
}

.setting-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.setting-title {
    font-size: 1.03rem;
    margin: 0;
}

.setting-title i {
    color: var(--clr-brand-500);
    margin-right: 0.35rem;
}

.setting-description {
    margin: 0.45rem 0 0;
    color: var(--clr-text-soft);
}

.setting-fields {
    margin-top: 0.8rem;
}

.inline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.72rem 0.9rem;
}

.custom-switch {
    position: relative;
}

.custom-switch .custom-control-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-switch .custom-control-label {
    position: relative;
    margin: 0;
    min-height: 1.9rem;
    padding-left: 4.2rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.custom-switch .custom-control-label::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3.6rem;
    height: 1.85rem;
    border-radius: 999px;
    background: #cfdddd;
    transition: background 0.2s ease;
}

.custom-switch .custom-control-label::after {
    content: '';
    position: absolute;
    left: 0.2rem;
    top: 0.2rem;
    width: 1.45rem;
    height: 1.45rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s ease;
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
    background: #2c8b63;
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::after {
    transform: translateX(1.75rem);
}

.toggle-on {
    display: none;
    color: #2c8b63;
    font-weight: 700;
}

.toggle-off {
    color: #8a4141;
    font-weight: 700;
}

.custom-switch .custom-control-input:checked ~ .custom-control-label .toggle-on {
    display: inline;
}

.custom-switch .custom-control-input:checked ~ .custom-control-label .toggle-off {
    display: none;
}

/* Shared utility blocks */

.activity-metrics {
    background: #f4f8fa;
    border: 1px solid #d6e2e7;
    font-size: 0.85rem;
}

.auth-divider {
    border-top: 1px solid var(--clr-border);
}

/* Checkout request cards */

.request-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.request-image-thumbnail {
    position: relative;
}

.request-image-thumbnail img,
.request-current-thumbnail {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--clr-border-strong);
    box-shadow: var(--shadow-sm);
}

.request-current-thumbnail {
    width: 80px;
    height: 80px;
    margin: 0.25rem;
}

.request-source-badge {
    position: absolute;
    right: 0.35rem;
    bottom: 0.35rem;
    border-radius: 999px;
    padding: 0.12rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: rgba(16, 33, 41, 0.78);
    color: #fff;
}

.request-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.request-action-form {
    margin: 0;
}

/* Instrument history */

.timeline {
    display: grid;
    gap: 1rem;
}

.timeline-item {
    display: flex;
    gap: 0.85rem;
    border: 1px solid var(--clr-border);
    border-radius: 14px;
    background: var(--clr-surface-soft);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.history-entry-hidden {
    display: none;
}

.timeline-bar {
    width: 6px;
    min-width: 6px;
}

.timeline-bar-checkout {
    background: var(--clr-success-600);
}

.timeline-bar-checkin {
    background: var(--clr-info-600);
}

.timeline-bar-neutral {
    background: #7f939c;
}

.timeline-content {
    padding: 0.95rem 1rem;
    flex: 1;
}

.timeline-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.62rem;
}

.timeline-action {
    margin: 0;
    font-weight: 700;
    color: var(--clr-brand-900);
}

.timeline-action-checkout {
    color: var(--clr-success-600);
}

.timeline-action-checkin {
    color: var(--clr-info-600);
}

.timeline-action-neutral {
    color: #637780;
}

.timeline-term {
    font-size: 0.78rem;
    font-weight: 700;
    color: #5d7079;
    border-radius: 999px;
    border: 1px solid #d8e2e7;
    background: #f2f7f9;
    padding: 0.22rem 0.55rem;
}

.timeline-student {
    margin-bottom: 0.62rem;
}

.timeline-student-name {
    font-weight: 700;
    color: var(--clr-brand-900);
}

.timeline-info {
    color: var(--clr-text-soft);
    font-size: 0.86rem;
}

.history-class-badge {
    margin-left: 0.45rem;
    border-radius: 999px;
    border: 1px solid #f0d7ac;
    background: #fff3de;
    color: #76500f;
    font-weight: 700;
    padding: 0.13rem 0.46rem;
    font-size: 0.76rem;
}

.history-image-block {
    margin: 0.72rem 0;
    border-radius: 10px;
    border: 1px solid #dfe8ec;
    background: #f8fbfc;
    padding: 0.65rem;
}

.history-image-title {
    display: block;
    font-weight: 700;
    color: var(--clr-brand-900);
    margin-bottom: 0.45rem;
}

.history-thumbnail-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.history-static-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--clr-border-strong);
}

.history-thumbnail {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.history-thumbnail:hover {
    transform: translateY(-2px);
}

.history-thumbnail img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--clr-border-strong);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.history-thumbnail:hover img {
    border-color: var(--clr-brand-500);
    box-shadow: var(--shadow-md);
}

.history-source-badge {
    position: absolute;
    right: 0.35rem;
    bottom: 0.35rem;
    border-radius: 999px;
    padding: 0.12rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.history-source-local {
    background: rgba(16, 33, 41, 0.78);
    color: #fff;
}

.history-source-cloud {
    background: rgba(27, 123, 79, 0.92);
    color: #fff;
}

.history-source-form {
    background: rgba(242, 197, 102, 0.93);
    color: #2a1a00;
}

.history-links {
    display: grid;
    gap: 0.35rem;
}

.history-links a {
    word-break: break-all;
}

.history-empty {
    color: #7e8f97;
    font-style: italic;
}

.history-note {
    margin-top: 0.62rem;
    border-radius: 8px;
    border-left: 3px solid var(--clr-info-600);
    background: #e7f3ff;
    padding: 0.45rem 0.55rem;
}

.history-image-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.82);
    z-index: 1055;
    padding: 1rem;
}

.history-modal-shell {
    position: relative;
    max-width: 92%;
    max-height: 92%;
}

.history-modal-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
}

.history-modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: 0;
    font-size: 1.25rem;
    line-height: 1;
    color: #1f2a31;
    background: rgba(255, 255, 255, 0.95);
    cursor: pointer;
}

.history-modal-caption {
    margin-top: 0.6rem;
    text-align: center;
    color: #ecf3f7;
    font-size: 0.86rem;
}

/* Sidebar mobile backdrop */

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

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

/* Instrument card action buttons */

.instrument-action-btns {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
}

/* Bootstrap 4 gap shim for flex containers */

.flex-gap-sm {
    gap: 0.5rem;
}

/* Responsive */

@media (max-width: 991.98px) {
    .top-bar {
        left: 0;
    }

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

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.24s ease;
    }

    .sidebar.mobile-show {
        transform: translateX(0);
    }

    .mobile-menu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    .content-shell {
        margin-top: 1.2rem;
    }

    .public-hero .hero-inner {
        padding: 1.5rem 1.1rem;
    }

    .hero-cta .btn,
    .btn.btn-block-mobile {
        width: 100%;
    }

    /* Catalog table: allow horizontal scroll instead of clipping */
    .catalog-table {
        overflow-x: auto;
    }

    /* Settings and form action button rows */
    .action-btn-row {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .action-btn-row .btn {
        width: 100%;
        margin: 0 !important;
    }
}

@media (max-width: 575.98px) {
    /* Stats band: single column on small phones only */
    .stats-band {
        grid-template-columns: 1fr;
    }

    /* Manual checkout / form submit button pairs */
    .submit-btn-group {
        flex-direction: column;
        align-items: stretch;
    }

    .submit-btn-group .btn {
        width: 100%;
        margin: 0 !important;
    }

    /* Instrument filter section: reduce padding */
    .filter-section {
        padding: 1rem;
    }

    /* Tighten table cell padding on tiny screens */
    .table td,
    .table th {
        padding: 0.65rem 0.55rem;
    }

    /* Settings section: stack inline grids to 1 column */
    .inline-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Settings layout v2: collapsible categories, right rail, search, info tooltips
   ============================================================ */

.settings-page-layout {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.settings-main {
    flex: 1 1 auto;
    min-width: 0;
}

.settings-rail {
    flex: 0 0 220px;
    width: 220px;
    position: sticky;
    top: 1rem;
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e7edf1;
    border-radius: 10px;
    padding: 0.75rem 0.4rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.settings-rail-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--clr-text-soft);
    padding: 0.25rem 0.75rem 0.5rem;
    margin: 0;
}

.settings-rail a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.75rem;
    border-radius: 7px;
    color: var(--clr-text);
    font-size: 0.92rem;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.settings-rail a:hover {
    background: #f3f7fa;
    text-decoration: none;
}

.settings-rail a.is-active {
    background: #eef5fb;
    border-left-color: var(--clr-brand-500);
    font-weight: 600;
}

.settings-rail a i {
    width: 16px;
    color: var(--clr-brand-500);
    text-align: center;
}

.settings-rail a.is-hidden {
    display: none;
}

@media (max-width: 991px) {
    .settings-page-layout {
        display: block;
    }
    .settings-rail {
        display: none;
    }
}

/* Search bar */
.settings-search-row {
    position: relative;
    margin-bottom: 1rem;
}

.settings-search-row input[type="search"] {
    width: 100%;
    padding: 0.6rem 2.4rem 0.6rem 2.4rem;
    border: 1px solid #d4dde3;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.settings-search-row input[type="search"]:focus {
    border-color: var(--clr-brand-500);
    box-shadow: 0 0 0 3px rgba(80, 130, 180, 0.18);
    outline: none;
}

.settings-search-row::before {
    content: '\f002';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--clr-text-soft);
    font-size: 0.9rem;
    pointer-events: none;
}

#settingsSearchClear {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: 0;
    color: var(--clr-text-soft);
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    display: none;
}

#settingsSearchClear:hover {
    background: #f3f7fa;
    color: var(--clr-text);
}

.settings-search-row.has-query #settingsSearchClear {
    display: block;
}

#settingsSearchEmpty {
    display: none;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--clr-text-soft);
    background: #fff;
    border: 1px dashed #d4dde3;
    border-radius: 10px;
}

#settingsSearchEmpty.is-shown {
    display: block;
}

/* Collapsible section header */
.settings-section .section-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, var(--clr-brand-900), var(--clr-brand-700));
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.04rem;
    font-weight: 700;
    border: 0;
    cursor: pointer;
    text-align: left;
}

.settings-section .section-toggle:focus {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

.settings-section .section-toggle .section-toggle-label i {
    margin-right: 0.35rem;
}

.settings-section .section-toggle .chevron {
    transition: transform 0.2s ease;
}

.settings-section.collapsed .section-toggle .chevron {
    transform: rotate(-90deg);
}

.settings-section .section-body {
    overflow: hidden;
    transition: max-height 0.25s ease;
    max-height: 6000px;
}

.settings-section.collapsed .section-body {
    max-height: 0;
}

.settings-section.is-hidden,
.setting-item.is-hidden {
    display: none !important;
}

/* Info icon tooltip — copied from setup.css to avoid cross-stylesheet dependency */
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 11px;
    color: var(--clr-text-soft);
    cursor: help;
    position: relative;
    margin-left: 6px;
    vertical-align: middle;
}

.info-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1D1D1F;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    padding: 8px 12px;
    border-radius: 8px;
    white-space: pre-wrap;
    width: max-content;
    max-width: 260px;
    line-height: 1.4;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
    z-index: 1000;
}

.info-icon:hover::after,
.info-icon:focus::after {
    opacity: 1;
}

/* Setting header tweaks for new layout (info icon next to title) */
.setting-title .info-icon {
    color: rgba(95, 130, 160, 0.85);
}
