/* ============================================================
   Bootstrap / MDB class names — styled without those libraries.
   New pages should use Tailwind / Flowbite. Keep this for templates
   that still use row/col, form-outline, modal, tabs, and utilities.
   ============================================================ */

/* ---- Grid ---- */
.container-fluid { width: 100%; padding-left: 1rem; padding-right: 1rem; }

.row {
    display: flex;
    flex-wrap: wrap;
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 0;
    margin-top: calc(-1 * var(--bs-gutter-y));
    margin-right: calc(-0.5 * var(--bs-gutter-x));
    margin-left: calc(-0.5 * var(--bs-gutter-x));
}
.row > * {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: calc(var(--bs-gutter-x) * 0.5);
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    margin-top: var(--bs-gutter-y);
}
.g-0, .gx-0 { --bs-gutter-x: 0; }
.g-1, .gx-1 { --bs-gutter-x: 0.25rem; }
.g-2, .gx-2 { --bs-gutter-x: 0.5rem; }
.g-3, .gx-3 { --bs-gutter-x: 1rem; }
.g-4, .gx-4 { --bs-gutter-x: 1.5rem; }
.g-5, .gx-5 { --bs-gutter-x: 3rem; }
.gy-0 { --bs-gutter-y: 0; }
.g-1, .gy-1 { --bs-gutter-y: 0.25rem; }
.g-2, .gy-2 { --bs-gutter-y: 0.5rem; }
.g-3, .gy-3 { --bs-gutter-y: 1rem; }
.g-4, .gy-4 { --bs-gutter-y: 1.5rem; }
.g-5, .gy-5 { --bs-gutter-y: 3rem; }

