:root {
    color-scheme: light;
    --dw-ink: #17212b;
    --dw-muted: #667789;
    --dw-line: #dfe6ee;
    --dw-surface: #ffffff;
    --dw-soft: #f4f7fb;
    --dw-nav: #101820;
    --dw-nav-2: #182430;
    --dw-primary: #1f8a70;
    --dw-accent: #0f6b8f;
    --dw-warning: #c77914;
    --dw-danger: #c94f5f;
    --dw-info: #3366cc;
    --dw-radius: 7px;
    --dw-radius-md: 8px;
    --dw-shadow: 0 16px 40px rgba(24, 36, 48, .06);
    --dw-shadow-lg: 0 24px 70px rgba(16, 24, 32, .18);
    --dw-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html [hidden] { display: none !important; }
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--dw-font); color: var(--dw-ink); background: linear-gradient(180deg, #f7fafc 0%, var(--dw-soft) 320px); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.dw-app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.dw-workspace { min-width: 0; }
.dw-content { padding: 26px; display: grid; gap: 22px; }
.dw-shell-bg { min-height: 100vh; background:
    linear-gradient(135deg, rgba(31, 138, 112, .12) 0%, transparent 28%),
    linear-gradient(220deg, rgba(51, 102, 204, .1) 0%, transparent 30%),
    linear-gradient(135deg, #f8fbfc 0%, #eef5f2 50%, #f5f7fb 100%); }

.dw-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dw-brand-mark, .dw-brand-logo { width: 42px; height: 42px; border-radius: var(--dw-radius); flex: 0 0 auto; }
.dw-brand-mark { display: inline-grid; place-items: center; background: #27b493; color: white; font-weight: 900; box-shadow: 0 12px 30px rgba(39, 180, 147, .3); }
.dw-brand-logo { object-fit: contain; background: white; padding: 4px; }
.dw-brand strong { display: block; font-size: 17px; line-height: 1.15; overflow-wrap: anywhere; }
.dw-brand small { display: block; color: var(--dw-muted); font-weight: 700; overflow-wrap: anywhere; }

.dw-sidebar { background: linear-gradient(180deg, var(--dw-nav), var(--dw-nav-2)); color: #f6fbff; padding: 22px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; }
.dw-sidebar .dw-brand small { color: #9eb0c1; max-width: 180px; }
.dw-nav { display: grid; gap: 10px; }
.dw-nav-section { border: 1px solid rgba(255,255,255,.08); border-radius: var(--dw-radius-md); background: rgba(255,255,255,.035); overflow: hidden; }
.dw-nav-section header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; color: #f6fbff; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.dw-nav-section header small { min-width: 24px; height: 24px; border-radius: var(--dw-radius); display: inline-grid; place-items: center; background: rgba(255,255,255,.1); color: #c8d5df; font-size: 11px; }
.dw-nav-links { display: grid; gap: 4px; padding: 0 8px 8px; }
.dw-nav-item, .dw-all-apps-link { display: flex; align-items: center; gap: 10px; border-radius: var(--dw-radius-md); color: #c8d5df; transition: background .15s ease, color .15s ease, transform .15s ease; }
.dw-nav-item { padding: 9px 10px; font-size: 14px; line-height: 1.2; }
.dw-nav-item:hover, .dw-nav-item.is-active { background: rgba(255,255,255,.09); color: white; transform: translateX(2px); }
.dw-all-apps-link { padding: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.08); color: white; font-weight: 900; }
.dw-nav-icon { width: 24px; height: 24px; border-radius: var(--dw-radius); display: inline-grid; place-items: center; background: rgba(255,255,255,.08); font-size: 11px; font-weight: 800; color: #d8e6ef; flex: 0 0 auto; }

.dw-mobile-topbar { display: none; }
.dw-topbar { height: 72px; display: flex; align-items: center; gap: 16px; padding: 14px 24px; background: rgba(255,255,255,.88); border-bottom: 1px solid var(--dw-line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); }
.dw-topbar-brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; white-space: nowrap; }
.dw-topbar-brand .dw-brand-mark { width: 34px; height: 34px; font-size: 13px; box-shadow: none; }
.dw-search { flex: 1; }
.dw-search input { width: 100%; height: 42px; border: 1px solid var(--dw-line); border-radius: var(--dw-radius-md); padding: 0 14px; background: #f8fafc; outline: none; }
.dw-search input:focus, .dw-field input:focus, .dw-field select:focus, .dw-field textarea:focus { border-color: var(--dw-primary); box-shadow: 0 0 0 4px rgba(31, 138, 112, .12); outline: none; }
.dw-topbar-actions { display: flex; gap: 10px; align-items: center; }

.dw-page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 4px; }
.dw-inner-heading { border: 1px solid var(--dw-line); border-radius: var(--dw-radius); background: linear-gradient(180deg, #fff, #fbfdff); padding: 20px; box-shadow: var(--dw-shadow); }
.dw-page-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.dw-page-heading h1 { margin: 0; font-size: 34px; line-height: 1.1; letter-spacing: 0; }
.dw-page-heading p { margin: 8px 0 0; color: var(--dw-muted); max-width: 760px; }
.dw-eyebrow { margin: 0 0 8px !important; color: var(--dw-primary) !important; font-weight: 900; text-transform: uppercase; font-size: 12px; }

.dw-btn { border: 1px solid var(--dw-line); background: white; border-radius: var(--dw-radius); padding: 10px 14px; color: var(--dw-ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; font-weight: 800; line-height: 1.2; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease, filter .15s ease; }
.dw-btn:hover { border-color: var(--dw-primary); box-shadow: 0 8px 22px rgba(24, 36, 48, .08); transform: translateY(-1px); }
.dw-btn-primary { background: var(--dw-primary); color: white; border-color: var(--dw-primary); }
.dw-btn-primary:hover { filter: brightness(.96); box-shadow: 0 10px 26px rgba(31, 138, 112, .22); }
.dw-btn-danger { color: #b4232f; border-color: rgba(180, 35, 47, .18); }
.dw-btn-danger:hover { background: #fff1f2; border-color: rgba(180, 35, 47, .32); color: #9f1d2a; }
.dw-btn-sm { min-height: 34px; padding: 7px 10px; font-size: 13px; }
.dw-btn-lg { min-height: 48px; padding: 12px 18px; }
.dw-btn:disabled { opacity: .55; cursor: not-allowed; filter: grayscale(.18); box-shadow: none !important; transform: none !important; }

.dw-card, .dw-panel, .dw-login-card { background: var(--dw-surface); border: 1px solid var(--dw-line); border-radius: var(--dw-radius); box-shadow: var(--dw-shadow); }
.dw-card, .dw-panel { padding: 20px; }
.dw-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.dw-card-header h2 { margin: 0; font-size: 20px; }
.dw-card-header p { margin: 4px 0 0; color: var(--dw-muted); }

.dw-dashboard-hero { border: 1px solid rgba(23,33,43,.1); border-radius: var(--dw-radius); background: linear-gradient(135deg, rgba(31,138,112,.09), transparent 42%), linear-gradient(180deg, #fff, #f8fbfd); padding: 22px; box-shadow: var(--dw-shadow); }
.dw-metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.dw-metric-card { padding: 18px; display: grid; gap: 10px; min-height: 116px; min-width: 0; background: linear-gradient(180deg, #fff, #fbfdff); border: 1px solid var(--dw-line); border-radius: var(--dw-radius); box-shadow: var(--dw-shadow); }
.dw-metric-card span { color: var(--dw-muted); font-size: 13px; }
.dw-metric-card strong { max-width: 100%; font-size: 26px; line-height: 1.08; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

.dw-app-card { min-height: 196px; border: 1px solid rgba(23, 33, 43, .1); border-radius: var(--dw-radius); background: rgba(255,255,255,.9); padding: 16px; display: grid; gap: 18px; align-content: start; color: var(--dw-ink); box-shadow: 0 18px 42px rgba(24, 36, 48, .07); transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease, background .15s ease; position: relative; overflow: hidden; }
.dw-app-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: rgba(31, 138, 112, .58); }
.dw-app-card:hover { background: white; border-color: rgba(31, 138, 112, .44); box-shadow: 0 24px 54px rgba(24, 36, 48, .12); transform: translateY(-3px); }
.dw-app-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dw-app-mark { width: 58px; height: 58px; border-radius: var(--dw-radius); display: inline-grid; place-items: center; color: white; font-size: 24px; font-weight: 900; box-shadow: 0 14px 30px rgba(24, 36, 48, .18); background: linear-gradient(135deg, var(--dw-primary), #30ba98); }
.dw-app-mark svg { width: 30px; height: 30px; display: block; }
.dw-app-card strong { font-size: 20px; line-height: 1.15; }
.dw-app-card em { font-style: normal; color: var(--dw-muted); font-size: 14px; line-height: 1.42; overflow-wrap: anywhere; }

.dw-badge, .dw-status { border: 1px solid #b7e8cf; background: #ecfdf3; color: #065f46; border-radius: var(--dw-radius); padding: 4px 10px; font-size: 12px; font-weight: 900; text-transform: uppercase; display: inline-flex; align-items: center; width: fit-content; }
.dw-badge-muted { background: #f1f5f9; border-color: #dbe5ee; color: #64748b; }
.dw-badge-warning { background: #fff8eb; border-color: #f5c77d; color: #7a4b05; }
.dw-badge-danger { background: #fff1f2; border-color: #ffd1d6; color: #a23343; }
.dw-badge-info { background: #eef4ff; border-color: #c8d7ff; color: #2454a6; }

.dw-alert { border: 1px solid #c9f1df; background: #ebfff6; color: #065f46; border-radius: var(--dw-radius-md); padding: 12px 14px; display: grid; gap: 4px; }
.dw-alert strong { color: inherit; }
.dw-alert p { margin: 0; }
.dw-alert-warning { border-color: #f5c77d; background: #fff8eb; color: #7a4b05; }
.dw-alert-danger { border-color: #ffd1d6; background: #fff1f2; color: #a23343; }
.dw-alert-info { border-color: #c8d7ff; background: #eef4ff; color: #2454a6; }

.dw-form { display: grid; gap: 18px; }
.dw-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.dw-field { display: grid; gap: 6px; font-size: 13px; color: var(--dw-muted); font-weight: 700; }
.dw-field.wide { grid-column: 1 / -1; }
.dw-field input, .dw-field select, .dw-field textarea { width: 100%; border: 1px solid var(--dw-line); border-radius: var(--dw-radius-md); padding: 10px; min-height: 40px; background: white; color: var(--dw-ink); }
.dw-field textarea { min-height: 110px; resize: vertical; }
.dw-field small { color: var(--dw-muted); font-weight: 500; }
.dw-check-row { display: flex; align-items: center; gap: 8px; color: var(--dw-muted); font-weight: 700; }

.dw-table-wrap { width: 100%; overflow-x: auto; }
.dw-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.dw-table th, .dw-table td { padding: 13px 12px; text-align: left; border-bottom: 1px solid var(--dw-line); vertical-align: middle; }
.dw-table th { font-size: 12px; text-transform: uppercase; color: var(--dw-muted); background: #f8fafc; }
.dw-table td { font-size: 14px; }
.dw-table tbody tr:hover { background: #fbfdff; }
.dw-table-primary { display: grid; gap: 3px; }
.dw-table-primary strong { color: var(--dw-ink); }
.dw-table-primary small { color: var(--dw-muted); overflow-wrap: anywhere; }
.dw-actions-cell { width: 1%; white-space: nowrap; text-align: right; }

.dw-dropdown { position: relative; display: inline-block; }
.dw-dropdown-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; border: 1px solid var(--dw-line); border-radius: var(--dw-radius-md); background: white; box-shadow: 0 18px 40px rgba(16, 24, 32, .14); padding: 6px; display: grid; gap: 4px; z-index: 25; }
.dw-dropdown-panel a, .dw-dropdown-panel button { width: 100%; border: 0; background: transparent; text-align: left; border-radius: var(--dw-radius); padding: 9px 10px; color: var(--dw-ink); cursor: pointer; font-size: 13px; line-height: 1.2; }
.dw-dropdown-panel a:hover, .dw-dropdown-panel button:hover { background: var(--dw-soft); }

.dw-overview-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.dw-overview-card { min-height: 128px; display: grid; align-content: start; gap: 10px; padding: 16px; border: 1px solid var(--dw-line); border-radius: var(--dw-radius); background: #fbfdff; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.dw-overview-card:hover { border-color: rgba(31, 138, 112, .42); transform: translateY(-2px); box-shadow: var(--dw-shadow); }
.dw-overview-card strong { font-size: 16px; }
.dw-overview-card span { color: var(--dw-muted); line-height: 1.45; }

.dw-mobile-bottom-nav,
.dw-mobile-more,
.dw-mobile-more-backdrop { display: none; }

.dw-modal-backdrop { position: fixed; inset: 0; background: rgba(16, 24, 32, .46); z-index: 60; display: grid; place-items: center; padding: 20px; }
.dw-modal { width: min(560px, 100%); background: white; border: 1px solid var(--dw-line); border-radius: var(--dw-radius-md); box-shadow: var(--dw-shadow-lg); padding: 20px; display: grid; gap: 16px; }
.dw-modal header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.dw-modal h2 { margin: 0; font-size: 20px; }
.dw-modal p { margin: 0; color: var(--dw-muted); }

.dw-auth-screen { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #eef7f4 0%, #f7fafc 48%, #edf2f7 100%); padding: 24px; }
.dw-auth-panel { width: min(980px, 100%); display: grid; grid-template-columns: 1fr 420px; gap: 20px; align-items: stretch; }
.dw-auth-copy { background: linear-gradient(160deg, #101820, #152637); color: white; border-radius: var(--dw-radius-md); padding: 38px; display: flex; flex-direction: column; justify-content: flex-end; min-height: 460px; box-shadow: 0 24px 50px rgba(16, 24, 32, .16); }
.dw-auth-copy h1 { margin: 24px 0 8px; font-size: 44px; }
.dw-auth-copy p { color: #b8c7d5; font-size: 18px; }
.dw-login-card { padding: 30px; display: grid; gap: 16px; align-content: center; }
.dw-login-card h2 { margin: 0; font-size: 28px; }

@media screen and (max-width: 1180px) {
    .dw-auth-panel { grid-template-columns: 1fr; }
    .dw-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dw-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen and (max-width: 768px) {
    html, body { overflow-x: hidden; }
    .dw-app-shell { display: block; }
    .dw-sidebar { display: none; }
    .dw-topbar { display: none; }
    .dw-mobile-topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 38; padding: 10px 14px; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--dw-line); backdrop-filter: blur(16px); }
    .dw-content { padding: 18px 14px 92px; }
    .dw-page-heading { flex-direction: column; align-items: stretch; }
    .dw-page-heading h1 { font-size: 28px; }
    .dw-metric-grid, .dw-form-grid, .dw-overview-grid { grid-template-columns: 1fr; }
    .dw-btn { width: 100%; }
    .dw-topbar-actions > *, .dw-page-heading > *, .dw-page-actions { width: 100%; }
    .dw-page-actions { justify-content: stretch; }
    .dw-table { min-width: 620px; }
    .dw-auth-copy { min-height: 300px; padding: 24px; }
    .dw-auth-copy h1 { font-size: 34px; }
    .dw-login-card { padding: 22px; }
    .dw-mobile-bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 52; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; padding: 8px max(8px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right)); background: rgba(255,255,255,.97); border-top: 1px solid var(--dw-line); box-shadow: 0 -18px 40px rgba(16, 24, 32, .1); backdrop-filter: blur(16px); }
    .dw-mobile-bottom-nav a,
    .dw-mobile-bottom-nav button { min-width: 0; min-height: 54px; border: 0; border-radius: var(--dw-radius); background: transparent; color: var(--dw-muted); display: grid; place-items: center; align-content: center; gap: 3px; font-size: 11px; font-weight: 900; cursor: pointer; }
    .dw-mobile-bottom-nav span { width: 24px; height: 24px; border-radius: var(--dw-radius); display: grid; place-items: center; background: #eef4f1; color: var(--dw-primary); font-size: 10px; }
    .dw-mobile-bottom-nav a.is-active,
    .dw-mobile-bottom-nav button.is-active { color: var(--dw-primary); background: rgba(31, 138, 112, .1); }
    .dw-mobile-more-backdrop { position: fixed; inset: 0; z-index: 58; background: rgba(16, 24, 32, .42); }
    .dw-mobile-more-backdrop.is-open { display: block; }
    .dw-mobile-more { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; max-height: min(76vh, 620px); border-radius: 16px 16px 0 0; background: #fff; border: 1px solid var(--dw-line); box-shadow: var(--dw-shadow-lg); padding: 16px; overflow-y: auto; }
    .dw-mobile-more.is-open { display: block; }
    .dw-mobile-more-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
    .dw-mobile-more-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .dw-mobile-more-links a,
    .dw-mobile-more-links button { min-height: 52px; width: 100%; border: 1px solid var(--dw-line); border-radius: var(--dw-radius); background: #fbfdff; color: var(--dw-ink); display: flex; align-items: center; gap: 10px; padding: 10px; font-weight: 900; text-align: left; cursor: pointer; }
    .dw-mobile-more-links a.is-active { border-color: rgba(31, 138, 112, .45); color: var(--dw-primary); background: rgba(31, 138, 112, .08); }
    .dw-mobile-more-links span { width: 28px; height: 28px; border-radius: var(--dw-radius); background: #eef4f1; color: var(--dw-primary); display: grid; place-items: center; font-size: 11px; flex: 0 0 auto; }
}
