:root {
    --blue-950: #071527;
    --blue-900: #0b1f35;
    --blue-800: #102b49;
    --blue-700: #174064;
    --gray-50: #f6f8fb;
    --gray-100: #eef2f6;
    --gray-200: #d9e1ea;
    --gray-500: #667085;
    --gray-700: #344054;
    --white: #ffffff;
    --green: #15803d;
    --green-soft: #e8f6ee;
    --orange: #c77700;
    --orange-soft: #fff3df;
    --red: #c24132;
    --red-soft: #fff0ee;
    --shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #162033;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--gray-50);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

.auth-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 36px;
    background:
        linear-gradient(90deg, rgba(21, 128, 61, 0.06) 0 1px, transparent 1px 72px),
        linear-gradient(0deg, rgba(7, 21, 39, 0.05) 0 1px, transparent 1px 72px),
        linear-gradient(135deg, #f5f7fa 0%, #e5ebf1 48%, #f7f3ec 100%);
}

.auth-shell {
    width: min(1080px, 100%);
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(390px, 440px) 1fr;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: 0 28px 90px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    padding: 48px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), #ffffff),
        linear-gradient(90deg, rgba(21, 128, 61, 0.06), transparent 38%);
}

.brand-lockup,
.sidebar-brand,
.user-menu {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--white);
    font-weight: 800;
    background: linear-gradient(135deg, var(--green), #0f5f31);
    box-shadow: 0 12px 28px rgba(21, 128, 61, 0.22);
}

.brand-mark.small {
    width: 42px;
    height: 42px;
    font-size: 20px;
}

.brand-kicker,
.page-kicker,
.section-label {
    margin: 0 0 4px;
    color: var(--orange);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
}

.brand-lockup h1,
.auth-copy h2,
.topbar h1,
.dashboard-hero h2 {
    margin: 0;
}

.brand-lockup h1 {
    color: var(--blue-950);
    font-size: 24px;
    line-height: 1.1;
}

.auth-copy {
    margin: auto 0 28px;
    padding-top: 56px;
}

.auth-copy h2 {
    color: var(--blue-950);
    font-size: 34px;
    line-height: 1.12;
}

.auth-copy p,
.dashboard-hero p,
.work-panel p {
    color: var(--gray-500);
    line-height: 1.55;
}

.auth-form {
    display: grid;
    gap: 13px;
}

.auth-form label {
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 800;
}

.input-shell {
    height: 52px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 0 15px;
    color: var(--gray-500);
    background: #fbfcfe;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.auth-form input {
    min-width: 0;
    width: 100%;
    height: 100%;
    border: 0;
    padding: 0;
    color: #162033;
    font-size: 15px;
    background: transparent;
}

.auth-form input:focus {
    outline: 0;
}

.input-shell:focus-within {
    border-color: var(--green);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(21, 128, 61, 0.12);
}