.col { flex: 1 0 0%; width: auto; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-1 { flex: 0 0 auto; width: 8.333333%; }
.col-2 { flex: 0 0 auto; width: 16.666667%; }
.col-3 { flex: 0 0 auto; width: 25%; }
.col-4 { flex: 0 0 auto; width: 33.333333%; }
.col-5 { flex: 0 0 auto; width: 41.666667%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-7 { flex: 0 0 auto; width: 58.333333%; }
.col-8 { flex: 0 0 auto; width: 66.666667%; }
.col-9 { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.333333%; }
.col-11 { flex: 0 0 auto; width: 91.666667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

@media (min-width: 576px) {
    .col-sm { flex: 1 0 0%; width: auto; }
    .col-sm-auto { flex: 0 0 auto; width: auto; }
    .col-sm-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-sm-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-sm-3 { flex: 0 0 auto; width: 25%; }
    .col-sm-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-sm-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-sm-6 { flex: 0 0 auto; width: 50%; }
    .col-sm-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-sm-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-sm-9 { flex: 0 0 auto; width: 75%; }
    .col-sm-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-sm-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-sm-12 { flex: 0 0 auto; width: 100%; }
}
@media (min-width: 768px) {
    .col-md { flex: 1 0 0%; width: auto; }
    .col-md-auto { flex: 0 0 auto; width: auto; }
    .col-md-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-md-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-md-3 { flex: 0 0 auto; width: 25%; }
    .col-md-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-md-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
    .col-md-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-md-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-md-9 { flex: 0 0 auto; width: 75%; }
    .col-md-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-md-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-md-12 { flex: 0 0 auto; width: 100%; }
}
@media (min-width: 992px) {
    .col-lg { flex: 1 0 0%; width: auto; }
    .col-lg-auto { flex: 0 0 auto; width: auto; }
    .col-lg-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-lg-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-lg-3 { flex: 0 0 auto; width: 25%; }
    .col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-lg-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-lg-6 { flex: 0 0 auto; width: 50%; }
    .col-lg-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-lg-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-lg-9 { flex: 0 0 auto; width: 75%; }
    .col-lg-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-lg-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-lg-12 { flex: 0 0 auto; width: 100%; }
}
@media (min-width: 1200px) {
    .col-xl-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-xl-6 { flex: 0 0 auto; width: 50%; }
    .col-xl-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-xl-12 { flex: 0 0 auto; width: 100%; }
}

/* ---- Cards (MDB used card-body padding; main.css .card already pads) ---- */
.card:has(> .card-body),
.card:has(> .card-header) { padding: 0; }
.card-body { padding: 1.25rem; }
.card-header {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 700;
}
.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem;
}
.card-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #e2e8f0;
}

/* ---- Forms ---- */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: #374151;
}
.form-control,
.form-select {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #111827;
    background-color: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-select {
    appearance: auto;
    padding-right: 2rem;
}
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: #1D7697;
    box-shadow: 0 0 0 3px rgba(29, 118, 151, 0.2);
}
.form-control:disabled,
.form-select:disabled { background: #f1f5f9; color: #64748b; }

/* Flowbite form plugin sets appearance:none on date/time — keep native pickers. */
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input.form-control[type="date"],
input.form-control[type="time"],
input.form-control[type="datetime-local"] {
    -webkit-appearance: auto;
    appearance: auto;
    color-scheme: light;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    display: block;
    opacity: 1;
    cursor: pointer;
    background: revert;
    filter: none;
}

/* Tailwind .collapse is visibility:collapse; keep Bootstrap-style hide/show. */
.collapse { visibility: visible; }
.collapse:not(.show) { display: none; }
.form-text { font-size: 0.8rem; color: #64748b; margin-top: 0.25rem; }
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}
.form-check-input { width: auto; margin: 0; }
.form-check-label { margin: 0; font-weight: 400; }
.input-group { display: flex; align-items: stretch; width: 100%; }
.input-group > .form-outline,
.input-group > .form-control { flex: 1 1 auto; min-width: 0; }
.input-group > .btn { border-radius: 0 0.5rem 0.5rem 0; }
.flex-grow-1 { flex-grow: 1; }

.form-notch,
.form-notch-leading,
.form-notch-middle,
.form-notch-trailing { display: none !important; }

.form-outline { position: relative; }
.form-outline > .form-control,
.form-outline > textarea.form-control {
    min-height: 2.75rem;
}
.form-outline > .form-label {
    position: absolute;
    top: 0.7rem;
    left: 0.75rem;
    margin: 0;
    pointer-events: none;
    color: #6b7280;
    background: transparent;
    transition: top 0.15s, font-size 0.15s, color 0.15s;
    z-index: 1;
}
.form-outline > .form-control:focus ~ .form-label,
.form-outline > .form-control:not(:placeholder-shown) ~ .form-label,
.form-outline > .form-label.active {
    top: -0.55rem;
    left: 0.55rem;
    font-size: 0.75rem;
    background: #fff;
    padding: 0 0.25rem;
    color: #1D7697;
}
.form-outline:has(> input[type="date"]),
.form-outline:has(> input[type="time"]),
.form-outline:has(> input[type="datetime-local"]) {
    display: flex;
    flex-direction: column;
    overflow: visible;
}
.form-outline:has(> input[type="date"]) > .form-label,
.form-outline:has(> input[type="time"]) > .form-label,
.form-outline:has(> input[type="datetime-local"]) > .form-label {
    order: -1;
    position: static;
    pointer-events: auto;
    margin-bottom: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    background: none;
    padding: 0;
}

div:has(> .form-select + .select-label),
div:has(> .form-select + .form-label),
div:has(> select + .select-label) {
    display: flex;
    flex-direction: column;
}
.select-label,
.form-select + .form-label,
select + .select-label {
    order: -1;
    position: static !important;
    margin-bottom: 0.35rem;
    pointer-events: auto;
}

.select-wrapper { position: relative; }
.sportie-select-filter {
    display: block;
    width: 100%;
    margin-bottom: 0.35rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.85rem;
}

/* ---- Alerts ---- */
.alert-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}
.alert-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}
.alert-dismissible { position: relative; padding-right: 2.5rem; }
.alert .btn-close { position: absolute; top: 0.5rem; right: 0.5rem; }

