/* ------------------------------------------------------------------
   KycSolved brand theme — Bootstrap 5 overrides.

   Three brand colours, three jobs:
     navy  structure — chrome, headings, the active nav pill, the avatar
     gold  action    — primary buttons and nothing else that carries text
     red   danger    — errors, destructive actions, money going out

   Gold on white measures 2.70:1, so it must never be used for text or
   small marks. On a gold button the label is navy (6.20:1), not white
   (2.70:1) — which is also how the logo pairs the two.
   ------------------------------------------------------------------ */

:root {
    --ia-navy: #011e3c;
    --ia-gold: #cf9202;
    --ia-gold-dark: #b87f02;
    --ia-red: #c90000;

    /* Retained name: the whole sheet refers to the structural colour as --ia-dark. */
    --ia-dark: var(--ia-navy);

    --ia-bg: #f5f5f9;
    --ia-surface: #ffffff;
    --ia-border: #e6e6ea;
    --ia-text: #5d596c;
    --ia-muted: #a7a4b1;

    --ia-sidebar-width: 260px;
    --ia-radius: 0.5rem;
    --ia-shadow: 0 2px 6px rgba(67, 89, 113, 0.08);
    --ia-shadow-lg: 0 4px 18px rgba(67, 89, 113, 0.12);
}

html, body {
    height: 100%;
}

body {
    font-family: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background-color: var(--ia-bg);
    color: var(--ia-text);
    font-size: 0.9375rem;
    line-height: 1.5;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--ia-dark);
    font-weight: 600;
}

a {
    color: var(--ia-dark);
    text-decoration: none;
}

a:hover {
    color: var(--ia-navy);
    text-decoration: underline;
}

.text-muted-soft {
    color: var(--ia-muted) !important;
}

/* ---------------------------------------------------------- app shell */

.ia-shell {
    min-height: 100vh;
}

.ia-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--ia-sidebar-width);
    background: var(--ia-surface);
    border-right: 1px solid var(--ia-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    z-index: 1030;
}

.ia-content {
    margin-left: var(--ia-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* The topbar spans the full content column, so page padding lives here instead. */
.ia-page {
    flex: 1 1 auto;
    padding: 1.5rem 1.5rem 2.5rem;
}

/* ---------------------------------------------------------- brand */

.ia-brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 1.25rem 1.5rem 1rem;
    color: var(--ia-dark);
    font-weight: 700;
    font-size: 1.125rem;
    letter-spacing: -0.02em;
}

.ia-brand,
.ia-brand:hover {
    color: var(--ia-dark);
    text-decoration: none;
}

/* The client's own artwork. Height-constrained so any aspect ratio fits the fixed-width
   sidebar; a logo that set its own width would push the sidebar around. */
.ia-brand-logo {
    max-height: 44px;
    height: auto;
    width: auto;
    max-width: 100%;
    display: block;
}

/* No logo uploaded: the client's name carries the slot. Never our mark — this console is
   theirs while they are in it. */
.ia-brand-name {
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--ia-dark);
}

.ia-brand-logo-auth {
    height: 78px;
    margin: 0 auto;
}

.ia-brand-mark {
    height: 32px;
    width: auto;
    flex: 0 0 auto;
}

.ia-brand-badge {
    width: 34px;
    height: 34px;
    border-radius: 0.5rem;
    background: var(--ia-dark);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex: 0 0 auto;
}

/* ---------------------------------------------------------- sidebar nav */

.ia-nav {
    padding: 0.25rem 0.75rem 1.5rem;
    margin: 0;
    list-style: none;
}

.ia-nav-header {
    padding: 1.25rem 0.75rem 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ia-muted);
}