.auth-form button,
.btn-primary {
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 8px;
    color: var(--white);
    background: linear-gradient(135deg, var(--green), #106430);
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 14px 26px rgba(21, 128, 61, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.auth-form button:hover,
.btn-primary:hover {
    background: #106430;
    box-shadow: 0 18px 32px rgba(21, 128, 61, 0.24);
    transform: translateY(-1px);
}

.btn-secondary,
.page-action {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: var(--blue-800);
    background: var(--white);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.btn-secondary:hover,
.page-action:hover {
    background: #e8eef5;
}

.auth-aside {
    position: relative;
    display: flex;
    align-items: end;
    padding: 48px;
    color: var(--white);
    background:
        linear-gradient(135deg, rgba(7, 21, 39, 0.92), rgba(16, 43, 73, 0.72)),
        linear-gradient(0deg, rgba(7, 21, 39, 0.78), rgba(7, 21, 39, 0.18) 55%, rgba(7, 21, 39, 0.40)),
        linear-gradient(45deg, rgba(21, 128, 61, 0.42), transparent 42%),
        url("../images/dagril-erp-login-bg.jpg");
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

.auth-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 76px),
        linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 76px);
    opacity: 0.45;
}

.auth-aside::after {
    content: "";
    position: absolute;
    left: 48px;
    top: 52px;
    width: 72px;
    height: 6px;
    border-radius: 999px;
    background: var(--orange);
}

.auth-aside-content {
    position: relative;
    z-index: 1;
}

.auth-aside h2 {
    max-width: 480px;
    margin: 18px 0 12px;
    font-size: 46px;
    line-height: 1.02;
}

.auth-aside p {
    max-width: 520px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.6;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(8px);
}

.auth-highlights {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-width: 480px;
    margin-top: 28px;
}

.auth-highlights span {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.90);
    background: rgba(255, 255, 255, 0.08);
    font-size: 13px;
    font-weight: 800;
}

.auth-highlights i {
    color: #ffd99b;
}

.alert {
    padding: 12px 14px;
    margin-bottom: 18px;
    border-radius: 8px;
    font-size: 14px;
}

.alert-error {
    color: var(--red);
    background: var(--red-soft);
    border: 1px solid #f0b9b1;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 304px 1fr;
    transition: grid-template-columns 0.2s ease;
}

body.sidebar-compact .app-shell {
    grid-template-columns: 92px 1fr;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px 14px;
    color: var(--white);
    background: linear-gradient(180deg, var(--blue-950) 0%, var(--blue-900) 58%, #06101d 100%);
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 20;
}

.sidebar-top {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.sidebar-brand {
    min-height: 54px;
    flex: 1;
    min-width: 0;
}

.sidebar-brand small,
.sidebar-user small {
    display: block;
    margin-top: 2px;
    color: #9fb2c9;
}

.sidebar-compact-toggle {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    color: #c9d5e4;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.sidebar-compact-toggle:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.11);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    margin-bottom: 14px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
}

.sidebar-user-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    border-radius: 8px;
    color: var(--white);
    background: var(--green);
    font-weight: 800;
}

.sidebar-search {
    height: 42px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 16px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    color: #9fb2c9;
    background: rgba(255, 255, 255, 0.07);
}

.sidebar-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--white);
    background: transparent;
    font: inherit;
}

.sidebar-search input::placeholder {
    color: #9fb2c9;
}

.sidebar-nav {
    display: grid;
    gap: 16px;
    padding-bottom: 16px;
}

.sidebar-section-title {
    margin: 0 0 7px;
    padding: 0 10px;
    color: #7f95b0;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.sidebar-link-stack,
.sidebar-quick-grid {
    display: grid;
    gap: 6px;
}

.sidebar-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.sidebar-nav a {
    min-height: 48px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #c9d5e4;
    font-size: 14px;
    font-weight: 800;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.sidebar-nav a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-nav a.active {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.13);
    background: rgba(255, 255, 255, 0.12);
}

.sidebar-nav a.active::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 999px;
    background: var(--orange);
}

.nav-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #dce6f2;
    background: rgba(255, 255, 255, 0.05);
    font-size: 17px;
}

.sidebar-nav a.active .nav-icon {
    color: var(--white);
    border-color: rgba(199, 119, 0, 0.5);
    background: rgba(199, 119, 0, 0.18);
}

.nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-badge {
    min-width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    padding: 0 7px;
    border-radius: 999px;
    color: var(--white);
    background: var(--red);
    font-size: 12px;
    font-weight: 900;
}

.quick-link {
    min-height: 88px !important;
    display: grid !important;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center !important;
    gap: 10px;
    padding: 12px !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    background: rgba(255, 255, 255, 0.045);
}

.quick-link .nav-icon {
    width: 42px;
    height: 42px;
    font-size: 19px;
}

.quick-link .nav-label {
    display: block;
    min-width: 0;
    line-height: 1.2;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.quick-link .nav-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    margin-left: 0;
}

body.sidebar-compact .sidebar {
    padding-left: 12px;
    padding-right: 12px;
}

body.sidebar-compact .sidebar-text,
body.sidebar-compact .sidebar-section-title,
body.sidebar-compact .sidebar-search,
body.sidebar-compact .nav-label,
body.sidebar-compact .nav-badge {
    display: none;
}

