
:root {
    --portal-bg: #f3f6fb;
    --portal-surface: #ffffff;
    --portal-sidebar: #17324d;
    --portal-sidebar-2: #0f2439;
    --portal-accent: #1f7ae0;
    --portal-accent-2: #0e5fbd;
    --portal-text: #213547;
    --portal-muted: #6b7b8c;
    --portal-border: #dbe5ef;
    --portal-success: #188754;
    --portal-warning: #d18a00;
    --portal-danger: #c43838;
    --portal-shadow: 0 14px 36px rgba(20, 45, 76, 0.10);
    --portal-radius: 18px;
}

html,
body {
    min-height: 100%;
}

body {
    background: var(--portal-bg);
    color: var(--portal-text);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

a {
    text-decoration: none;
}

.portal-auth {
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(31, 122, 224, 0.18), transparent 24%),
        radial-gradient(circle at bottom left, rgba(15, 36, 57, 0.16), transparent 28%),
        linear-gradient(135deg, #e9f1fb 0%, #f7f9fd 48%, #edf3fb 100%);
}

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 1100px;
    background: var(--portal-surface);
    border: 1px solid rgba(219, 229, 239, 0.8);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: var(--portal-shadow);
}

.auth-brand {
    background:
        linear-gradient(155deg, rgba(11, 32, 59, 0.96), rgba(22, 62, 104, 0.94)),
        linear-gradient(0deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06));
    color: #fff;
    padding: 3rem;
    height: 100%;
}

.auth-brand .badge {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.auth-brand h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.auth-brand p {
    color: rgba(255, 255, 255, 0.84);
}

.auth-form-wrap {
    padding: 3rem;
}

.auth-form-wrap h2 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.auth-form-wrap .form-control,
.auth-form-wrap .form-select,
.portal-content .form-control,
.portal-content .form-select,
.portal-content .form-check-input {
    border-radius: 12px;
    border-color: #cad7e4;
    min-height: 48px;
}

.portal-content textarea.form-control {
    min-height: 120px;
}

.form-section-card,
.card-stat,
.portal-panel,
.portal-table-card,
.portal-hero,
.step-card {
    background: var(--portal-surface);
    border: 1px solid rgba(219, 229, 239, 0.95);
    border-radius: var(--portal-radius);
    box-shadow: 0 8px 24px rgba(20, 45, 76, 0.06);
}

.btn {
    border-radius: 12px;
    min-height: 44px;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, var(--portal-accent), var(--portal-accent-2));
    border-color: transparent;
}

.btn-outline-primary {
    border-color: #bad4f2;
    color: var(--portal-accent-2);
}

.btn-soft {
    background: #edf5ff;
    color: var(--portal-accent-2);
    border: 1px solid #d0e3f8;
}

.btn-soft-danger {
    background: #fff2f2;
    color: var(--portal-danger);
    border: 1px solid #f6d1d1;
}

.portal-shell {
    display: flex;
    min-height: 100vh;
}

.portal-sidebar {
    width: 280px;
    background:
        linear-gradient(180deg, var(--portal-sidebar) 0%, var(--portal-sidebar-2) 100%);
    color: #fff;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    padding: 1.25rem;
    z-index: 1030;
}

.portal-brand {
    padding: 1rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.07);
    margin-bottom: 1rem;
}

.portal-brand .logo-mark {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #45a2ff, #1667d1);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    margin-right: 0.85rem;
}

.portal-brand h1 {
    font-size: 1.2rem;
    margin-bottom: 0.1rem;
    font-weight: 700;
}

.portal-brand small {
    color: rgba(255, 255, 255, 0.72);
}

.portal-user {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 18px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.portal-user .avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 0.75rem;
}

.portal-nav .nav-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.52);
    margin: 1.15rem 0 0.55rem;
    padding-left: 0.85rem;
}

.portal-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
    border-radius: 14px;
    padding: 0.85rem 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

.portal-nav .nav-link:hover,
.portal-nav .nav-link.active {
    background: linear-gradient(135deg, rgba(69, 162, 255, 0.28), rgba(22, 103, 209, 0.22));
    color: #fff;
}

