:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #1f2937;
  background: #f4f5f7;
  font-synthesis: none;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: #f4f5f7; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(20, 72, 144, 0.28); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand img { display: block; width: 176px; height: auto; }
.brand-light { position: relative; z-index: 1; }
.brand-light img { filter: brightness(0) invert(1); }

.login-page { display: grid; min-height: 100vh; padding: 32px; background: #edf0f4; place-items: center; }
.login-card { display: grid; width: min(980px, 100%); min-height: 590px; grid-template-columns: 1fr 0.9fr; overflow: hidden; border: 1px solid #d9dee7; border-radius: 12px; background: #fff; box-shadow: 0 12px 30px rgba(30, 42, 60, 0.1); }
.login-visual { position: relative; display: flex; padding: 46px; flex-direction: column; justify-content: space-between; color: #fff; background: #123d79; }
.login-visual::after { position: absolute; right: 0; bottom: 0; left: 0; height: 7px; background: #e3af25; content: ""; }
.visual-copy { position: relative; z-index: 1; max-width: 395px; margin-bottom: 32px; }
.visual-tag { display: inline-block; margin-bottom: 19px; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.5); color: #e8f1ff; font-size: 0.72rem; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase; }
.visual-copy h2 { margin: 0 0 17px; font-size: clamp(1.9rem, 4vw, 2.85rem); line-height: 1.12; letter-spacing: -0.035em; }
.visual-copy p { max-width: 350px; margin: 0; color: #d5e2f3; font-size: 1rem; line-height: 1.65; }
.visual-decoration { display: none; }

.login-content { display: flex; padding: 60px 54px; flex-direction: column; justify-content: center; }
.mobile-brand { display: none; margin-bottom: 50px; }
.login-heading { margin-bottom: 30px; }
.eyebrow { display: block; margin-bottom: 9px; color: #1956a1; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.login-heading h1, .dashboard-heading h1 { margin: 0; color: #172033; font-size: 2.1rem; line-height: 1.15; letter-spacing: -0.035em; }
.login-heading p, .dashboard-heading p { margin: 12px 0 0; color: #667085; line-height: 1.6; }
.microsoft-button { display: flex; width: 100%; min-height: 50px; padding: 12px 18px; border: 1px solid #154b91; border-radius: 7px; align-items: center; justify-content: center; gap: 13px; color: #fff; background: #154b91; font-weight: 700; transition: background 160ms ease; }
.microsoft-button:hover:not(:disabled) { background: #103d76; }
.microsoft-button:disabled { cursor: wait; opacity: 0.62; }
.microsoft-icon { display: grid; width: 17px; height: 17px; grid-template-columns: repeat(2, 1fr); gap: 2px; }
.microsoft-icon i { background: #fff; }
.status { min-height: 21px; margin: 16px 0 0; color: #737e90; font-size: 0.82rem; text-align: center; }
.security-note { display: flex; margin: 34px 0 0; align-items: center; justify-content: center; gap: 7px; color: #7b8493; font-size: 0.76rem; }

.app-shell { min-height: 100vh; }
.app-header { position: sticky; z-index: 10; top: 0; border-bottom: 1px solid #dce1e8; background: #fff; }
.header-inner { display: flex; width: min(1160px, calc(100% - 48px)); min-height: 72px; margin: 0 auto; align-items: center; justify-content: space-between; gap: 24px; }
.header-brand img { width: 148px; }
.user-menu { display: flex; align-items: center; gap: 11px; }
.user-avatar { display: grid; width: 40px; height: 40px; overflow: hidden; border: 1px solid #c9d4e4; border-radius: 50%; color: #154b91; background: #e5edf7; place-items: center; font-size: 0.8rem; font-weight: 800; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-data { display: flex; min-width: 0; flex-direction: column; }
.user-data strong, .user-data span { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-data strong { color: #273244; font-size: 0.84rem; }
.user-data span { margin-top: 2px; color: #7b8495; font-size: 0.7rem; }
.logout-button { display: flex; min-height: 36px; margin-left: 10px; padding: 8px 11px; border: 1px solid #d7dde6; border-radius: 6px; align-items: center; gap: 7px; color: #4e5a6d; background: #fff; font-size: 0.78rem; font-weight: 700; }
.logout-button:hover { color: #123d79; border-color: #9cb3d2; background: #f4f7fb; }
.logout-button svg, .search-field svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.dashboard { width: min(1160px, calc(100% - 48px)); margin: 0 auto; padding: 54px 0 72px; }
.dashboard-heading { display: flex; margin-bottom: 42px; padding-bottom: 28px; border-bottom: 1px solid #dce1e8; align-items: end; justify-content: space-between; gap: 32px; }
.search-field { position: relative; display: block; width: min(330px, 100%); }
.search-field svg { position: absolute; top: 50%; left: 14px; color: #788497; transform: translateY(-50%); }
.search-field input { width: 100%; min-height: 44px; padding: 10px 15px 10px 42px; border: 1px solid #cfd6e1; border-radius: 6px; color: #273247; background: #fff; }
.search-field input::placeholder { color: #929baa; }
.search-field input:focus { border-color: #7598c6; }
.section-title { display: flex; margin-bottom: 17px; align-items: center; justify-content: space-between; }
.section-title h2 { margin: 0; color: #273247; font-size: 1rem; letter-spacing: -0.01em; }
.section-title span { color: #768195; font-size: 0.78rem; }

.documents-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.document-card { display: flex; min-height: 274px; padding: 23px; border: 1px solid #dce1e8; border-radius: 8px; flex-direction: column; background: #fff; transition: border-color 170ms ease, box-shadow 170ms ease; }
.document-card:hover { border-color: #aebed4; box-shadow: 0 6px 16px rgba(38, 55, 79, 0.08); }
.document-icon { display: grid; width: 44px; height: 44px; margin-bottom: 20px; border-radius: 7px; place-items: center; }
.document-icon svg { width: 23px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.document-icon-blue { color: #1956a1; background: #e6eef9; }
.document-icon-green { color: #08765a; background: #e2f2ec; }
.document-icon-amber { color: #9a5d0a; background: #fbefd8; }
.document-info { flex: 1; }
.document-type { color: #737e90; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; }
.document-info h3 { margin: 8px 0 9px; color: #202a3b; font-size: 1.04rem; letter-spacing: -0.015em; }
.document-info p { margin: 0; color: #657185; font-size: 0.85rem; line-height: 1.55; }
.document-meta { display: flex; margin-top: 18px; align-items: center; justify-content: space-between; gap: 8px; }
.document-version, .document-status { display: inline-flex; min-height: 23px; padding: 4px 8px; border-radius: 4px; align-items: center; font-size: 0.67rem; font-weight: 800; }
.document-version { color: #526076; background: #f0f2f5; }
.document-status-unseen { color: #9a4f0b; background: #fbedd9; }
.document-status-viewed { color: #1956a1; background: #e6eef9; }
.document-status-accepted { color: #087055; background: #e1f2eb; }
.document-actions { display: grid; margin-top: 21px; padding-top: 14px; border-top: 1px solid #edf0f4; grid-template-columns: 1fr 1fr; gap: 9px; }
.document-button { min-height: 37px; padding: 8px 10px; border-radius: 6px; font-size: 0.73rem; font-weight: 750; }
.document-button-view { color: #fff; border: 1px solid #154b91; background: #154b91; }
.document-button-view:hover { border-color: #103d76; background: #103d76; }
.document-button-accept { color: #087055; border: 1px solid #a2d7c5; background: #eff8f4; }
.document-button-accept:hover:not(:disabled) { border-color: #59ae91; background: #e3f4ed; }
.document-button:disabled { color: #8892a0; border-color: #dce1e8; background: #f5f6f8; cursor: not-allowed; }
.empty-state { padding: 56px 24px; border: 1px dashed #c6ceda; border-radius: 8px; color: #596579; text-align: center; background: #fff; }
.empty-state p { margin: 7px 0 0; color: #8992a3; font-size: 0.85rem; }

.komgroup-alert { border-radius: 9px !important; box-shadow: 0 14px 36px rgba(31, 45, 65, 0.18) !important; }
.komgroup-alert-button { margin: 0 0 0 8px !important; padding: 10px 16px !important; border: 1px solid #154b91 !important; border-radius: 6px !important; color: #fff !important; background: #154b91 !important; font-weight: 700 !important; }
.komgroup-alert-button:hover { background: #103d76 !important; }
.komgroup-alert-button-cancel { color: #4e5a6d !important; border-color: #cfd6e1 !important; background: #fff !important; }
.swal2-toast.komgroup-alert { font-size: 0.88rem; }

@media (max-width: 860px) {
  .login-card { width: min(520px, 100%); min-height: auto; grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-content { min-height: 570px; }
  .mobile-brand { display: inline-flex; }
  .documents-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .login-page { padding: 0; background: #fff; }
  .login-card { min-height: 100vh; border: 0; border-radius: 0; box-shadow: none; }
  .login-content { min-height: 100vh; padding: 40px 26px; }
  .login-heading h1, .dashboard-heading h1 { font-size: 1.85rem; }
  .header-inner, .dashboard { width: min(100% - 32px, 1160px); }
  .user-data, .logout-button span { display: none; }
  .logout-button { margin-left: 0; }
  .dashboard { padding-top: 40px; }
  .dashboard-heading { margin-bottom: 34px; align-items: stretch; flex-direction: column; }
  .search-field { width: 100%; }
  .documents-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