body.sidebar-compact .sidebar-top,
body.sidebar-compact .sidebar-brand,
body.sidebar-compact .sidebar-user,
body.sidebar-compact .sidebar-nav a {
    justify-content: center;
}

body.sidebar-compact .sidebar-quick-grid {
    grid-template-columns: 1fr;
}

body.sidebar-compact .quick-link {
    min-height: 54px !important;
    display: flex !important;
    align-items: center !important;
}

.sidebar-backdrop {
    display: none;
}

.main-area {
    min-width: 0;
}

.topbar {
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 30px;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar h1 {
    font-size: 24px;
}

.sidebar-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: var(--blue-900);
    background: var(--white);
    font-size: 24px;
    cursor: pointer;
}

.page-title {
    display: grid;
    grid-template-columns: 46px 1fr;
    column-gap: 14px;
    align-items: center;
}

.page-title-icon {
    width: 46px;
    height: 46px;
    grid-row: span 2;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--blue-800);
    background: #e8eef5;
    font-size: 22px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--white);
    font-weight: 800;
    background: var(--blue-800);
}

.user-menu small {
    display: block;
    margin-top: 2px;
    color: var(--gray-500);
}

.logout-form {
    margin: 0;
}

.logout-form button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: var(--gray-700);
    background: var(--white);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.logout-form button:hover {
    color: var(--red);
    border-color: #efc2bd;
    background: var(--red-soft);
}

.content-area {
    padding: 30px;
}

.dashboard-hero,
.work-panel {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 26px;
    box-shadow: var(--shadow);
}

.dashboard-hero {
    display: flex;
    align-items: center;
    gap: 18px;
}

.dashboard-hero > div {
    flex: 1;
}

.hero-icon,
.panel-icon,
.metric-icon {
    display: grid;
    place-items: center;
    border-radius: 8px;
}

.hero-icon {
    width: 58px;
    height: 58px;
    color: var(--blue-800);
    background: #e8eef5;
    font-size: 26px;
}

.dashboard-hero h2 {
    font-size: 30px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0;
}

