:root {
    --industrial-blue: #2c3e50;
    --industrial-blue-deep: #1f2d3a;
    --industrial-steel: #5d6d7e;
    --industrial-yellow: #f39c12;
    --industrial-orange: #e67e22;
    --surface: #ffffff;
    --surface-alt: #eef1f4;
    --surface-dark: #1f2d3a;
    --border: #d7dde3;
    --text-main: #1f2933;
    --text-muted: #66717d;
    --shadow-hard: 0 10px 24px rgba(31, 45, 58, 0.12);
    --radius-sm: 8px;
    --radius-md: 10px;
}

body {
    margin: 0;
    background:
        linear-gradient(135deg, rgba(243, 156, 18, 0.08), transparent 28%),
        linear-gradient(180deg, #f3f5f7 0%, #e9edf1 100%);
    color: var(--text-main);
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

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

.sidebar {
    width: 298px;
    border-right: 4px solid var(--industrial-yellow);
    background: linear-gradient(180deg, var(--industrial-blue-deep) 0%, #17212b 100%);
    color: #fff;
}

.sidebar-mobile-header {
    background: var(--industrial-blue-deep);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 1.4rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--industrial-yellow), var(--industrial-orange));
    color: var(--surface-dark);
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    box-shadow: var(--shadow-hard);
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.sidebar-subtitle {
    color: rgba(255, 255, 255, 0.72);
}

.sidebar-section-label {
    padding: 1rem 1.25rem 0.55rem;
    color: rgba(255, 255, 255, 0.56);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    font-weight: 700;
}

.sidebar-nav {
    gap: 0.35rem;
    padding: 0 0.9rem 1rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 50px;
    padding: 0.85rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.88);
    font-weight: 600;
    transition: all 0.2s ease;
}

.sidebar-nav .nav-link i {
    font-size: 1.05rem;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
    background: rgba(243, 156, 18, 0.14);
    border-color: rgba(243, 156, 18, 0.35);
    color: #fff;
    transform: translateX(2px);
}

.sidebar-footer {
    padding: 1rem;
}

.sidebar-footer-card {
    border: 1px solid rgba(243, 156, 18, 0.32);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    padding: 1rem;
    color: rgba(255, 255, 255, 0.82);
}

.app-content {
    flex: 1;
    min-width: 0;
    background: transparent;
}

.topbar {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 3px solid rgba(243, 156, 18, 0.9);
    box-shadow: 0 6px 18px rgba(31, 45, 58, 0.08);
}

.topbar-inner {
    min-height: 78px;
    padding: 0.9rem 1rem;
}

.topbar-toggle {
    width: 48px;
    height: 48px;
    border: 2px solid var(--industrial-blue);
    border-radius: var(--radius-sm);
    color: var(--industrial-blue);
    font-size: 1.25rem;
    background: #fff;
}

.topbar-kicker {
    color: var(--industrial-orange);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.topbar-title {
    margin: 0;
    color: var(--industrial-blue-deep);
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    font-weight: 800;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fff;
}

.user-chip__icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    background: var(--industrial-blue);
    color: #fff;
}

.user-chip strong,
.user-chip small {
    display: block;
}

.user-chip small {
    color: var(--text-muted);
}

.topbar-logout {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-inline: 1rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
}

.page-body {
    padding: 1rem;
}

.rugged-alert {
    border-width: 0 0 0 6px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hard);
}

.dashboard-hero,
.content-card,
.summary-card,
.metric-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-hard);
    background: var(--surface);
}