.portal-nav .nav-link i {
    width: 18px;
    text-align: center;
}

.portal-main {
    margin-left: 280px;
    width: calc(100% - 280px);
    min-height: 100vh;
}

.portal-topbar {
    padding: 1.1rem 1.5rem;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(219, 229, 239, 0.9);
    position: sticky;
    top: 0;
    z-index: 1020;
}

.portal-topbar .top-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #edf5ff;
    color: var(--portal-accent-2);
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    font-weight: 600;
}

.portal-content {
    padding: 1.5rem;
}

.portal-hero {
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background:
        linear-gradient(135deg, rgba(28, 106, 191, 0.94), rgba(16, 72, 136, 0.96)),
        linear-gradient(180deg, #fff, #fff);
    color: #fff;
}

.portal-hero p,
.portal-hero small {
    color: rgba(255, 255, 255, 0.86);
}

.card-stat {
    padding: 1.1rem 1.2rem;
    height: 100%;
}

.card-stat .icon {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    background: #edf5ff;
    color: var(--portal-accent-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.card-stat h3 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0.75rem 0 0.2rem;
}

.portal-panel {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.portal-panel .panel-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.portal-table-card {
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.table {
    vertical-align: middle;
}

.table thead th {
    border-bottom-width: 1px;
    color: #5a7085;
    font-size: 0.86rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.table tbody td {
    white-space: nowrap;
}

.table-responsive {
    border-radius: 14px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    gap: 0.35rem;
}

.status-approved,
.status-active,
.status-complete {
    background: #e9f7f0;
    color: var(--portal-success);
}

.status-pending,
.status-submitted,
.status-draft {
    background: #fff8e5;
    color: var(--portal-warning);
}

.status-declined,
.status-cancelled,
.status-blocked {
    background: #fff1f1;
    color: var(--portal-danger);
}

.status-shipped,
.status-invoiced {
    background: #edf5ff;
    color: var(--portal-accent-2);
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.toolbar .toolbar-actions,
.toolbar .toolbar-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.quick-tile {
    padding: 1.2rem;
    height: 100%;
}

.quick-tile .quick-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #edf5ff;
    color: var(--portal-accent-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.85rem;
    font-size: 1.2rem;
}

.step-card {
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.step-card .step-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
}

.manufacturer-card {
    border: 1px solid #d6e4f0;
    border-radius: 16px;
    padding: 1rem;
    height: 100%;
    cursor: pointer;
    background: #fff;
}

.manufacturer-card.active {
    border-color: #83b8f2;
    box-shadow: inset 0 0 0 1px #83b8f2;
    background: #f4f9ff;
}

.doc-card {
    padding: 1rem;
    border: 1px solid var(--portal-border);
    border-radius: 16px;
    height: 100%;
    background: #fff;
}

.signature-preview {
    min-height: 58px;
    border: 1px dashed #bfd5ec;
    border-radius: 12px;
    padding: 0.9rem 1rem;
    font-family: "Brush Script MT", "Segoe Script", cursive;
    font-size: 1.7rem;
    background: #f8fbff;
}

.agreement-box {
    min-height: 320px;
    max-height: 380px;
    overflow: auto;
    border: 1px solid #d8e5f2;
    border-radius: 16px;
    padding: 1.25rem;
    background: #fafcff;
}

.support-list .list-group-item {
    border-radius: 14px !important;
    margin-bottom: 0.6rem;
    border-color: #dbe5ef;
}

.empty-state {
    padding: 2rem;
    border: 1px dashed #ccdae7;
    border-radius: 18px;
    background: #fbfdff;
    text-align: center;
}

@media (max-width: 991.98px) {
    .portal-sidebar {
        position: static;
        width: 100%;
        height: auto;
    }

    .portal-main {
        width: 100%;
        margin-left: 0;
    }

    .portal-shell {
        display: block;
    }

    .portal-topbar {
        position: static;
    }
}
