
:root{
  --navy:#071d3d;
  --navy2:#0a356d;
  --blue:#1261d8;
  --blue2:#084aa9;
  --bg:#f5f7fb;
  --surface:#ffffff;
  --line:#dfe6ef;
  --text:#14243a;
  --muted:#6f7c8f;
  --danger:#b93636;
  --radius:14px;
  --shadow:0 6px 22px rgba(20,36,58,.07);
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{
  margin:0;
  font-family:Arial,Helvetica,sans-serif;
  background:var(--bg);
  color:var(--text);
  font-size:15px;
  line-height:1.42;
}
a{text-decoration:none;color:inherit}
h1{font-size:30px;line-height:1.12;margin:0 0 8px;font-weight:800;letter-spacing:-.5px}
h2{font-size:20px;line-height:1.2;margin:0 0 14px}
h3{font-size:17px;margin:0 0 10px}
p{margin:7px 0 12px}
.lead{color:var(--muted);font-size:15px;margin:0 0 20px}

.sidebar{
  position:fixed;inset:0 auto 0 0;width:238px;
  background:linear-gradient(180deg,#06172f,#0a3a78);
  padding:18px 14px;color:#fff;z-index:1000;overflow:auto
}
.brand{display:flex;gap:10px;align-items:center;margin-bottom:18px}
.brand img{width:42px;height:42px;border-radius:11px;object-fit:contain;background:#fff;padding:3px}
.brand b{font-size:16px}
.brand small{display:block;color:#bdd0ec;margin-top:2px;font-size:11px}
.sidebar nav{display:grid;gap:3px}
.sidebar nav a{padding:9px 10px;border-radius:8px;font-size:14px}
.sidebar nav a:hover{background:rgba(255,255,255,.11)}

main{
  margin-left:238px;
  padding:24px;
  max-width:1500px;
  min-height:100vh
}

.card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:16px;
  margin-bottom:14px;
  box-shadow:var(--shadow)
}
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:14px}
.stats .card{margin:0}
.stats span{display:block;color:var(--muted);font-size:12px;font-weight:700}
.stats b{display:block;font-size:27px;line-height:1.1;margin-top:7px}
.cards3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.twocol{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.grid{display:grid;grid-template-columns:1fr 1fr;gap:11px}
.grid .wide{grid-column:1/-1}

label{display:grid;gap:5px;color:var(--muted);font-size:13px;font-weight:600}
input,select,textarea{
  width:100%;min-height:42px;
  padding:9px 11px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  color:var(--text);
  font:inherit;
  outline:none
}
input:focus,select:focus,textarea:focus{
  border-color:#8eb6ed;
  box-shadow:0 0 0 3px rgba(18,97,216,.10)
}
textarea{min-height:82px;resize:vertical}
button,.btnlink{
  border:0;
  background:linear-gradient(135deg,var(--blue),var(--blue2));
  color:#fff;
  min-height:40px;
  padding:9px 14px;
  border-radius:10px;
  font-size:14px;
  font-weight:700;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center
}
button:disabled{opacity:.6;cursor:default}
.danger{background:var(--danger)}
.flash{padding:11px 13px;border-radius:10px;background:#e9f2ff;margin-bottom:13px;font-size:14px}
.flash.error{background:#ffe4e4;color:#902222}

table{width:100%;border-collapse:collapse}
th,td{text-align:left;padding:9px 8px;border-bottom:1px solid var(--line);font-size:13px;vertical-align:top}
th{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.3px}
.mobile-menu{display:none}
.check{width:100%;text-align:left;background:#eef4ff;color:var(--text);margin:3px 0}
.check.done{text-decoration:line-through;opacity:.6}
.inline{display:flex;gap:7px;margin-top:8px}
.comment{border-bottom:1px solid var(--line);padding:9px 0}
.comment small{display:block;color:var(--muted);font-size:11px}

/* PROFESSIONAL LOGIN */
.login-page{
  min-height:100dvh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:
    radial-gradient(circle at 20% 15%,rgba(32,114,226,.28),transparent 34%),
    linear-gradient(145deg,#05152e 0%,#0b3570 52%,#0758c7 100%);
}
.login-card{
  width:min(390px,100%);
  background:rgba(255,255,255,.985);
  border-radius:20px;
  padding:26px 26px 24px;
  box-shadow:0 22px 60px rgba(0,0,0,.26);
  border:1px solid rgba(255,255,255,.55)
}
.login-brand{
  text-align:center;
  margin-bottom:22px
}
.login-logo{
  width:74px;
  height:74px;
  display:block;
  margin:0 auto 12px;
  border-radius:18px;
  object-fit:contain
}
.login-card h1{
  font-size:24px;
  text-align:center;
  margin:0
}
.login-subtitle{
  color:var(--muted);
  font-size:13px;
  text-align:center;
  margin-top:5px
}
.login-card form{display:grid;gap:12px}
.login-card button{width:100%;margin-top:3px}
.login-footer{
  text-align:center;
  color:#8994a4;
  font-size:11px;
  margin-top:18px
}

/* PWA install page */
.install-hero{max-width:760px}
.install-note{
  display:flex;align-items:center;gap:10px;
  padding:12px;border-radius:11px;background:#eef5ff;color:#23466f
}

@media(max-width:1100px){
  .stats{grid-template-columns:repeat(2,1fr)}
  .cards3{grid-template-columns:repeat(2,1fr)}
}

@media(max-width:900px){
  body{font-size:14px}
  .mobile-menu{
    display:flex;
    position:fixed;z-index:1200;
    top:max(10px,env(safe-area-inset-top));
    left:12px;
    width:46px;height:46px;
    min-height:46px;
    padding:0;
    border-radius:12px;
    font-size:20px;
    box-shadow:0 5px 15px rgba(0,0,0,.15)
  }
  .sidebar{
    width:min(285px,84vw);
    transform:translateX(-105%);
    transition:transform .2s ease;
    box-shadow:0 18px 60px rgba(0,0,0,.3);
    padding-top:max(18px,env(safe-area-inset-top))
  }
  .sidebar.open{transform:translateX(0)}
  main{
    margin-left:0;
    padding:72px 12px calc(18px + env(safe-area-inset-bottom));
    max-width:none
  }
  h1{font-size:24px;letter-spacing:-.35px}
  h2{font-size:18px}
  h3{font-size:16px}
  .lead{font-size:14px;margin-bottom:15px}
  .card{padding:14px;border-radius:13px;margin-bottom:12px}
  .stats,.cards3,.twocol,.grid{grid-template-columns:1fr}
  .grid .wide{grid-column:auto}
  .stats{gap:8px}
  .stats .card{padding:12px 14px}
  .stats b{font-size:22px}
  input,select,textarea{min-height:40px;padding:8px 10px}
  textarea{min-height:74px}
  button,.btnlink{min-height:38px;padding:8px 12px;font-size:13px}
  table{display:block;overflow-x:auto;white-space:nowrap;-webkit-overflow-scrolling:touch}
  th,td{padding:8px 7px}
}

@media(max-width:480px){
  .login-page{padding:18px}
  .login-card{padding:22px 20px;border-radius:18px}
  .login-logo{width:66px;height:66px}
  .login-card h1{font-size:22px}
  main{padding-left:10px;padding-right:10px}
  .card{padding:13px}
}

@media(max-height:650px) and (max-width:900px){
  .login-page{align-items:flex-start;padding-top:22px}
  .login-card{padding-top:18px;padding-bottom:18px}
  .login-logo{width:54px;height:54px;margin-bottom:8px}
  .login-brand{margin-bottom:15px}
}


.notification-bell{
 position:fixed;right:14px;top:max(12px,env(safe-area-inset-top));z-index:1201;
 width:44px;height:44px;border-radius:12px;background:#fff;color:#12345b;
 display:flex;align-items:center;justify-content:center;font-size:19px;
 box-shadow:0 5px 18px rgba(20,36,58,.13);border:1px solid var(--line)
}
#notificationBadge{
 position:absolute;right:-4px;top:-5px;min-width:20px;height:20px;padding:0 5px;
 border-radius:12px;background:#d52f2f;color:#fff;font-size:10px;font-weight:800;
 align-items:center;justify-content:center;border:2px solid #fff
}
.notification-unread{border-left:4px solid var(--blue)}
.notification-dot{display:block;width:10px;height:10px;border-radius:50%;background:var(--blue)}
@media(min-width:901px){.notification-bell{right:18px;top:18px}}

.client-status{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:800}
.client-status.open{background:#eef3fa;color:#39546f}
.client-status.doing{background:#fff2cc;color:#765b00}
.client-status.review{background:#e8efff;color:#234d91}
.client-status.done{background:#dff5e7;color:#21673b}
.invoice-card{display:grid;grid-template-columns:1fr auto;gap:14px;align-items:center}
.client-summary-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:14px}
.client-summary-grid .card{margin:0}
@media(max-width:900px){
 .client-summary-grid{grid-template-columns:1fr}
 .invoice-card{grid-template-columns:1fr}
}

.incident-status{display:inline-flex;padding:4px 8px;border-radius:999px;font-size:11px;font-weight:800}
.incident-status.open{background:#eef3fa;color:#39546f}
.incident-status.doing{background:#fff2cc;color:#765b00}
.incident-status.done{background:#dff5e7;color:#21673b}
.incident-photo{max-width:100%;border-radius:12px;border:1px solid var(--line);display:block}

.language-switch{display:flex;gap:5px;margin:4px 0 10px}
.language-switch a{padding:6px 10px!important;border:1px solid rgba(255,255,255,.2);font-size:11px!important;font-weight:800}
.language-switch a.active{background:#fff!important;color:#0a356d!important}
.global-toast{
 position:fixed;right:18px;bottom:18px;z-index:9999;max-width:min(390px,calc(100vw - 24px));
 padding:12px 16px;border-radius:12px;background:#153c69;color:#fff;font-size:14px;font-weight:700;
 box-shadow:0 12px 35px rgba(0,0,0,.22);opacity:0;transform:translateY(15px);pointer-events:none;
 transition:.2s ease
}
.global-toast.show{opacity:1;transform:translateY(0)}
.media-preview{width:100%;max-height:280px;object-fit:cover;border-radius:12px;border:1px solid var(--line);background:#eef2f7}
.employee-avatar{width:96px;height:96px;border-radius:22px;object-fit:cover;border:1px solid var(--line);background:#eef2f7}
.employee-avatar.small{width:42px;height:42px;border-radius:11px}
.user-name-cell{display:flex;align-items:center;gap:10px}
.document-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:11px 0;border-bottom:1px solid var(--line)}
.document-row:last-child{border-bottom:0}
.media-card{overflow:hidden}
.media-card .media-preview{margin-bottom:12px}
@media(max-width:900px){
 .global-toast{right:12px;left:12px;bottom:12px;max-width:none}
 .document-row{align-items:flex-start;flex-direction:column}
}


/* Workforce 8.4.5 - employee barcode scanner */
.barcode-scanner-card{max-width:760px}
.barcode-video-wrap{position:relative;background:#071d3d;border-radius:16px;overflow:hidden;min-height:220px}
#barcodeVideo{display:block;width:100%;height:min(48vh,420px);object-fit:cover;background:#071d3d}
.barcode-guide{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none}
.barcode-guide span{display:block;width:82%;height:30%;border:3px solid rgba(255,255,255,.9);border-radius:14px;box-shadow:0 0 0 9999px rgba(0,0,0,.18)}
.barcode-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:14px}
.barcode-actions button{flex:1;min-width:140px}
.barcode-status{margin:12px 0;color:#65758a;font-weight:600}
.barcode-manual{display:grid;grid-template-columns:1fr auto;gap:12px;align-items:end;margin-top:12px}
.barcode-manual label{margin:0}
.employee-scan-result{display:grid;gap:16px;margin-top:18px}
.employee-profile-head{display:flex;align-items:center;gap:18px}
.status-badge{display:inline-flex;padding:6px 10px;border-radius:999px;background:#e8f7ee;color:#147843;font-weight:800;font-size:13px}
.barcode-code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;word-break:break-all}
@media(max-width:640px){
 .barcode-manual{grid-template-columns:1fr}
 .barcode-manual button{width:100%}
 #barcodeVideo{height:300px}
 .employee-profile-head{align-items:flex-start}
}

/* ===== SG DIREKT 1.0 ===== */
:root{--navy:#071d3d;--blue:#247cff;--blue2:#1557bd;--bg:#f4f7fb;--surface:#fff;--line:#e4eaf2;--text:#13233a;--muted:#718096;--radius:16px;--shadow:0 10px 30px rgba(7,29,61,.06)}
body{font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;background:var(--bg)}
.sidebar{width:264px;background:#071d3d;padding:22px 16px}.sg-brand{padding:4px 6px 18px;border-bottom:1px solid rgba(255,255,255,.1)}.sg-brand img{background:transparent;padding:0;width:44px;height:44px}.sg-brand b{font-size:18px;letter-spacing:.4px}.sg-brand small{color:#91b7e8}.sidebar nav{gap:5px;margin-top:14px}.sidebar nav a{padding:10px 12px;color:#d9e7f7}.sidebar nav a:hover{background:#123664;color:#fff}
.topbar{position:fixed;left:264px;right:0;top:0;height:64px;background:rgba(255,255,255,.94);backdrop-filter:blur(12px);border-bottom:1px solid var(--line);z-index:900;display:flex;align-items:center;justify-content:space-between;padding:0 28px}.topbar-product{font-weight:900;color:var(--navy);letter-spacing:.6px}.topbar-context{margin-left:14px;color:var(--muted);font-size:13px}.topbar-actions{display:flex;gap:10px}.topbar-actions a{padding:8px 11px;border-radius:9px;background:#f3f6fa;font-size:12px;font-weight:700}.notification-bell{display:none!important}
main{margin-left:264px;padding:92px 30px 30px;max-width:1700px}.card{border:1px solid var(--line);box-shadow:var(--shadow);padding:20px}.stats{gap:16px}.stats .card{min-height:112px}.stats b{font-size:30px}.grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}input,select,textarea{border-radius:10px;border-color:#d8e0eb;background:#fbfcfe}button,.btnlink{border-radius:10px;background:#1769e0;box-shadow:none}table{background:#fff}th{background:#f8fafc}th,td{padding:12px 10px}.login-wordmark{width:100%;height:auto;max-width:360px}.login-card{max-width:460px;padding:34px}.login-card .login-brand{margin-bottom:24px}
.contract-status{display:inline-flex;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:800;background:#edf3fb;color:#31567f}.contract-status.signed,.contract-status.active{background:#def5e7;color:#17643a}.signature-pad{width:100%;height:240px;border:1px dashed #aebbc9;border-radius:14px;background:#fff;touch-action:none}.signature-actions{display:flex;gap:10px;margin-top:10px}.document-sheet{max-width:900px;margin:auto;background:#fff;padding:46px;box-shadow:0 8px 30px rgba(0,0,0,.08)}
@media(max-width:900px){.topbar{left:0;height:58px;padding:0 12px 0 70px}.topbar-context{display:none}.topbar-actions a{padding:7px}.topbar-actions a:last-child{display:none}main{margin-left:0;padding:78px 12px 24px}.grid{grid-template-columns:1fr}.sidebar{width:min(300px,88vw)}}
@media print{.sidebar,.topbar,.mobile-menu,.notification-bell,.no-print{display:none!important}main{margin:0;padding:0}.document-sheet{box-shadow:none;max-width:none;padding:0}}

/* SG DIREKT 1.0.1 — unified desktop/mobile shell */
.sidebar{width:264px;padding:18px 16px;background:linear-gradient(180deg,#06162f 0%,#082a58 56%,#0a3b78 100%)}
.sidebar nav a{padding:10px 11px;border-radius:9px;line-height:1.25}
.topbar{left:264px;height:68px;padding:0 28px}
.topbar-left{display:flex;align-items:baseline;gap:12px;min-width:0}
.topbar-page{font-size:12px;color:var(--muted);font-weight:600}
.topbar-user{display:flex;align-items:center;gap:10px;margin-left:auto}
.topbar-user-text{display:flex;flex-direction:column;align-items:flex-end;line-height:1.2}
.topbar-user-text b{font-size:13px;color:var(--text)}
.topbar-user-text small{font-size:11px;color:var(--muted);margin-top:3px}
.topbar-notif,.topbar-logout{padding:8px 10px;border-radius:9px;background:#f3f6fa;font-size:12px;font-weight:700}
main{margin-left:264px;padding:96px 30px 32px;width:calc(100% - 264px);max-width:none}
.card{padding:20px}
.grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
@media(min-width:1200px){main>.card .grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:900px){
 .topbar{left:0;height:64px;padding:0 10px 0 68px}
 .topbar-left{display:none}
 .topbar-user{width:100%;justify-content:flex-end;gap:7px}
 .topbar-user-text{display:flex;max-width:58vw;overflow:hidden}
 .topbar-user-text b,.topbar-user-text small{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .topbar-user-text b{font-size:12px}.topbar-user-text small{font-size:10px}
 .topbar-logout{display:none}.topbar-notif{padding:7px 8px}
 main{margin-left:0;width:100%;padding:80px 12px 24px}
}
/* SG Direkt 1.1 - collapsible desktop navigation */
.sidebar-toggle{position:absolute;right:-14px;top:78px;width:28px;height:28px;border-radius:50%;padding:0;background:#fff;color:#071d3d;border:1px solid #d7e0ec;z-index:1001;box-shadow:0 3px 10px #0002}
@media(min-width:901px){body.sidebar-collapsed .sidebar{width:78px;padding-left:10px;padding-right:10px}body.sidebar-collapsed .topbar{left:78px}body.sidebar-collapsed main{margin-left:78px;width:calc(100% - 78px)}body.sidebar-collapsed .sg-brand div,body.sidebar-collapsed .language-switch{display:none}body.sidebar-collapsed .sg-brand{justify-content:center}body.sidebar-collapsed .sidebar nav a{font-size:0;text-align:center;white-space:nowrap;overflow:hidden}body.sidebar-collapsed .sidebar nav a::first-letter{font-size:18px}body.sidebar-collapsed .sidebar-toggle{transform:rotate(180deg)}}
@media(max-width:900px){.sidebar-toggle{display:none}}

/* SG Direkt 1.4.3 — mobile application hardening */
@media (max-width:900px){
 html,body{max-width:100%;overflow-x:hidden}
 body{font-size:15px}
 .mobile-menu{display:flex!important;position:fixed!important;left:14px!important;top:12px!important;width:42px!important;height:42px!important;align-items:center!important;justify-content:center!important;z-index:1300!important;border:0!important;border-radius:11px!important;background:#0b2b57!important;color:#fff!important;font-size:24px!important;box-shadow:0 4px 14px #0003!important}
 .sidebar{display:block!important;position:fixed!important;left:0!important;top:0!important;bottom:0!important;width:min(320px,88vw)!important;height:100dvh!important;overflow-y:auto!important;z-index:1250!important;transform:translateX(-105%)!important;transition:transform .22s ease!important;padding:18px 14px 28px!important}
 .sidebar.open{transform:translateX(0)!important}
 .sidebar nav{display:grid!important;gap:4px!important}.sidebar nav a{display:block!important;font-size:14px!important;padding:10px 11px!important;color:#e6f0fb!important;text-decoration:none!important}
 .topbar{display:flex!important;position:fixed!important;left:0!important;right:0!important;top:0!important;height:64px!important;z-index:1200!important;padding:0 10px 0 68px!important;background:#fff!important}
 main{display:block!important;margin:0!important;width:100%!important;max-width:100%!important;padding:78px 12px 26px!important;box-sizing:border-box!important}
 main>*{max-width:100%;box-sizing:border-box}.card{padding:16px!important;border-radius:14px!important}.grid{display:grid!important;grid-template-columns:1fr!important;gap:12px!important}
 input,select,textarea,button{max-width:100%;box-sizing:border-box}input,select,textarea{width:100%!important;font-size:16px!important}button,.btn,.btnlink{min-height:42px}
 table{min-width:680px}.table-wrap,.table-responsive{overflow-x:auto;-webkit-overflow-scrolling:touch}
 .signature-pad{display:block!important;width:100%!important;height:260px!important;min-height:260px!important;touch-action:none!important}.signature-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:10px!important}.signature-actions button{width:100%!important}
}
@media (max-width:480px){main{padding-left:10px!important;padding-right:10px!important}.card{padding:14px!important}.topbar-user-text{max-width:52vw!important}.signature-actions{grid-template-columns:1fr!important}}

/* SG Direkt 1.4.8 — application branding */
.sg-brand img{width:64px!important;height:42px!important;object-fit:contain!important;border-radius:8px!important;background:#fff!important;}
@media screen and (max-width:900px){.sg-brand img{width:58px!important;height:38px!important;}}

/* SG Direkt 1.5.0 — unified mobile app cards */
@media screen and (max-width:760px){
  main table:not(.keep-mobile-table){min-width:0!important;width:100%!important;border:0!important;background:transparent!important;border-collapse:separate!important;border-spacing:0!important}
  main table:not(.keep-mobile-table) thead{display:none!important}
  main table:not(.keep-mobile-table) tbody{display:block!important;width:100%!important}
  main table:not(.keep-mobile-table) tbody>tr{display:block!important;width:100%!important;margin:0 0 14px!important;padding:16px!important;box-sizing:border-box!important;border:1px solid #d9e1ec!important;border-radius:16px!important;background:#fff!important;box-shadow:0 4px 16px rgba(15,35,65,.06)!important;overflow:hidden!important}
  main table:not(.keep-mobile-table) tbody>tr>td{display:block!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important;padding:7px 0!important;border:0!important;white-space:normal!important;overflow-wrap:anywhere!important;text-align:left!important}
  main table:not(.keep-mobile-table) tbody>tr>td[data-label]:not([data-label=""])::before{content:attr(data-label);display:block!important;margin:0 0 4px!important;color:#718096!important;font-size:11px!important;line-height:1.2!important;font-weight:800!important;text-transform:uppercase!important;letter-spacing:.035em!important}
  main table:not(.keep-mobile-table) tbody>tr>td form{width:100%!important;max-width:100%!important}
  main table:not(.keep-mobile-table) tbody>tr>td .btnlink,
  main table:not(.keep-mobile-table) tbody>tr>td button{width:100%!important;max-width:100%!important;box-sizing:border-box!important;min-height:46px!important;margin:4px 0!important;text-align:center!important;justify-content:center!important}
  main table:not(.keep-mobile-table) tbody>tr>td select,
  main table:not(.keep-mobile-table) tbody>tr>td input{max-width:100%!important;box-sizing:border-box!important}
  .table-wrap,.table-responsive{overflow:visible!important;width:100%!important}
  main .card{overflow:hidden!important}
  main .card>h2,main .card>h3{margin-top:0!important}
  main form .grid{grid-template-columns:1fr!important}
  main form button[type="submit"]{min-height:48px}
}
@media screen and (max-width:760px) and (pointer:coarse){
  button,.btn,.btnlink,a.btnlink{min-height:46px;touch-action:manipulation}
}