.dashboard-hero {
    overflow: hidden;
    background: linear-gradient(130deg, var(--industrial-blue-deep) 0%, var(--industrial-blue) 62%, #425668 100%);
    color: #fff;
    border-color: rgba(31, 45, 58, 0.6);
}

.dashboard-hero__stripe {
    background: repeating-linear-gradient(135deg, rgba(243, 156, 18, 0.18), rgba(243, 156, 18, 0.18) 12px, transparent 12px, transparent 24px);
}

.summary-card,
.metric-card {
    overflow: hidden;
}

.metric-card {
    position: relative;
    min-height: 150px;
    color: #fff;
}

.metric-card::after {
    content: "";
    position: absolute;
    inset: auto -30px -30px auto;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.metric-card--blue { background: linear-gradient(135deg, #2c3e50, #34495e); }
.metric-card--green { background: linear-gradient(135deg, #1e8449, #239b56); }
.metric-card--red { background: linear-gradient(135deg, #922b21, #c0392b); }
.metric-card--yellow { background: linear-gradient(135deg, #d68910, #f39c12); color: #1f2d3a; }
.metric-card--charcoal { background: linear-gradient(135deg, #273746, #17202a); }

.metric-card__body {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.15rem;
}

.metric-card__icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.14);
    display: grid;
    place-items: center;
    font-size: 1.35rem;
}

.metric-card--yellow .metric-card__icon {
    background: rgba(31, 45, 58, 0.12);
}

.metric-card__label {
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.9;
}

.metric-card__value {
    margin: 0.3rem 0 0;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 800;
}

.metric-card__meta {
    margin-top: 0.4rem;
    font-size: 0.88rem;
    opacity: 0.92;
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section-title {
    margin: 0;
    color: var(--industrial-blue-deep);
    font-size: 1.15rem;
    font-weight: 800;
}

.section-copy {
    color: var(--text-muted);
    margin: 0.2rem 0 0;
}

.content-card {
    overflow: hidden;
}

.card-toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.table-shell {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #fff;
}

.table-rugged {
    margin: 0;
    font-size: 0.98rem;
}

.table-rugged thead th {
    background: #f6f7f9;
    color: var(--industrial-blue-deep);
    border-bottom: 2px solid var(--border);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 1rem 0.9rem;
    white-space: nowrap;
}

.table-rugged tbody td {
    padding: 1rem 0.9rem;
    border-color: #e5e9ee;
    vertical-align: middle;
}

.table-rugged tbody tr:hover {
    background: #fff8ea;
}

.entity-title {
    font-weight: 700;
    color: var(--industrial-blue-deep);
}

.entity-subtitle {
    color: var(--text-muted);
    font-size: 0.84rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.48rem 0.8rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 800;
}

.btn,
.form-control,
.form-select,
.modal-content,
.input-group-text {
    border-radius: var(--radius-sm);
}

.btn {
    min-height: 46px;
    font-weight: 700;
}

.btn-icon {
    width: 42px;
    min-width: 42px;
    padding: 0;
    display: inline-grid;
    place-items: center;
}

.btn-industrial {
    background: linear-gradient(135deg, var(--industrial-yellow), var(--industrial-orange));
    border: 0;
    color: #1f2d3a;
    box-shadow: 0 8px 18px rgba(243, 156, 18, 0.28);
}

.btn-industrial:hover {
    color: #1f2d3a;
    filter: brightness(0.98);
}

.btn-outline-industrial {
    border: 2px solid var(--industrial-blue);
    color: var(--industrial-blue);
    background: #fff;
}

.btn-outline-industrial:hover {
    background: var(--industrial-blue);
    color: #fff;
}

.form-label {
    color: var(--industrial-blue-deep);
    font-weight: 700;
    margin-bottom: 0.45rem;
}

.form-control,
.form-select {
    min-height: 48px;
    border: 1px solid #c8d0d8;
    font-size: 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--industrial-yellow);
    box-shadow: 0 0 0 0.22rem rgba(243, 156, 18, 0.18);
}

.quick-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text-muted);
    font-weight: 600;
}

.modal-content {
    border: 1px solid #cfd6dd;
    box-shadow: 0 18px 30px rgba(31, 45, 58, 0.18);
}

.modal-header,
.modal-footer {
    border-color: #e0e5ea;
}

.modal-header {
    background: #f8f9fb;
}

.login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(243, 156, 18, 0.14), transparent 28%),
        linear-gradient(120deg, #17212b 0%, #2c3e50 42%, #111920 100%);
}

.login-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
}

.login-showcase {
    position: relative;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    padding: 2rem;
    background:
        linear-gradient(180deg, rgba(31, 45, 58, 0.18), rgba(10, 16, 22, 0.78)),
        url('https://images.unsplash.com/photo-1513828583688-c52646db42da?auto=format&fit=crop&w=1400&q=80') center/cover no-repeat;
}

.login-showcase__overlay {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(135deg, rgba(243, 156, 18, 0.08), rgba(243, 156, 18, 0.08) 18px, transparent 18px, transparent 36px),
        linear-gradient(180deg, rgba(31, 45, 58, 0.18), rgba(15, 22, 30, 0.72));
}

.login-showcase__content {
    position: relative;
    z-index: 1;
    max-width: 620px;
    color: #fff;
}

.login-showcase__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1.25rem;
    padding: 0.65rem 0.9rem;
    border: 1px solid rgba(243, 156, 18, 0.36);
    border-radius: 999px;
    background: rgba(15, 22, 30, 0.42);
    font-weight: 700;
}

.login-showcase__title {
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.08;
    font-weight: 800;
    margin-bottom: 1rem;
}

.login-showcase__copy {
    max-width: 540px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.02rem;
    margin-bottom: 1.5rem;
}

.login-showcase__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.login-showcase__stat {
    padding: 1rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(6px);
}

.login-showcase__stat strong,
.login-showcase__stat span {
    display: block;
}

.login-showcase__stat span {
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.92rem;
    margin-top: 0.3rem;
}

.login-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.login-card {
    width: min(500px, 100%);
    border-radius: 14px;
    border: 1px solid rgba(215, 221, 227, 0.9);
    box-shadow: 0 22px 42px rgba(8, 15, 22, 0.25);
    background: rgba(255, 255, 255, 0.98);
}

.login-card-animate {
    animation: loginFadeIn 0.45s ease-out;
}

.login-brand-icon {
    width: 58px;
    height: 58px;
}

.login-alert {
    margin-bottom: 1.2rem;
}

.login-input-group {
    border-radius: var(--radius-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.login-input-group:focus-within {
    transform: translateY(-1px);
}

.login-input-group .input-group-text {
    min-width: 48px;
    justify-content: center;
    border: 1px solid #c8d0d8;
    border-right: 0;
    background: #f8fafb;
    color: var(--industrial-blue);
}

.login-input-group .form-control {
    border-left: 0;
    border-right: 0;
}

.login-password-toggle {
    border: 1px solid #c8d0d8;
    border-left: 0;
    color: var(--industrial-blue);
    background: #f8fafb;
}

.login-password-toggle:hover {
    background: #eef2f6;
    color: var(--industrial-blue-deep);
}

.login-check .form-check-input {
    border-color: #aab4bf;
}

.login-check .form-check-input:checked {
    background-color: var(--industrial-yellow);
    border-color: var(--industrial-yellow);
}

.login-help-text {
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.login-submit {
    min-height: 52px;
    font-size: 1rem;
}

.login-footer-note {
    padding-top: 1rem;
    border-top: 1px solid #e7ebef;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.login-footer-note span {
    color: var(--industrial-blue-deep);
    font-weight: 700;
}

.print-area {
    background: #fff;
}

@keyframes loginFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        width: 290px;
    }

    .topbar-inner,
    .topbar-actions {
        gap: 0.75rem;
    }

    .user-chip {
        display: none;
    }

    .login-layout {
        grid-template-columns: 1fr;
    }

    .login-showcase {
        min-height: 280px;
        align-items: flex-end;
    }
}

@media (max-width: 767.98px) {
    .page-body {
        padding: 0.85rem;
    }

    .topbar-inner {
        align-items: flex-start;
    }

    .topbar-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .topbar-logout {
        width: 100%;
        justify-content: center;
    }

    .section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .card-toolbar,
    .mobile-stack {
        display: grid;
        width: 100%;
    }

    .card-toolbar .btn,
    .mobile-stack .btn {
        width: 100%;
    }

    .metric-card__body {
        padding: 1rem;
    }

    .modal-dialog {
        margin: 0.6rem;
    }

    .modal-dialog,
    .modal-content {
        width: auto;
    }

    .login-page {
        display: block;
        padding: 1rem;
    }

    .login-layout {
        min-height: calc(100vh - 2rem);
    }

    .login-showcase {
        display: none;
    }

    .login-panel {
        min-height: calc(100vh - 2rem);
        padding: 0;
    }

    .login-card {
        width: 100%;
    }

    .login-showcase__stats {
        grid-template-columns: 1fr;
    }
}

@media print {
    .sidebar,
    .topbar,
    .no-print,
    .btn,
    form {
        display: none !important;
    }

    .app-content,
    body,
    .container-fluid {
        background: #fff !important;
    }
}