/* ---- Modal ---- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1055;
    overflow-x: hidden;
    overflow-y: auto;
    outline: 0;
}
.modal.show { display: block; }
.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 500px;
    pointer-events: none;
}
.modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}
.modal-dialog-scrollable { max-height: calc(100vh - 3.5rem); }
.modal-dialog-scrollable .modal-content { max-height: calc(100vh - 3.5rem); overflow: hidden; }
.modal-dialog-scrollable .modal-body { overflow-y: auto; }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1140px; }
.modal-sm { max-width: 360px; }
.modal-content {
    pointer-events: auto;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.2);
    outline: 0;
    display: flex;
    flex-direction: column;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
}
.modal-body { padding: 1.25rem; }
.modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid #e2e8f0;
}
.modal-title { margin: 0; font-size: 1.1rem; font-weight: 700; }
.btn-close {
    background: transparent;
    border: 0;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.55;
    padding: 0.15rem 0.35rem;
    color: #475569;
}
.btn-close::before { content: "\00d7"; }
.btn-close:hover { opacity: 1; }
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1050;
    background: rgba(15, 23, 42, 0.5);
}
body.modal-open { overflow: hidden; }

/* ---- Tabs ---- */
.nav { display: flex; flex-wrap: wrap; padding-left: 0; margin: 0; list-style: none; }
.nav-tabs {
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 1rem;
    gap: 0;
}
.nav-tabs .nav-link {
    display: block;
    padding: 0.6rem 1rem;
    color: #64748b;
    text-decoration: none;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 0.375rem 0.375rem 0 0;
    font-weight: 600;
    background: transparent;
}
.nav-tabs .nav-link:hover { color: #1D7697; text-decoration: none; }
.nav-tabs .nav-link.active {
    color: #1D7697;
    background: #fff;
    border-color: #e2e8f0 #e2e8f0 #fff;
}
.tab-content > .tab-pane { display: none; }
.tab-content > .tab-pane.active,
.tab-content > .tab-pane.show.active { display: block; }

/* ---- Collapse / accordion ---- */
.collapse:not(.show) { display: none; }
.collapsing { height: 0; overflow: hidden; }

/* ---- Table helpers ---- */
.table-responsive { overflow-x: auto; width: 100%; }
.table-striped tbody tr:nth-child(odd) { background: #f8fafc; }
.table-bordered th,
.table-bordered td { border: 1px solid #e2e8f0; }

/* ---- Display / flex utilities ---- */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.justify-content-start { justify-content: flex-start !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-center { align-items: center !important; }
.align-items-end { align-items: flex-end !important; }
.gap-1 { gap: 0.25rem !important; }
.gap-2 { gap: 0.5rem !important; }
.gap-3 { gap: 1rem !important; }

@media (min-width: 768px) {
    .d-md-none { display: none !important; }
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
}
@media (min-width: 992px) {
    .d-lg-none { display: none !important; }
    .d-lg-block { display: block !important; }
    .d-lg-flex { display: flex !important; }
}

/* ---- Spacing (Bootstrap 5 scale) ---- */
.m-0 { margin: 0 !important; }
.m-1 { margin: 0.25rem !important; }
.m-2 { margin: 0.5rem !important; }
.m-3 { margin: 1rem !important; }
.m-4 { margin: 1.5rem !important; }
.m-5 { margin: 3rem !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }
.ms-0, .ml-0 { margin-left: 0 !important; }
.ms-1, .ml-1 { margin-left: 0.25rem !important; }
.ms-2, .ml-2 { margin-left: 0.5rem !important; }
.ms-3, .ml-3 { margin-left: 1rem !important; }
.me-0, .mr-0 { margin-right: 0 !important; }
.me-1, .mr-1 { margin-right: 0.25rem !important; }
.me-2, .mr-2 { margin-right: 0.5rem !important; }
.me-3, .mr-3 { margin-right: 1rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.my-2 { margin-top: 0.5rem !important; margin-bottom: 0.5rem !important; }
.my-3 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }
.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }
.pt-0 { padding-top: 0 !important; }
.pt-2 { padding-top: 0.5rem !important; }
.pt-3 { padding-top: 1rem !important; }
.pb-0 { padding-bottom: 0 !important; }
.pb-2 { padding-bottom: 0.5rem !important; }
.pb-3 { padding-bottom: 1rem !important; }
.px-2 { padding-left: 0.5rem !important; padding-right: 0.5rem !important; }
.px-3 { padding-left: 1rem !important; padding-right: 1rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }

.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.w-50 { width: 50% !important; }

.text-start { text-align: left !important; }
.text-end { text-align: right !important; }
.text-danger { color: #dc2626 !important; }
.text-success { color: #16a34a !important; }
.text-warning { color: #d97706 !important; }
.text-primary { color: #1D7697 !important; }
.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }
.fw-normal { font-weight: 400 !important; }
.small, small { font-size: 0.875em; }
.visually-hidden, .sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}
.img-fluid { max-width: 100%; height: auto; }
.list-unstyled { list-style: none; padding-left: 0; margin: 0; }
.shadow-sm { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.rounded { border-radius: 0.375rem; }
.border { border: 1px solid #e2e8f0; }
.border-0 { border: 0 !important; }
.bg-white { background: #fff !important; }
.bg-light { background: #f8fafc !important; }

.badge.bg-success { background: #16a34a; color: #fff; }
.badge.bg-danger { background: #dc2626; color: #fff; }
.badge.bg-warning { background: #f59e0b; color: #111; }
.badge.bg-secondary { background: #64748b; color: #fff; }
.badge.bg-info { background: #0ea5e9; color: #fff; }
.badge.bg-primary { background: #1D7697; color: #fff; }
