@import url("https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css");

:root {
    --bg: #eef3f8;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --text: #1f2937;
    --muted: #5f6b7a;
    --primary: #0f4c81;
    --primary-strong: #0b3b65;
    --border: #d9e1ea;
    --success: #1d7a44;
    --warning: #b7791f;
    --danger: #b42318;
    --shadow: 0 10px 30px rgba(15, 45, 75, 0.08);
    --bs-primary: #0f4c81;
    --bs-primary-rgb: 15, 76, 129;
    --bs-success: #1d7a44;
    --bs-danger: #b42318;
    --bs-border-color: #d9e1ea;
    --bs-body-color: #1f2937;
    --bs-body-bg: #eef3f8;
    --bs-font-sans-serif: "Segoe UI", Tahoma, Arial, sans-serif;
}

body {
    min-height: 100vh;
    color: var(--text);
    background: linear-gradient(180deg, #f8fbfe 0%, var(--bg) 100%);
}

a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-strong);
}

.page-wrap {
    width: min(1120px, calc(100% - 32px));
    margin: 28px auto;
}

.card,
.hero-card,
.surface-card {
    border-color: var(--border);
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.title-xl {
    margin: 0;
    font-size: clamp(1.55rem, 2.2vw, 2.25rem);
    font-weight: 700;
    color: #133a63;
}

.title-lg {
    margin: 0 0 0.75rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: #163d66;
}

.subtitle,
.muted {
    color: var(--muted);
}

.form-grid {
    display: grid;
    gap: 14px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.hero-card {
    width: min(920px, 100%);
    padding: 26px;
    text-align: center;
    background: var(--surface);
}

.video-container {
    position: relative;
    width: min(820px, 100%);
    margin: 22px auto;
    border-radius: 14px;
    overflow: hidden;
    padding-bottom: 56.25%;
    height: 0;
    border: 1px solid #d2dae4;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.video-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.app-topbar {
    background: #0f355a;
    color: #fff;
    border-bottom: 1px solid #092841;
}

.app-topbar .navbar-brand,
.app-topbar .nav-link {
    color: #dbe9f7;
}

.app-topbar .nav-link:hover,
.app-topbar .nav-link:focus,
.app-topbar .navbar-brand:hover,
.app-topbar .navbar-brand:focus {
    color: #ffffff;
}

.app-topbar .nav-link.active,
.app-topbar .nav-link.logout {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 0.625rem;
}

.app-topbar .nav-link.active {
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.app-topbar .nav-link.logout {
    background: rgba(239, 68, 68, 0.18);
    color: #fee2e2;
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.stat-list {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-item {
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 0.875rem;
    padding: 12px;
}

.badge-soft-success {
    color: #1f7a45;
    background: #e8f7ee;
}

.badge-soft-warning {
    color: #9c6b10;
    background: #fff7e7;
}

.badge-soft-danger {
    color: #b42318;
    background: #feeceb;
}

.badge-soft-muted {
    color: #5f6b7a;
    background: #eff3f8;
}

.alert {
    border-radius: 0.875rem;
}

.alert-error {
    border-color: #efc4c1;
    background: #fff2f1;
    color: #a42a22;
}

.alert-success {
    border-color: #b7dfc7;
    background: #edfaf2;
    color: #216d41;
}

.btn-brand {
    --bs-btn-bg: #0f4c81;
    --bs-btn-border-color: #0f4c81;
    --bs-btn-hover-bg: #0b3b65;
    --bs-btn-hover-border-color: #0b3b65;
    --bs-btn-active-bg: #0a3154;
    --bs-btn-active-border-color: #0a3154;
    --bs-btn-color: #fff;
}

.btn-outline-brand {
    --bs-btn-color: #0f4c81;
    --bs-btn-border-color: #0f4c81;
    --bs-btn-hover-bg: #0f4c81;
    --bs-btn-hover-border-color: #0f4c81;
    --bs-btn-hover-color: #fff;
}

.btn-danger-soft {
    --bs-btn-bg: #b42318;
    --bs-btn-border-color: #b42318;
    --bs-btn-hover-bg: #971d14;
    --bs-btn-hover-border-color: #971d14;
    --bs-btn-color: #fff;
}

.btn-secondary-soft {
    --bs-btn-bg: #334155;
    --bs-btn-border-color: #334155;
    --bs-btn-hover-bg: #1f2937;
    --bs-btn-hover-border-color: #1f2937;
    --bs-btn-color: #fff;
}

.text-center {
    text-align: center;
}

.erp-shell {
    width: min(1280px, calc(100% - 28px));
    margin: 28px auto;
}

.erp-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 1.35rem;
    padding: 1.6rem;
    background:
        radial-gradient(circle at top right, rgba(74, 222, 128, 0.18), transparent 28%),
        radial-gradient(circle at left bottom, rgba(14, 165, 233, 0.16), transparent 24%),
        linear-gradient(135deg, #0d385d 0%, #13507f 52%, #0a7a74 100%);
    color: #fff;
    box-shadow: 0 24px 44px rgba(10, 42, 68, 0.18);
}

.erp-hero h1,
.erp-hero p,
.erp-hero small,
.erp-hero span {
    color: inherit;
}

.erp-hero::after {
    content: "";
    position: absolute;
    inset: auto -40px -40px auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    filter: blur(4px);
}

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

.erp-kpi {
    position: relative;
    overflow: hidden;
    min-height: 150px;
    padding: 1.2rem;
}

.erp-kpi::before {
    content: "";
    position: absolute;
    inset: auto -26px -26px auto;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
}

.erp-kpi-primary {
    color: #fff;
    background: linear-gradient(135deg, #1667a8 0%, #0f4c81 100%);
}

.erp-kpi-success {
    color: #fff;
    background: linear-gradient(135deg, #1f9d62 0%, #167a49 100%);
}

.erp-kpi-danger {
    color: #fff;
    background: linear-gradient(135deg, #d25555 0%, #b42318 100%);
}

.erp-kpi-info {
    color: #fff;
    background: linear-gradient(135deg, #0f9db1 0%, #0c7181 100%);
}

.erp-kpi-label {
    display: block;
    margin-bottom: 0.55rem;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.84;
}

.erp-kpi-value {
    font-size: clamp(1.5rem, 2.4vw, 2.2rem);
    font-weight: 800;
    line-height: 1.05;
}

.erp-kpi-meta {
    margin-top: 0.55rem;
    font-size: 0.92rem;
    opacity: 0.92;
}

.erp-panel {
    padding: 1.2rem;
}

.erp-panel-title {
    margin: 0;
    color: #163d66;
    font-size: 1.05rem;
    font-weight: 700;
}

.erp-panel-subtitle {
    margin: 0.25rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.erp-mini-stat {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid #e7eef6;
}

.erp-mini-stat:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.erp-mini-stat:first-child {
    padding-top: 0;
}

.erp-mini-stat-label {
    color: var(--muted);
    font-size: 0.92rem;
}

.erp-mini-stat-value {
    color: #163d66;
    font-weight: 700;
    text-align: right;
}

.erp-shortcut {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.1rem;
    border: 1px solid #d8e2ee;
    border-radius: 0.95rem;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(180deg, #ffffff 0%, #f9fbfd 100%);
    transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.erp-shortcut:hover {
    transform: translateY(-2px);
    color: inherit;
    border-color: #b8cbdf;
    box-shadow: 0 16px 24px rgba(15, 45, 75, 0.08);
}

.erp-shortcut-title {
    font-weight: 700;
    color: #163d66;
}

.erp-shortcut-meta {
    font-size: 0.84rem;
    color: var(--muted);
}

.erp-table thead th {
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5f6b7a;
    background: #f5f8fc;
}

.erp-table tbody td {
    vertical-align: middle;
}

.erp-dot {
    display: inline-block;
    width: 0.55rem;
    height: 0.55rem;
    margin-right: 0.45rem;
    border-radius: 50%;
}

.erp-dot-success { background: #1d7a44; }
.erp-dot-warning { background: #d08a10; }
.erp-dot-danger { background: #b42318; }
.erp-dot-info { background: #0f7f8d; }

.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }

@media (max-width: 760px) {
    .hero-card {
        padding: 1rem;
    }

    .page-wrap {
        width: min(100%, calc(100% - 24px));
    }

    .erp-shell {
        width: min(100%, calc(100% - 18px));
        margin: 18px auto;
    }
}