/* Tailwind migration bridge: keeps existing templates functional without Bootstrap CSS */

body {
    margin: 0;
    line-height: 1.5;
}

a {
    color: inherit;
}

.container {
    width: min(100%, 1200px);
    margin-inline: auto;
    padding-inline: 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-inline: -0.5rem;
}

.row > * {
    width: 100%;
    padding-inline: 0.5rem;
}

.g-3 { row-gap: 1rem; }
.g-4 { row-gap: 1.5rem; }

.col-12 { width: 100%; }

@media (min-width: 768px) {
    .col-md-3 { width: 25%; }
    .col-md-4 { width: 33.333333%; }
    .col-md-6 { width: 50%; }
    .col-md-8 { width: 66.666667%; }
    .d-md-none { display: none !important; }
}

@media (min-width: 1024px) {
    .col-lg-3 { width: 25%; }
    .col-lg-4 { width: 33.333333%; }
    .col-lg-6 { width: 50%; }
    .col-lg-8 { width: 66.666667%; }
}

.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.d-none { display: none !important; }
.align-items-center { align-items: center !important; }
.align-items-end { align-items: flex-end !important; }
.justify-content-between { justify-content: space-between !important; }
.justify-content-center { justify-content: center !important; }
.text-center { text-align: center !important; }
.text-end { text-align: right !important; }
.flex-grow-1 { flex: 1 1 auto !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.gap-2 { gap: 0.5rem !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; }
.me-2 { margin-right: 0.5rem !important; }
.me-3 { margin-right: 1rem !important; }
.ms-2 { margin-left: 0.5rem !important; }
.ms-3 { margin-left: 1rem !important; }
.my-2 { margin-block: 0.5rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.py-4 { padding-block: 1.5rem !important; }
.small, small { font-size: 0.875rem; }
.lead { font-size: 1.125rem; }

.fw-bold { font-weight: 700 !important; }
.fw-semibold { font-weight: 600 !important; }

.text-muted { color: #64748b !important; }
.text-primary { color: #2563eb !important; }
.text-success { color: #059669 !important; }
.text-warning { color: #d97706 !important; }
.text-danger { color: #dc2626 !important; }
.text-info { color: #0284c7 !important; }
.text-dark { color: #0f172a !important; }

.bg-light { background: #f8fafc !important; }
.rounded { border-radius: 0.75rem !important; }
.border { border: 1px solid #dbe3f0 !important; }

.card {
    background: #fff;
    border: 1px solid #dbe3f0;
    border-radius: 1rem;
    box-shadow: 0 12px 30px -22px rgba(15, 23, 42, 0.5);
}

.card-header {
    padding: 0.9rem 1.1rem;
    border-bottom: 1px solid #e2e8f0;
}

.card-body {
    padding: 1.1rem;
}

.card-title {
    margin: 0;
    font-weight: 600;
}

.btn {
    border: 1px solid transparent;
    border-radius: 0.65rem;
    padding: 0.55rem 0.9rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.btn-outline-primary {
    color: #1d4ed8;
    border-color: #bfdbfe;
    background: #fff;
}

.btn-outline-primary:hover {
    background: #eff6ff;
}

.btn-outline-secondary {
    color: #334155;
    border-color: #cbd5e1;
    background: #fff;
}

.btn-outline-success {
    color: #047857;
    border-color: #a7f3d0;
    background: #fff;
}

.btn-success {
    color: #fff;
    background: #059669;
}

.btn-link {
    color: #334155;
    background: transparent;
    border-color: transparent;
    padding: 0.25rem 0.35rem;
}

.btn-sm {
    font-size: 0.85rem;
    padding: 0.4rem 0.65rem;
}

.btn-group {
    display: inline-flex;
    border-radius: 0.75rem;
    overflow: hidden;
}

.btn-group > .btn,
.btn-group > label.btn {
    border-radius: 0;
}

.btn-check {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.btn-check:checked + .btn-outline-primary {
    background: #e0edff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.form-label {
    display: inline-block;
    margin-bottom: 0.4rem;
    font-weight: 500;
    color: #334155;
}

.form-control,
.form-select {
    width: 100%;
    border: 1px solid #cfd9ea;
    border-radius: 0.7rem;
    background: #fff;
    padding: 0.6rem 0.75rem;
    font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #93c5fd;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-floating {
    position: relative;
}

.form-floating > .form-control {
    padding-top: 1.4rem;
    padding-bottom: 0.45rem;
}

.form-floating > label {
    position: absolute;
    left: 0.75rem;
    top: 0.6rem;
    font-size: 0.82rem;
    color: #64748b;
}

.input-group {
    display: flex;
}

.input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    z-index: 1000;
    min-width: 12rem;
    margin-top: 0.45rem;
    padding: 0.35rem;
    background: #fff;
    border: 1px solid #dbe3f0;
    border-radius: 0.8rem;
    box-shadow: 0 20px 40px -30px rgba(15, 23, 42, 0.65);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 0.45rem 0.65rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #1e293b;
}

.dropdown-item:hover {
    background: #f1f5f9;
}

.dropdown-divider {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 0.35rem 0;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 0.7rem 0.65rem;
}

.table th {
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #475569;
    background: #f8fbff;
}

.table-responsive {
    overflow-x: auto;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.nav {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.nav-tabs {
    display: flex;
    gap: 0.45rem;
    border-bottom: 0;
}

.nav-tabs .nav-link {
    border: 1px solid #d7e3f5;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-weight: 600;
    padding: 0.45rem 0.85rem;
    cursor: pointer;
}

.nav-tabs .nav-link.active {
    border-color: #93c5fd;
    background: #eaf3ff;
    color: #1d4ed8;
}

.tab-content > .tab-pane {
    display: none;
}

.tab-content > .active {
    display: block;
}

.fade {
    transition: opacity 0.18s linear;
}

.fade:not(.show) {
    opacity: 0;
}

.alert {
    border-radius: 0.75rem;
    padding: 0.8rem 0.95rem;
    border: 1px solid;
    margin-bottom: 1rem;
}

.alert-success {
    color: #14532d;
    border-color: #86efac;
    background: #f0fdf4;
}

.alert-info {
    color: #0c4a6e;
    border-color: #7dd3fc;
    background: #f0f9ff;
}

.alert-warning {
    color: #78350f;
    border-color: #fcd34d;
    background: #fffbeb;
}

.alert-danger,
.alert-error {
    color: #7f1d1d;
    border-color: #fca5a5;
    background: #fef2f2;
}

.alert-dismissible {
    position: relative;
    padding-right: 2.3rem;
}

.btn-close {
    position: absolute;
    right: 0.6rem;
    top: 0.55rem;
    width: 1.25rem;
    height: 1.25rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    opacity: 0.65;
}

.btn-close::before {
    content: "×";
    font-size: 1.2rem;
    line-height: 1;
    color: #334155;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1050;
    display: none;
    overflow-x: hidden;
    overflow-y: auto;
}

.modal.show {
    display: block;
}

.modal-dialog {
    width: min(100% - 1.5rem, 560px);
    margin: 1.75rem auto;
}

.modal-dialog-centered {
    display: flex;
    min-height: calc(100% - 1.75rem * 2);
    align-items: center;
}

.modal-content {
    width: 100%;
    background: #fff;
    border: 1px solid #dbe3f0;
    border-radius: 1rem;
}

.modal-header,
.modal-body {
    padding: 1rem 1.1rem;
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    margin: 0;
    font-size: 1.05rem;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(15, 23, 42, 0.55);
}

.modal-backdrop.fade {
    opacity: 0;
}

.modal-backdrop.show {
    opacity: 1;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15rem;
}

.spinner-border {
    display: inline-block;
    border: 0.2rem solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-rotate 0.75s linear infinite;
}

@keyframes spinner-rotate {
    to { transform: rotate(360deg); }
}