.ia-nav-link {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.125rem;
    border-radius: 2rem;
    color: var(--ia-text);
    font-size: 0.9375rem;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.ia-nav-link,
.ia-nav-link:hover,
.ia-nav-link:focus {
    text-decoration: none;
}

.ia-nav-link:hover {
    background: var(--ia-bg);
    color: var(--ia-dark);
}

.ia-nav-link.active {
    background: var(--ia-dark);
    color: #fff;
    font-weight: 500;
}

.ia-nav-link.active:hover {
    background: var(--ia-dark);
    color: #fff;
}

.ia-nav-link i {
    font-size: 1.0625rem;
    line-height: 1;
}

/* A parent row is a disclosure control, not a destination: it never takes the
   dark active pill, since the pill marks the page you are actually on. */
.ia-nav-parent .ia-nav-caret {
    font-size: 0.75rem;
    transition: transform 0.15s ease;
}

.ia-nav-parent.collapsed .ia-nav-caret {
    transform: rotate(-90deg);
}

.ia-nav-parent[aria-expanded="true"] {
    color: var(--ia-navy);
    font-weight: 500;
}

.ia-nav-sub {
    list-style: none;
    margin: 0.125rem 0 0.25rem;
    padding-left: 1.9375rem;
}

.ia-nav-sub .ia-nav-link {
    padding-left: 0.75rem;
    font-size: 0.9063rem;
}

/* The client's standing position, pinned to the foot of the sidebar. The nav above
   takes the slack so this sits at the bottom however short the menu is. */
.ia-nav {
    flex: 1 1 auto;
}

.ia-usage {
    flex: 0 0 auto;
    margin-top: auto;
    padding: 0.875rem 1.5rem 1.125rem;
    border-top: 1px solid var(--ia-border);
    background: var(--ia-surface);
}

.ia-usage-header {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ia-muted);
    margin-bottom: 0.5rem;
}

.ia-usage-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--ia-text);
    padding: 0.1875rem 0;
}

.ia-usage-figure {
    font-weight: 600;
    color: var(--ia-dark);
    font-variant-numeric: tabular-nums;
}

.ia-usage-warning {
    margin-top: 0.625rem;
    font-size: 0.75rem;
    line-height: 1.35;
    color: var(--ia-red);
}

/* ---------------------------------------------------------- floating navbar */

/* THE ONE BLOCK THAT DIFFERS BETWEEN THE TWO APPLICATIONS. This is the self-service
   Portal's copy: navy topbar, the client-facing product's signature. The administrative
   console's copy of this sheet keeps the bar light. Everything else in this file is
   identical in both copies; keep it that way.

   Flush to the top and to both edges of the content column: no margin, and square
   corners, since a rounded bar against the viewport edge reads as a rendering fault.
   Navy ground, so everything inside it inverts: white text (16.77:1) and a gold
   avatar disc (6.20:1) rather than the navy-on-white used elsewhere. */
.ia-topbar {
    background: var(--ia-navy);
    border-bottom: 1px solid var(--ia-navy);
    border-radius: 0;
    box-shadow: var(--ia-shadow);
    padding: 0.625rem 1.5rem;
    margin: 0;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
}

.ia-topbar .ia-avatar {
    background: var(--ia-gold);
    color: var(--ia-navy);
}

.ia-topbar .btn-link,
.ia-topbar .dropdown-toggle {
    color: #fff;
}

.ia-topbar .btn-link:hover,
.ia-topbar .dropdown-toggle:hover {
    color: var(--ia-gold);
}

.ia-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--ia-dark);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.ia-topbar .dropdown-toggle::after {
    display: none;
}

.dropdown-menu {
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    box-shadow: var(--ia-shadow-lg);
    font-size: 0.9375rem;
}

/* ---------------------------------------------------------- cards */

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

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--ia-border);
    padding: 1rem 1.25rem;
    font-weight: 600;
    color: var(--ia-dark);
}

.card-body {
    padding: 1.25rem;
}

.ia-stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--ia-dark);
    line-height: 1.2;
}

.ia-stat-label {
    font-size: 0.8125rem;
    color: var(--ia-muted);
}

/* A revealed secret needs to look like something you should not leave on screen. */
.ia-secret-card {
    border-color: var(--ia-gold);
    background: #fffdf7;
}

.ia-secret {
    font-size: 1rem;
    padding: 0.625rem 0.75rem;
    background: var(--ia-bg);
    border: 1px solid var(--ia-border);
    border-radius: 0.375rem;
    color: var(--ia-dark);
    word-break: break-all;
    user-select: all;
}

/* ---------------------------------------------------------- tables */