.direction-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.decision-strip,
.executive-summary,
.report-insights {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.decision-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.decision-item,
.executive-summary > article {
    min-height: 128px;
    padding: 18px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.decision-item {
    border-left: 4px solid var(--blue-700);
}

.decision-item.tone-green,
.executive-main.tone-success {
    border-left-color: var(--green);
}

.decision-item.tone-orange,
.executive-main.tone-warning {
    border-left-color: var(--orange);
}

.decision-item.tone-red,
.executive-main.tone-danger {
    border-left-color: var(--red);
}

.decision-item span,
.executive-summary span {
    display: block;
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.decision-item strong,
.executive-summary strong {
    display: block;
    margin-top: 10px;
    color: #162033;
    font-size: 25px;
}

.decision-item small,
.executive-summary small,
.executive-summary p {
    display: block;
    margin-top: 8px;
    color: var(--gray-500);
    line-height: 1.45;
}

.executive-summary {
    grid-template-columns: 2fr repeat(4, minmax(0, 1fr));
}

.executive-main {
    border-left: 4px solid var(--green);
}

.executive-main h3 {
    margin: 10px 0 0;
    font-size: 20px;
    line-height: 1.3;
}

.report-insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-card {
    min-height: 132px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.metric-card-button {
    width: 100%;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.metric-card-button:hover {
    border-color: #b9c7d6;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.1);
    transform: translateY(-2px);
}

.detail-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--blue-700);
    font-size: 12px;
    font-weight: 800;
}

.metric-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.metric-card-top > span:first-child {
    color: var(--gray-500);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.35;
}

.metric-icon {
    width: 42px;
    height: 42px;
    font-size: 20px;
}

.metric-icon.tone-blue {
    color: var(--blue-800);
    background: #e8eef5;
}

.metric-icon.tone-green {
    color: var(--green);
    background: var(--green-soft);
}

.metric-icon.tone-orange {
    color: var(--orange);
    background: var(--orange-soft);
}

.metric-icon.tone-red {
    color: var(--red);
    background: var(--red-soft);
}

.metric-card strong {
    font-size: 28px;
}

.kpi-trend,
.kpi-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 800;
}

.kpi-trend.tone-green {
    color: var(--green);
}

.kpi-trend.tone-red {
    color: var(--red);
}

.kpi-trend.tone-blue {
    color: var(--blue-700);
}

.field-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 26px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.field-hero-icon {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    flex: 0 0 68px;
    border-radius: 8px;
    color: var(--white);
    background: var(--green);
    font-size: 32px;
}

.field-hero h2 {
    margin: 0;
    font-size: 30px;
}

.field-hero p:last-child {
    margin: 8px 0 0;
    color: var(--gray-500);
    font-size: 17px;
}

.field-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.field-action-card {
    min-height: 250px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 28px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    background: var(--white);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.field-action-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.12);
}

.field-action-icon {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    font-size: 32px;
}

.field-action-card strong {
    max-width: 92%;
    color: #162033;
    font-size: 27px;
    line-height: 1.12;
}

.field-action-card > span:not(.field-action-icon) {
    max-width: 92%;
    color: var(--gray-500);
    font-size: 16px;
    line-height: 1.45;
}

.field-action-card em {
    position: absolute;
    right: 24px;
    bottom: 24px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    font-style: normal;
    color: var(--white);
    background: var(--blue-800);
}

.field-action-card.tone-green {
    border-color: #b8e2c8;
}

.field-action-card.tone-green .field-action-icon {
    color: var(--green);
    background: var(--green-soft);
}

.field-action-card.tone-blue {
    border-color: #bfcede;
}

.field-action-card.tone-blue .field-action-icon {
    color: var(--blue-800);
    background: #e8eef5;
}

.field-action-card.tone-orange {
    border-color: #f2d7a7;
}

.field-action-card.tone-orange .field-action-icon {
    color: var(--orange);
    background: var(--orange-soft);
}

.field-action-card.tone-red {
    border-color: #efc2bd;
}

.field-action-card.tone-red .field-action-icon {
    color: var(--red);
    background: var(--red-soft);
}

.work-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.chart-panel,
.alerts-panel {
    min-width: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 22px;
    box-shadow: var(--shadow);
}

.chart-panel[data-chart-open] {
    cursor: pointer;
}

.chart-panel[data-chart-open]:hover {
    border-color: #b9c7d6;
}

.chart-panel-wide {
    grid-column: 1 / -1;
}

.panel-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.panel-heading > div {
    flex: 1;
    min-width: 0;
}

.panel-heading h3 {
    margin: 0;
    font-size: 18px;
}

.panel-heading p {
    margin: 4px 0 0;
    color: var(--gray-500);
    line-height: 1.45;
}

.panel-action {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: var(--blue-800);
    background: var(--white);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.panel-action:hover {
    background: #e8eef5;
}

.panel-icon {
    width: 42px;
    height: 42px;
    margin-bottom: 14px;
    color: var(--green);
    background: var(--green-soft);
    font-size: 20px;
}

.panel-heading .panel-icon {
    margin-bottom: 0;
    flex: 0 0 42px;
}

.chart-box {
    position: relative;
    height: 320px;
}

.chart-panel:not(.chart-panel-wide) .chart-box {
    height: 280px;
}

.alerts-panel {
    margin-top: 18px;
}

.table-panel,
.form-panel {
    margin-top: 18px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 22px;
    box-shadow: var(--shadow);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.enterprise-table {
    width: 100%;
    border-collapse: collapse;
}

.enterprise-table thead th {
    color: var(--white);
    background: var(--blue-900);
    font-size: 13px;
    white-space: nowrap;
}

.enterprise-table th,
.enterprise-table td {
    padding: 13px 14px;
    border-bottom: 1px solid var(--gray-200);
    text-align: left;
    vertical-align: middle;
}

.enterprise-table tbody tr:hover {
    background: #f8fafc;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 8px 10px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    border: 0;
    border-radius: 8px;
    color: var(--white) !important;
    background: var(--blue-800) !important;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-actions form {
    margin: 0;
}

.icon-button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: var(--blue-800);
    background: var(--white);
    cursor: pointer;
}

.icon-button:hover {
    background: #e8eef5;
}

.icon-button.danger {
    color: var(--red);
}

.icon-button.danger:hover {
    background: var(--red-soft);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.status-active,
.status-validated {
    color: var(--green);
    background: var(--green-soft);
}

.status-pending {
    color: var(--orange);
    background: var(--orange-soft);
}

.status-inactive,
.status-cancelled {
    color: var(--red);
    background: var(--red-soft);
}

.app-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 8px;
    font-weight: 800;
}

.app-alert-success {
    color: var(--green);
    background: var(--green-soft);
    border: 1px solid #b8e2c8;
}

.app-alert-error {
    color: var(--red);
    background: var(--red-soft);
    border: 1px solid #efc2bd;
}

.enterprise-form {
    display: grid;
    gap: 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.enterprise-form label {
    display: grid;
    gap: 8px;
}

.enterprise-form label > span {
    color: var(--gray-700);
    font-size: 14px;
    font-weight: 800;
}

.enterprise-form input,
.enterprise-form select,
.enterprise-form textarea {
    width: 100%;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 12px 14px;
    color: #162033;
    background: var(--white);
}

.enterprise-form input,
.enterprise-form select {
    height: 48px;
}

.enterprise-form textarea {
    resize: vertical;
}

.enterprise-form input:focus,
.enterprise-form select:focus,
.enterprise-form textarea:focus {
    outline: 0;
    border-color: var(--blue-700);
    box-shadow: 0 0 0 4px rgba(23, 64, 100, 0.12);
}

.enterprise-form small {
    color: var(--red);
    font-weight: 700;
}

.enterprise-form.was-validated :invalid {
    border-color: var(--red);
}

.form-wide {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid var(--gray-200);
}

.inline-action-form {
    margin-left: auto;
}

.alert-list-page {
    display: grid;
    gap: 12px;
}

.alert-row-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.alert-row small {
    display: block;
    margin-top: 6px;
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 700;
}

.alert-row-read {
    opacity: 0.72;
}

.alert-row form {
    margin-left: auto;
}

.activity-log-table {
    min-width: 1180px;
}

.activity-value {
    max-width: 280px;
    max-height: 140px;
    margin: 0;
    padding: 8px;
    overflow: auto;
    border-radius: 8px;
    color: var(--gray-700);
    background: var(--gray-50);
    font-size: 12px;
    white-space: pre-wrap;
}

.hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ticket-card {
    margin-top: 18px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.ticket-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--blue-900);
}

.ticket-header p,
.ticket-header h2 {
    margin: 0;
}

.ticket-header p {
    color: var(--orange);
    font-weight: 800;
    text-transform: uppercase;
}

.ticket-header strong {
    color: var(--blue-900);
    font-size: 22px;
}

.ticket-grid,
.ticket-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.ticket-grid div,
.ticket-footer div,
.ticket-weights div {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 14px;
    background: #f9fbfd;
}

.ticket-card span {
    display: block;
    margin-bottom: 6px;
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.ticket-card strong {
    color: #162033;
}

.ticket-weights {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 20px;
}

.ticket-weights div {
    background: #e8eef5;
}

.ticket-weights strong {
    font-size: 24px;
    color: var(--blue-900);
}

.silo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.silo-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.silo-card-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.silo-card h3 {
    margin: 0 0 4px;
}

.silo-card-head span:not(.metric-icon) {
    color: var(--gray-500);
}

.silo-level {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
}

.silo-level-bar {
    height: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--gray-100);
}

.silo-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.silo-fill.tone-green {
    background: var(--green);
}

.silo-fill.tone-orange {
    background: var(--orange);
}

.silo-fill.tone-red {
    background: var(--red);
}

.silo-card-stats {
    display: grid;
    gap: 10px;
}

.silo-card-stats div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--gray-200);
}

.silo-card-stats span {
    color: var(--gray-500);
    font-weight: 700;
}

.silo-link {
    width: 100%;
    margin-top: 16px;
}

.alert-panel-icon {
    color: var(--orange);
    background: var(--orange-soft);
}

.alert-list {
    display: grid;
    gap: 10px;
}

.alert-row {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 14px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: inherit;
    background: #f9fbfd;
    text-align: left;
}

.alert-row-button {
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.alert-row-button:hover {
    border-color: #b9c7d6;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.alert-row > i {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--blue-800);
    background: #e8eef5;
    font-size: 18px;
}

.alert-row strong,
.alert-row span {
    display: block;
}

.alert-row strong {
    margin-bottom: 3px;
}

.alert-row span {
    color: var(--gray-500);
    line-height: 1.45;
}

.alert-row.severity-danger > i {
    color: var(--red);
    background: var(--red-soft);
}

.alert-row.severity-warning > i {
    color: var(--orange);
    background: var(--orange-soft);
}

.alert-row-empty > i {
    color: var(--green);
    background: var(--green-soft);
}

.alert-row-action {
    color: var(--gray-500);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(7, 21, 39, 0.58);
    backdrop-filter: blur(3px);
    z-index: 60;
}

.notification-modal {
    position: fixed;
    left: 50%;
    top: 50%;
    width: min(680px, calc(100vw - 32px));
    max-height: calc(100vh - 40px);
    display: none;
    transform: translate(-50%, -50%);
    overflow: auto;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: 0 30px 90px rgba(7, 21, 39, 0.28);
    z-index: 70;
}

body.modal-open .modal-backdrop,
body.modal-open .notification-modal {
    display: block;
}

.modal-header {
    display: grid;
    grid-template-columns: 52px 1fr 42px;
    gap: 14px;
    align-items: center;
    padding: 22px;
    border-bottom: 1px solid var(--gray-200);
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.modal-header h3 {
    margin: 0;
    font-size: 22px;
}

.modal-icon,
.modal-close {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
}

.modal-icon {
    color: var(--blue-800);
    background: #e8eef5;
    font-size: 20px;
}

.modal-icon.severity-danger {
    color: var(--red);
    background: var(--red-soft);
}

.modal-icon.severity-warning {
    color: var(--orange);
    background: var(--orange-soft);
}

.modal-icon.severity-success {
    color: var(--green);
    background: var(--green-soft);
}

.modal-close {
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    background: var(--white);
    cursor: pointer;
}

.modal-close:hover {
    color: var(--red);
    background: var(--red-soft);
}

.modal-content {
    display: grid;
    gap: 12px;
    padding: 22px;
}

.modal-field {
    padding: 14px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    background: #f9fbfd;
}

.modal-field span,
.modal-field strong {
    display: block;
}

.modal-field span {
    margin-bottom: 5px;
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.modal-field strong {
    color: #162033;
    line-height: 1.55;
}

.modal-table-wrap {
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
}

.modal-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.modal-table-wrap th,
.modal-table-wrap td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--gray-200);
    text-align: left;
}

.modal-table-wrap th {
    position: sticky;
    top: 0;
    color: var(--white);
    background: var(--blue-900);
    font-size: 13px;
    white-space: nowrap;
}

.modal-table-wrap tr:last-child td {
    border-bottom: 0;
}

.modal-table-wrap td:first-child {
    color: var(--gray-700);
    font-weight: 800;
    background: #f6f8fb;
}

.modal-table-wrap td {
    color: var(--gray-700);
    vertical-align: top;
}

.modal-table-wrap td:last-child {
    font-weight: 800;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 22px 22px;
}

.btn-export {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    color: var(--white);
    font-weight: 800;
    cursor: pointer;
}

.btn-export-pdf {
    background: var(--red);
}

.btn-export-excel {
    background: var(--green);
}

.btn-export:hover {
    filter: brightness(0.94);
}

.timeline {
    display: grid;
    gap: 10px;
}

.timeline span {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    color: var(--gray-700);
    background: #f9fbfd;
    font-weight: 700;
}

.timeline i {
    color: var(--green);
}

@media (max-width: 1180px) {
    .metric-grid,
    .direction-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .decision-strip,
    .executive-summary,
    .report-insights {
        grid-template-columns: 1fr;
    }

    .field-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-charts {
        grid-template-columns: 1fr;
    }

    .silo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .auth-body {
        padding: 0;
    }

    .auth-shell,
    .work-panel {
        grid-template-columns: 1fr;
    }

    .auth-shell {
        min-height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-panel {
        padding: 34px 24px 40px;
    }

    .auth-aside {
        min-height: 300px;
        padding: 36px 24px;
        order: -1;
    }

    .auth-copy {
        margin: 34px 0 24px;
        padding-top: 0;
    }

    .auth-aside h2 {
        font-size: 38px;
    }

    .auth-highlights {
        grid-template-columns: 1fr;
        margin-top: 22px;
    }

    .app-shell {
        display: block;
    }

    body.sidebar-compact .app-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: min(288px, 86vw);
        transform: translateX(-100%);
        transition: transform 0.22s ease;
    }

    body.sidebar-compact .sidebar {
        width: min(288px, 86vw);
    }

    body.sidebar-compact .sidebar-top,
    body.sidebar-compact .sidebar-brand,
    body.sidebar-compact .sidebar-user,
    body.sidebar-compact .sidebar-nav a {
        justify-content: flex-start;
    }

    body.sidebar-compact .sidebar-text,
    body.sidebar-compact .nav-label {
        display: inline;
    }

    body.sidebar-compact .sidebar-section-title {
        display: block;
    }

    body.sidebar-compact .sidebar-search {
        display: flex;
    }

    body.sidebar-compact .nav-badge {
        display: inline-flex;
    }

    body.sidebar-compact .sidebar-quick-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.sidebar-compact .quick-link {
        min-height: 88px !important;
        display: grid !important;
        align-items: center !important;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(7, 21, 39, 0.48);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.22s ease;
        z-index: 15;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .topbar {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 16px 18px;
    }

    .sidebar-toggle {
        display: grid;
        place-items: center;
    }

    .page-title {
        grid-template-columns: 40px 1fr;
        flex: 1;
    }

    .page-title-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .user-menu {
        width: 100%;
        align-items: flex-start;
        justify-content: space-between;
        flex-wrap: wrap;
        padding-top: 10px;
        border-top: 1px solid var(--gray-200);
    }

    .content-area {
        padding: 18px;
    }

    .dashboard-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .field-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .metric-grid,
    .direction-metrics,
    .field-action-grid {
        grid-template-columns: 1fr;
    }

    .decision-strip,
    .executive-summary,
    .report-insights {
        grid-template-columns: 1fr;
    }

    .field-action-card {
        min-height: 210px;
    }

    .field-action-card strong {
        font-size: 24px;
    }

    .chart-box,
    .chart-panel:not(.chart-panel-wide) .chart-box {
        height: 260px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .btn-primary,
    .form-actions .btn-secondary,
    .page-action {
        width: 100%;
    }

    .hero-actions,
    .ticket-grid,
    .ticket-weights,
    .ticket-footer,
    .silo-grid {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .modal-header {
        grid-template-columns: 42px 1fr 40px;
        padding: 18px;
    }

    .modal-content {
        padding: 18px;
    }

    .modal-actions {
        flex-direction: column;
        padding: 0 18px 18px;
    }

    .btn-export {
        width: 100%;
    }
}

@media print {
    body {
        background: #fff;
    }

    .sidebar,
    .topbar,
    .print-hidden,
    .sidebar-backdrop {
        display: none !important;
    }

    .app-shell,
    .main-area {
        display: block;
    }

    .content-area {
        padding: 0;
    }

    .dashboard-hero,
    .table-panel,
    .metric-card {
        break-inside: avoid;
        box-shadow: none !important;
    }

    .dashboard-hero {
        margin-bottom: 14px;
        border: 0;
    }

    .metric-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
        margin-bottom: 14px;
    }

    .metric-card,
    .table-panel {
        border: 1px solid #d9e1ea;
    }

    .enterprise-table {
        font-size: 11px;
    }

    .enterprise-table th,
    .enterprise-table td {
        padding: 7px 8px;
    }

    .ticket-card {
        margin: 0;
        border: 0;
        box-shadow: none;
    }
}
