/* Dashboard / app chrome */

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.app-sidebar {
    background: linear-gradient(180deg, #111214, #16324f 70%, #01315F);
    color: rgba(247, 250, 251, 0.82);
    padding: 1.75rem 1.25rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
}

.app-sidebar .brand {
    margin-bottom: 1.5rem;
    display: inline-flex;
}

.app-sidebar .brand-logo {
    height: 108px;
    width: auto;
    background: transparent;
    padding: 0;
}

.app-nav {
    display: grid;
    gap: 0.35rem;
}

.app-nav a {
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 500;
    color: rgba(247, 250, 251, 0.75);
    transition: background 0.2s ease, color 0.2s ease;
}

.app-nav a:hover,
.app-nav a.is-active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.app-sidebar-foot {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.85rem;
}

.app-main {
    padding: 1.75rem 1.75rem 3rem;
}

.app-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.app-top h1 {
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    color: var(--navy);
    margin: 0 0 0.25rem;
}

.app-top p {
    margin: 0;
    color: var(--muted);
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.15rem 1.25rem;
}

.stat-card span {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.stat-card strong {
    font-family: var(--font-display);
    font-size: 1.55rem;
    color: var(--navy);
    letter-spacing: -0.02em;
}

.panel {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.35rem;
    margin-bottom: 1.25rem;
}

.panel h2 {
    font-size: 1.25rem;
    color: var(--navy);
    margin-bottom: 1rem;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.panel-head h2 {
    margin: 0;
}

.table-wrap {
    overflow-x: auto;
}

table.data {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

table.data th,
table.data td {
    text-align: left;
    padding: 0.75rem 0.6rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

table.data th {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 600;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-ok { background: rgba(31, 138, 122, 0.15); color: var(--seafoam-dark); }
.badge-warn { background: rgba(214, 196, 168, 0.45); color: #7a5c2e; }
.badge-danger { background: rgba(180, 60, 60, 0.12); color: #8f2f2f; }
.badge-muted { background: rgba(12, 36, 56, 0.08); color: var(--muted); }

.alert {
    padding: 0.9rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

.alert-success { background: rgba(31, 138, 122, 0.12); color: var(--seafoam-dark); }
.alert-error { background: rgba(180, 60, 60, 0.12); color: #8f2f2f; }
.alert-info { background: rgba(12, 36, 56, 0.08); color: var(--navy); }

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
}

.stage-list {
    display: grid;
    gap: 0.75rem;
}

.stage-item {
    display: grid;
    grid-template-columns: 3rem 1fr 1fr auto;
    gap: 0.65rem;
    align-items: end;
    padding: 0.85rem;
    border: 1px dashed var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
}

.customer-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.customer-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.passport-thumb {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--line);
    background: #fff;
    flex-shrink: 0;
}

.passport-thumb-lg {
    width: 72px;
    height: 72px;
    border-radius: 14px;
}

.passport-preview {
    width: 140px;
    height: 170px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.passport-placeholder {
    background: linear-gradient(145deg, rgba(31, 138, 122, 0.15), rgba(12, 36, 56, 0.12));
    color: var(--navy);
    font-family: var(--font-display);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.passport-upload-row {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    align-items: flex-start;
}

.account-number-row {
    display: flex;
    gap: 0.65rem;
    align-items: center;
}

.account-number-row input {
    flex: 1;
}

.account-number-display {
    letter-spacing: 0.04em;
    word-break: break-all;
}

.inline-form {
    display: inline;
}

.btn-sm {
    padding: 0.45rem 0.8rem;
    font-size: 0.82rem;
}

.btn-danger {
    background: #8f2f2f;
    color: #fff;
}

.btn-danger:hover {
    background: #6f2323;
}

.qr-box {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    align-items: center;
}

.qr-box img {
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    padding: 0.5rem;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .app-sidebar {
        position: relative;
        height: auto;
    }

    .grid-2,
    .grid-3,
    .stage-item {
        grid-template-columns: 1fr;
    }
}