.table {
    color: var(--ia-text);
    margin-bottom: 0;
}

.table > thead > tr > th {
    background: #fcfcfd;
    border-bottom: 1px solid var(--ia-border);
    color: var(--ia-muted);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table > tbody > tr > td {
    border-bottom: 1px solid var(--ia-border);
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.table > tbody > tr:last-child > td {
    border-bottom: 0;
}

/* ---------------------------------------------------------- buttons */

.btn {
    border-radius: 0.375rem;
    font-size: 0.9375rem;
    padding: 0.4375rem 1rem;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn-primary {
    background-color: var(--ia-gold);
    border-color: var(--ia-gold);
    color: var(--ia-navy);
    font-weight: 500;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary:first-child:active {
    background-color: var(--ia-gold-dark);
    border-color: var(--ia-gold-dark);
    color: var(--ia-navy);
}

.btn-primary:focus-visible {
    box-shadow: 0 0 0 0.2rem rgba(207, 146, 2, 0.35);
}

/* Destructive actions get the third brand colour, and only they do. */
.btn-danger {
    background-color: var(--ia-red);
    border-color: var(--ia-red);
    color: #fff;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active,
.btn-danger:first-child:active {
    background-color: #a80000;
    border-color: #a80000;
    color: #fff;
}

.btn-outline-secondary {
    border-color: var(--ia-border);
    color: var(--ia-text);
}

.btn-outline-secondary:hover {
    background-color: var(--ia-bg);
    border-color: var(--ia-border);
    color: var(--ia-dark);
}

.btn-link {
    color: var(--ia-navy);
    text-decoration: none;
}

.btn-link:hover {
    color: var(--ia-navy);
    text-decoration: underline;
}

/* ---------------------------------------------------------- forms */

.form-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ia-dark);
    margin-bottom: 0.3125rem;
}

.form-control,
.form-select {
    border-color: var(--ia-border);
    border-radius: 0.375rem;
    color: var(--ia-text);
    font-size: 0.9375rem;
    padding: 0.4375rem 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ia-gold);
    box-shadow: 0 0 0 0.15rem rgba(207, 146, 2, 0.2);
}

.form-check-input:checked {
    background-color: var(--ia-dark);
    border-color: var(--ia-dark);
}

.form-text,
.text-danger {
    font-size: 0.8125rem;
}

/* ---------------------------------------------------------- badges & alerts */

.badge {
    font-weight: 500;
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
    border-radius: 0.25rem;
}

.badge-soft-success { background: #e8f5ee; color: #1f7a4d; }
.badge-soft-danger  { background: #fdeaea; color: var(--ia-red); }
.badge-soft-gold    { background: #fdf3e0; color: #7a5601; }
.badge-soft-muted   { background: var(--ia-bg); color: var(--ia-muted); }
.badge-soft-dark    { background: #e7ecf2; color: var(--ia-navy); }

.alert {
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    font-size: 0.9375rem;
}

.alert-success { background: #e8f5ee; border-color: #cbe8d9; color: #1f7a4d; }
.alert-danger  { background: #fdeaea; border-color: #f5cfcf; color: var(--ia-red); }

/* ---------------------------------------------------------- auth pages */

.ia-auth {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: var(--ia-bg);
}

.ia-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--ia-surface);
    border: 1px solid var(--ia-border);
    border-radius: var(--ia-radius);
    box-shadow: var(--ia-shadow-lg);
    padding: 2rem;
}

.ia-auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--ia-dark);
    letter-spacing: -0.02em;
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 991.98px) {
    .ia-sidebar {
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .ia-sidebar.show {
        transform: translateX(0);
        box-shadow: var(--ia-shadow-lg);
    }

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

    .ia-page {
        padding: 1rem;
    }
}

/* A capture thumbnail on a verification. The zoom badge is the affordance: without it a
   picture on a page does not read as something you can open. */
.ia-capture {
    position: relative;
    display: block;
    cursor: zoom-in;
}

.ia-capture-zoom {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    background: rgba(1, 30, 60, 0.72);
    color: #fff;
    font-size: 0.85rem;
}

.ia-capture:hover .ia-capture-zoom { background: rgba(1, 30, 60, 0.92); }
