/*
 * Metronic-inspired theme for Tempr Portal.
 * This is an original stylesheet built on top of Bootstrap 5 utility
 * classes -- it does not include or redistribute any Keenthemes/Metronic
 * assets, which are commercially licensed.
 */

:root {
    --orcc-sidebar-bg: #1e1e2d;
    --orcc-sidebar-bg-hover: #2a2a3c;
    --orcc-sidebar-text: #9899ac;
    --orcc-sidebar-text-active: #ffffff;
    --orcc-accent: #009ef7;
    --orcc-accent-dark: #0095e8;
    --orcc-content-bg: #f5f8fa;
    --orcc-card-radius: 0.75rem;
    --orcc-topbar-height: 65px;
    --orcc-sidebar-width: 265px;
}

body {
    background-color: var(--orcc-content-bg);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #181c32;
}

/* ---------- App shell ---------- */

.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--orcc-sidebar-width);
    background-color: var(--orcc-sidebar-bg);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.app-sidebar .sidebar-brand {
    height: var(--orcc-topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    color: #ffffff;
    font-weight: 600;
    font-size: 1.15rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-sidebar .sidebar-brand:hover {
    color: #ffffff;
}

.app-sidebar .sidebar-brand i {
    color: var(--orcc-accent);
    margin-right: 0.6rem;
    font-size: 1.4rem;
}

.app-sidebar .sidebar-brand img {
    margin-right: 0.6rem;
    display: block;
}

.app-sidebar .nav {
    padding: 1rem 0.75rem;
    flex: 1 1 auto;
}

.app-sidebar .nav-link {
    color: var(--orcc-sidebar-text);
    border-radius: 0.5rem;
    padding: 0.65rem 1rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.app-sidebar .nav-link i {
    margin-right: 0.7rem;
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
}

.app-sidebar .nav-link:hover {
    background-color: var(--orcc-sidebar-bg-hover);
    color: #ffffff;
}

.app-sidebar .nav-link.active {
    background-color: var(--orcc-accent);
    color: #ffffff;
}

.app-sidebar .sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.app-sidebar .sidebar-footer form button {
    width: 100%;
}

/* ---------- Content area ---------- */

.app-content-wrapper {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    height: var(--orcc-topbar-height);
    background-color: #ffffff;
    border-bottom: 1px solid #eff2f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
}

.app-topbar .page-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #181c32;
}

.app-topbar .topbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.app-topbar .topbar-user .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--orcc-accent);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.app-topbar .topbar-user .topbar-user-name {
    font-weight: 500;
    color: #181c32;
    white-space: nowrap;
}

.app-main {
    flex: 1 1 auto;
    padding: 2rem 1.75rem;
    position: relative;
}

/* ---------- SPA nav loading spinner ---------- */

.app-main-loading-overlay {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.6);
    z-index: 10;
}

.app-main-loading-overlay.active {
    display: flex;
}

.app-main-loading-overlay .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--orcc-accent);
}

/* ---------- Cards ---------- */

.card {
    border: none;
    border-radius: var(--orcc-card-radius);
    box-shadow: 0 0.1rem 0.75rem rgba(0, 0, 0, 0.04);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid #eff2f5;
    font-weight: 600;
    padding: 1.1rem 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* ---------- Tables ---------- */

.table-metronic thead th {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
    color: #99a1b7;
    font-weight: 600;
    border-bottom: 1px dashed #eff2f5;
}

.table-metronic tbody td {
    border-bottom: 1px dashed #eff2f5;
    vertical-align: middle;
}

.table-metronic tbody tr:last-child td {
    border-bottom: none;
}

/* ---------- Buttons ---------- */

.btn-primary {
    background-color: var(--orcc-accent);
    border-color: var(--orcc-accent);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--orcc-accent-dark);
    border-color: var(--orcc-accent-dark);
}

/* ---------- BYOK settings-style provider list ---------- */

.byok-provider-list {
    display: flex;
    flex-direction: column;
}

.byok-provider-row {
    display: grid;
    grid-template-columns: 180px 160px minmax(320px, 640px) auto;
    align-items: center;
    column-gap: 2rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.byok-provider-row:last-child {
    border-bottom: none;
}

.byok-provider-header {
    padding-bottom: 0.6rem;
    border-bottom-width: 2px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--bs-secondary-color, #6c757d);
}

.byok-provider-name {
    font-weight: 600;
    text-transform: capitalize;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.byok-provider-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    object-fit: contain;
}

.byok-provider-icon-fallback {
    font-size: 1rem;
    color: var(--bs-secondary-color, #6c757d);
}

.byok-col-keyaction {
    display: contents;
}

.byok-key-column {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    width: 100%;
}

.byok-key-input-wrap {
    position: relative;
    width: 100%;
}

.byok-key-input {
    width: 100%;
    padding-right: 2.25rem;
}

.byok-key-toggle {
    position: absolute;
    top: 50%;
    right: 0.4rem;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--bs-secondary-color, #6c757d);
    padding: 0.15rem 0.35rem;
    line-height: 1;
    display: flex;
    align-items: center;
}

.byok-key-toggle:hover {
    color: var(--orcc-accent, #0d6efd);
}

.byok-key-actions {
    display: flex;
    gap: 0.5rem;
    grid-column: 4;
}

.byok-provider-actions form {
    margin: 0;
}


/* ---------- Auth pages ---------- */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--orcc-sidebar-bg);
    background-image: radial-gradient(circle at top left, #2a2a45 0%, var(--orcc-sidebar-bg) 60%);
    padding: 2rem 1rem;
}

.auth-page .auth-brand {
    color: #ffffff;
    font-weight: 600;
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.auth-page .auth-brand i {
    color: var(--orcc-accent);
    margin-right: 0.6rem;
    font-size: 1.6rem;
}

.auth-page .auth-brand img {
    margin-right: 0.6rem;
    display: block;
}
