/* ---- Sidebar ---- */

.end-align {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}


.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 252px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.25);
}

.sidebar-brand {
    padding: 1.4rem 1.25rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #C41230 0%, #C41230cc 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(196, 18, 48, 0.4);
}

.sidebar-brand-title {
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    display: block;
    line-height: 1.3;
}

.sidebar-brand-sub {
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.65rem;
    display: block;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.sidebar-section {
    padding: 1rem 1.25rem 0.3rem;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.3);
}

.sidebar-nav .nav-link {
    padding: 0.6rem 1.25rem;
    color: rgba(255, 255, 255, 0.58);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
    border-radius: 0;
}

.sidebar-nav .nav-link i {
    width: 18px;
    text-align: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.06);
    border-left-color: rgba(255, 255, 255, 0.2);
}

.sidebar-nav .nav-link.active {
    color: #fca5a5;
    background: rgba(196, 18, 48, 0.2);
    border-left-color: #C41230;
    font-weight: 600;
}

.sidebar-footer {
    padding: 0.875rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---- Main Wrapper ---- */
.main-wrapper {
    margin-left: 252px;
    min-height: 100vh;
    background: #f1f5f9;
}

.page-content {
    padding: 1.75rem 2rem 2.5rem;
}

/* ---- Page Header ---- */
.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header-left .page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.page-header-left .page-subtitle {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0;
}

.title-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* ---- Table Wrapper ---- */
.table-wrapper {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    background: white;
}

.table-wrapper .table {
    margin-bottom: 0;
}

.table-wrapper .table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    border-top: none;
    color: #64748b;
    font-size: 0.71rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.875rem 1.1rem;
    white-space: nowrap;
}

.table-wrapper .table tbody td {
    padding: 0.8rem 1.1rem;
    vertical-align: middle;
    border-color: #f1f5f9;
    color: #374151;
    font-size: 0.875rem;
}

.table-wrapper .table tbody tr:hover {
    background: #f8f9ff;
}

.table-wrapper .table tbody tr:last-child td {
    border-bottom: none;
}

.table-footer {
    padding: 0.6rem 1.1rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 0.78rem;
    color: #94a3b8;
}

/* ---- Forms ---- */
.form-control,
.form-select {
    border-radius: 8px;
    border-color: #d1d5db;
    font-size: 0.875rem;
    color: #374151;
}

.form-control:focus,
.form-select:focus {
    border-color: #C41230;
    box-shadow: 0 0 0 3px rgba(196, 18, 48, 0.12);
}

.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
}

.form-check-input:checked {
    background-color: #C41230;
    border-color: #C41230;
}

.input-group-text {
    border-color: #d1d5db;
    border-radius: 8px 0 0 8px;
}

.input-group .form-control {
    border-radius: 0 8px 8px 0;
}

/* ---- Buttons ---- */
.btn {
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, #C41230, #8B0E22) !important;
    border-color: transparent !important;
    box-shadow: 0 2px 8px rgba(196, 18, 48, 0.3) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #8B0E22, #C41230) !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(196, 18, 48, 0.4) !important;
}

.btn-sm {
    font-size: 0.78rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
}

/* ---- Cards ---- */
.card {
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
    background: white;
}

.card-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-radius: 11px 11px 0 0 !important;
    padding: 0.875rem 1.25rem !important;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
}

.card-header i {
    color: #C41230;
    font-size: 0.85rem;
}

.card-footer {
    border-top: 1px solid #e2e8f0 !important;
    border-radius: 0 0 11px 11px !important;
    background: #f8fafc !important;
    padding: 0.75rem 1.25rem !important;
}

/* ---- Tabs Navigation ---- */
.bottombar-tabs {
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0.25rem;
    background-color: var(--color-white);
    border-bottom: 1px solid rgba(58, 67, 79, 0.1);
    border-radius: 0.75rem 0.75rem 0 0;
    /* Hide the horizontal scrollbar while keeping the strip scrollable on overflow */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.bottombar-tabs::-webkit-scrollbar {
    display: none;
}

.bottombar-tab {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    user-select: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0.85rem 1.15rem;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--color-grey);
    border-radius: 0.5rem 0.5rem 0 0;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.bottombar-tab__icon {
    margin-inline-end: 0.5rem;
    font-size: 0.95em;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

/* Animated underline indicator — grows from center, no layout shift */
.bottombar-tab::after {
    content: "";
    position: absolute;
    left: 0.9rem;
    right: 0.9rem;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background-color: var(--color-freshopp-primary-darker);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.25s ease;
}

.bottombar-tab:hover:not(.active) {
    color: var(--color-freshopp-primary-darker);
    background-color: rgba(var(--bs-primary-rgb), 0.08);
}

.bottombar-tab:hover:not(.active)::after {
    transform: scaleX(0.4);
}

.bottombar-tab:hover .bottombar-tab__icon,
.bottombar-tab.active .bottombar-tab__icon {
    opacity: 1;
}

.bottombar-tab.active {
    color: var(--color-freshopp-primary-darker);
}

.bottombar-tab.active::after {
    transform: scaleX(1);
}

.bottombar-tab:focus-visible {
    outline: 2px solid var(--color-freshopp-primary);
    outline-offset: -2px;
}

.bottombar-panel {
    background-color: var(--color-white);
    border-radius: 0 0 0.75rem 0.75rem;
    box-shadow: 0 1px 3px rgba(58, 67, 79, 0.08), 0 1px 2px rgba(58, 67, 79, 0.04);
    margin-bottom: 1rem;
    /* Scroll instead of squishing dense sub-components below their minimum width */
    overflow-x: auto;
}

/* Every component rendered in the bar keeps a usable minimum width (padding included) */
.bottombar-panel__content {
    min-width: 500px;
    padding: 1.5rem;
}

/* ---- SQL editor (BlazorMonaco has no height of its own) ---- */

.sql-editor {
    height: 450px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}
