  :root{
    --primary: oklch(46% 0.13 258);
    --primary-dark: oklch(38% 0.13 258);
    --primary-tint: oklch(93% 0.035 258);
    --success-text: oklch(38% 0.1 152);
    --success-bg: oklch(94% 0.045 152);
    --warn-text: oklch(42% 0.13 55);
    --warn-bg: oklch(95% 0.05 55);
    --text: oklch(24% 0.02 250);
    --muted: oklch(52% 0.02 250);
    --caption: oklch(55% 0.02 250);
    --border: oklch(91% 0.012 250);
    --page-bg: oklch(97% 0.008 240);
    --card-bg: #fff;
    --sidebar: oklch(21% 0.035 258);
    --nav-inactive: rgba(255,255,255,0.65);
    --tab-inactive: oklch(60% 0.02 250);
  }
  *{margin:0;padding:0;box-sizing:border-box;}
  html{transition:background .2s;}
  body{
    background: oklch(93% 0.02 258);
    min-height:100vh;
    font-family:'IBM Plex Sans', sans-serif;
    color:var(--text);
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:28px;
    padding:40px 20px 64px;
    transition:background .2s;
  }
  body.dark{ background: oklch(12% 0.01 258); }
  body.dark{
    --primary: oklch(62% 0.15 258);
    --primary-dark: oklch(68% 0.15 258);
    --primary-tint: oklch(28% 0.06 258);
    --success-text: oklch(78% 0.13 152);
    --success-bg: oklch(28% 0.07 152);
    --warn-text: oklch(82% 0.13 55);
    --warn-bg: oklch(30% 0.09 55);
    --text: oklch(93% 0.006 250);
    --muted: oklch(72% 0.01 250);
    --caption: oklch(65% 0.01 250);
    --border: oklch(32% 0.014 258);
    --page-bg: oklch(16% 0.012 258);
    --card-bg: oklch(22% 0.014 258);
  }
  a{color:var(--primary); text-decoration:none;}
  button{font-family:'IBM Plex Sans', sans-serif;}
  ::-webkit-scrollbar{width:8px; height:8px;}
  ::-webkit-scrollbar-thumb{background:oklch(85% 0.01 250); border-radius:8px;}

  .brand{display:flex; flex-direction:column; align-items:center; gap:18px;}
  .brand-row{display:flex; align-items:center; gap:12px;}
  .logo-mark{width:40px; height:40px; border-radius:11px; background:var(--primary); display:flex; align-items:center; justify-content:center; flex-shrink:0;}
  .logo-mark span{color:#fff; font-family:'Manrope',sans-serif; font-weight:800; font-size:20px;}
  .brand-name{font-family:'Manrope',sans-serif; font-weight:700; font-size:20px; letter-spacing:-0.2px; color:var(--text);}
  .beta-badge{font-size:11px; font-weight:700; letter-spacing:0.04em; text-transform:uppercase; padding:3px 9px; border-radius:999px; background:var(--primary-tint); color:var(--primary); border:1px solid var(--border); white-space:nowrap;}

  .top-actions{display:flex; align-items:center; gap:8px;}
  .seg{display:flex; background:var(--card-bg); border:1px solid var(--border); border-radius:999px; padding:4px; gap:4px; box-shadow:0 1px 2px rgba(20,30,60,0.04);}
  .seg button{padding:9px 18px; border-radius:999px; border:none; cursor:pointer; font-size:13.5px; font-weight:600; white-space:nowrap; background:transparent; color:oklch(45% 0.02 250); transition:background .15s, color .15s;}
  .seg button.active{background:var(--primary); color:#fff;}
  body.dark .seg button{color:oklch(70% 0.01 250);}

  .icon-btn{width:38px; height:38px; border-radius:999px; background:var(--card-bg); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0; box-shadow:0 1px 2px rgba(20,30,60,0.04);}
  .icon-btn:hover{background:var(--primary-tint);}

  /* ---------- Login ---------- */
  .login-card{width:360px; max-width:100%; background:var(--card-bg); border:1px solid var(--border); border-radius:22px; padding:30px 28px; display:flex; flex-direction:column; gap:6px; box-shadow:0 24px 70px rgba(20,30,60,0.14);}
  .login-title{font-family:'Manrope',sans-serif; font-weight:700; font-size:19px; margin-bottom:14px; color:var(--text);}
  .role-seg{display:flex; background:var(--page-bg); border:1px solid var(--border); border-radius:999px; padding:4px; gap:4px; margin-bottom:18px;}
  .role-btn{flex:1; padding:9px 10px; border-radius:999px; border:none; cursor:pointer; font-size:13px; font-weight:600; background:transparent; color:var(--muted);}
  .role-btn.active{background:var(--primary); color:#fff;}
  .login-fields{display:flex; flex-direction:column; gap:4px;}
  .login-hint{font-size:12px; color:var(--caption); text-align:center; margin-top:14px;}

  /* ---------- iPhone frame ---------- */
  .phone-shell{width:390px; height:844px; border-radius:52px; background:#0c0c0e; padding:14px; box-shadow:0 24px 70px rgba(20,30,60,0.22);}
  .phone-screen{width:100%; height:100%; border-radius:40px; overflow:hidden; background:var(--page-bg); position:relative; display:flex; flex-direction:column;}
  .phone-notch{position:absolute; top:0; left:50%; transform:translateX(-50%); width:150px; height:28px; background:#0c0c0e; border-radius:0 0 18px 18px; z-index:5;}

  .avatar-btn{position:absolute; top:58px; left:18px; width:34px; height:34px; border-radius:999px; background:var(--primary); border:none; display:flex; align-items:center; justify-content:center; cursor:pointer; z-index:6; color:#fff; font-size:12px; font-weight:700; font-family:'Manrope',sans-serif;}
  .bell-btn{position:absolute; top:58px; right:18px; width:34px; height:34px; border-radius:999px; background:var(--card-bg); border:1px solid var(--border); display:flex; align-items:center; justify-content:center; cursor:pointer; z-index:6;}
  .bell-dot{position:absolute; top:6px; right:7px; width:8px; height:8px; border-radius:999px; background:oklch(58% 0.19 25); border:1.5px solid var(--card-bg);}
  .notif-panel{position:absolute; top:98px; right:16px; width:270px; max-height:360px; overflow:auto; background:var(--card-bg); border:1px solid var(--border); border-radius:14px; box-shadow:0 12px 34px rgba(20,30,60,0.18); z-index:7; padding:8px; display:flex; flex-direction:column; gap:6px;}
  .notif-item{display:flex; gap:10px; align-items:flex-start; padding:9px 8px; border-radius:10px;}
  .notif-item .icon{width:26px; height:26px; border-radius:999px; background:var(--primary-tint); display:flex; align-items:center; justify-content:center; flex-shrink:0;}
  .notif-item .text{font-size:12.5px; line-height:1.4; color:var(--text);}
  .notif-item .time{font-size:11px; color:var(--caption); margin-top:2px;}
  .notif-empty{font-size:12.5px; color:var(--caption); padding:14px; text-align:center;}

  .app-body{flex:1; display:flex; flex-direction:column; padding-top:102px; box-sizing:border-box; overflow:hidden;}
  .screen-scroll{flex:1; overflow:auto; padding:4px 20px 8px;}
  .screen-col{display:flex; flex-direction:column; gap:16px; padding-bottom:8px;}
  .page-title{font-family:'Manrope',sans-serif; font-weight:700; font-size:22px; color:var(--text);}

  .card{background:var(--card-bg); border:1px solid var(--border); border-radius:18px; padding:18px; display:flex; flex-direction:column; gap:10px;}
  .row-between{display:flex; justify-content:space-between; align-items:center;}
  .pill{font-size:12px; font-weight:600; padding:4px 10px; border-radius:999px; display:inline-block; width:fit-content;}
  .pill-success{background:var(--success-bg); color:var(--success-text);}
  .pill-warn{background:var(--warn-bg); color:var(--warn-text);}
  .pill-primary{background:var(--primary-tint); color:oklch(30% 0.06 258);}
  .pill-neutral{background:oklch(94% 0.01 250); color:oklch(45% 0.02 250);}
  body.dark .pill-neutral{background:oklch(30% 0.01 250); color:oklch(75% 0.01 250);}
  .amount{font-family:'Manrope',sans-serif; font-weight:700; font-size:26px; color:var(--text);}
  .caption{font-size:13px; color:var(--muted);}

  .progress-row{display:flex; align-items:center; gap:6px;}
  .dot{width:8px; height:8px; border-radius:999px; background:var(--border);}
  .dot.on{background:var(--primary);}
  .bar{flex:1; height:2px; background:var(--border);}
  .bar.on{background:var(--primary);}
  .progress-labels{display:flex; justify-content:space-between; font-size:11px; color:var(--caption);}

  .quick-grid{display:grid; grid-template-columns:1fr 1fr 1fr; gap:10px;}
  .quick-tile{display:flex; flex-direction:column; align-items:center; gap:8px; border:none; border-radius:14px; padding:14px 6px; cursor:pointer;}
  .quick-tile span{font-size:11.5px; font-weight:600; text-align:center;}
  .tile-blue{background:var(--primary-tint);} .tile-blue span{color:oklch(30% 0.06 258);}
  .tile-green{background:var(--success-bg);} .tile-green span{color:oklch(32% 0.07 152);}
  .tile-neutral{background:oklch(93% 0.02 250);} .tile-neutral span{color:oklch(30% 0.02 250);}
  body.dark .tile-blue{background:oklch(28% 0.05 258);} body.dark .tile-blue span{color:oklch(85% 0.08 258);}
  body.dark .tile-green{background:oklch(26% 0.06 152);} body.dark .tile-green span{color:oklch(85% 0.1 152);}
  body.dark .tile-neutral{background:oklch(26% 0.01 250);} body.dark .tile-neutral span{color:oklch(88% 0.01 250);}
  body.dark .pill-primary{color:oklch(88% 0.07 258);}

  .banner{background:var(--primary-tint); border-radius:14px; padding:14px 16px; display:flex; gap:10px; align-items:flex-start;}
  .banner-badge{width:26px; height:26px; border-radius:999px; background:var(--primary); flex-shrink:0; display:flex; align-items:center; justify-content:center;}
  .banner b{font-weight:600; font-size:13px; color:var(--text);}
  .banner p{font-size:12.5px; color:oklch(40% 0.04 258); margin-top:2px;}
  body.dark .banner p{color:oklch(80% 0.06 258);}

  .upload-card{border:1.5px dashed oklch(75% 0.03 258); border-radius:16px; padding:28px 16px; display:flex; flex-direction:column; align-items:center; gap:10px; background:oklch(98% 0.01 258); cursor:pointer; width:100%;}
  body.dark .upload-card{background:oklch(24% 0.02 258); border-color:oklch(45% 0.05 258);}
  .upload-card b{font-size:13.5px; font-weight:600; color:oklch(38% 0.1 258);}
  body.dark .upload-card b{color:oklch(80% 0.08 258);}
  .upload-card small{font-size:12px; color:oklch(55% 0.03 258);}

  .photo-placeholder{border-radius:14px; overflow:hidden; height:140px; background:repeating-linear-gradient(135deg, oklch(90% 0.01 250), oklch(90% 0.01 250) 10px, oklch(94% 0.008 250) 10px, oklch(94% 0.008 250) 20px); display:flex; align-items:center; justify-content:center;}
  .photo-placeholder span{font-family:monospace; font-size:12px; color:oklch(45% 0.02 250); background:#fff; padding:4px 10px; border-radius:6px;}

  .ai-analysis{background:var(--primary-tint); border-radius:14px; padding:14px 16px; display:flex; flex-direction:column; gap:8px;}
  .ai-analysis .head{display:flex; align-items:center; gap:8px; font-weight:700; font-size:13px; color:oklch(30% 0.06 258);}
  body.dark .ai-analysis .head{color:oklch(85% 0.08 258);}
  .ai-analysis .cat{font-weight:600; font-size:15px; color:var(--text);}
  .ai-analysis .meta{display:flex; gap:8px; align-items:center; font-size:12px; color:oklch(40% 0.04 258);}
  body.dark .ai-analysis .meta{color:oklch(78% 0.06 258);}
  .dotsep{width:3px; height:3px; border-radius:999px; background:oklch(60% 0.03 258);}

  label.field-label{font-size:12.5px; font-weight:600; color:oklch(45% 0.02 250);}
  body.dark label.field-label{color:oklch(72% 0.01 250);}
  textarea, input[type=text], input[type=password], select{border:1px solid var(--border); border-radius:12px; padding:12px; font-family:'IBM Plex Sans',sans-serif; font-size:13.5px; box-sizing:border-box; width:100%; background:var(--card-bg); color:var(--text);}
  textarea{resize:none; min-height:80px;}
  select{cursor:pointer;}

  .btn-primary{background:var(--primary); color:#fff; border:none; border-radius:12px; padding:13px; font-weight:600; font-size:14px; cursor:pointer; width:100%;}
  .btn-primary:hover{background:var(--primary-dark);}
  .btn-primary:disabled{opacity:0.45; cursor:not-allowed;}

  .success-card{background:var(--card-bg); border:1px solid var(--border); border-radius:18px; padding:22px; display:flex; flex-direction:column; align-items:center; gap:10px; text-align:center;}
  .success-badge{width:44px; height:44px; border-radius:999px; background:var(--success-bg); display:flex; align-items:center; justify-content:center;}
  .success-card h3{font-weight:700; font-size:16px; color:var(--text);}
  .success-card p{font-size:13.5px; color:oklch(50% 0.02 250);}
  .btn-secondary-small{margin-top:6px; background:var(--primary); color:#fff; border:none; border-radius:12px; padding:10px 18px; font-weight:600; font-size:13.5px; cursor:pointer;}

  .list-label{font-size:12.5px; font-weight:600; color:var(--muted); text-transform:uppercase; letter-spacing:0.4px;}
  .list-row{display:flex; justify-content:space-between; align-items:center; background:var(--card-bg); border:1px solid var(--border); border-radius:12px; padding:11px 14px;}
  .list-row .t{font-size:13.5px; font-weight:600; color:var(--text);}
  .list-row .s{font-size:11.5px; color:var(--caption);}

  .doc-info{display:flex; align-items:center; gap:12px;}

  .divider{height:1px; background:var(--border);}

  .nk-highlight{background:var(--primary-tint); border-radius:16px; padding:16px 18px; display:flex; flex-direction:column; gap:8px;}
  .nk-highlight .lbl{font-weight:600; font-size:14px; color:var(--text);}
  .nk-highlight .sub{font-size:13px; color:oklch(40% 0.04 258);}
  body.dark .nk-highlight .sub{color:oklch(80% 0.06 258);}
  .nk-highlight .amt{font-family:'Manrope',sans-serif; font-weight:700; font-size:22px; color:oklch(30% 0.09 258);}
  body.dark .nk-highlight .amt{color:oklch(85% 0.1 258);}
  .nk-highlight .note{font-size:12px; color:oklch(45% 0.03 258);}
  body.dark .nk-highlight .note{color:oklch(75% 0.05 258);}

  .chat-col{display:flex; flex-direction:column; height:100%; gap:10px;}
  .chat-list{flex:1; display:flex; flex-direction:column; gap:10px; overflow:auto; padding:2px 2px 8px;}
  .chat-wrap{display:flex;}
  .chat-wrap.user{justify-content:flex-end;}
  .chat-wrap.ai{justify-content:flex-start;}
  .bubble{max-width:78%; padding:11px 14px; border-radius:16px; font-size:13.5px; line-height:1.45;}
  .bubble.user{background:var(--primary); color:#fff;}
  .bubble.ai{background:var(--card-bg); color:var(--text); border:1px solid var(--border);}
  .quick-replies{display:flex; gap:6px; overflow-x:auto; padding-bottom:2px;}
  .qr-chip{flex-shrink:0; background:var(--primary-tint); border:none; border-radius:999px; padding:8px 14px; font-size:12px; font-weight:600; color:oklch(30% 0.06 258); cursor:pointer;}
  body.dark .qr-chip{color:oklch(85% 0.08 258);}
  .chat-input-row{display:flex; gap:8px; align-items:center; padding-bottom:6px;}
  .chat-input-row input{flex:1; border-radius:999px; padding:11px 16px;}
  .send-btn{width:40px; height:40px; border-radius:999px; background:var(--primary); border:none; display:flex; align-items:center; justify-content:center; cursor:pointer; flex-shrink:0;}

  .tabbar{display:flex; border-top:1px solid var(--border); background:var(--card-bg); padding:10px 4px 20px;}
  .tab-btn{flex:1; display:flex; flex-direction:column; align-items:center; gap:4px; background:none; border:none; cursor:pointer;}
  .tab-btn span{font-size:9.5px; font-weight:600;}

  /* ---------- Desktop dashboard ---------- */
  .dashboard{display:flex; width:1320px; max-width:100%; height:820px; background:var(--card-bg); border-radius:22px; overflow:hidden; box-shadow:0 24px 70px rgba(20,30,60,0.14); border:1px solid var(--border); position:relative;}
  .sidebar{width:230px; flex-shrink:0; background:var(--sidebar); display:flex; flex-direction:column; padding:22px 14px; box-sizing:border-box;}
  .sidebar-brand{display:flex; align-items:center; gap:10px; padding:6px 8px 22px;}
  .sidebar-logo{width:32px; height:32px; border-radius:9px; background:#fff; display:flex; align-items:center; justify-content:center; flex-shrink:0;}
  .sidebar-logo span{color:var(--primary); font-family:'Manrope',sans-serif; font-weight:800; font-size:15px;}
  .sidebar-brand b{color:#fff; font-family:'Manrope',sans-serif; font-weight:700; font-size:15px;}
  .nav-col{display:flex; flex-direction:column; gap:2px; overflow-y:auto; padding-right:2px;}
  .nav-col::-webkit-scrollbar{width:4px;}
  .nav-col::-webkit-scrollbar-thumb{background:rgba(255,255,255,0.14); border-radius:4px;}
  .nav-btn{display:flex; align-items:center; gap:9px; padding:8px 11px; border-radius:9px; border:none; cursor:pointer; font-size:12.5px; font-weight:500; background:transparent; color:var(--nav-inactive); text-align:left; width:100%;}
  .nav-group{display:flex; flex-direction:column; gap:2px; margin-top:8px;}
  .nav-group:first-child{margin-top:0;}
  .nav-group-head{display:flex; align-items:center; justify-content:space-between; gap:6px; padding:5px 11px 4px; background:transparent; border:none; cursor:pointer; width:100%; text-align:left;
    font-family:'Manrope',sans-serif; font-size:9.5px; font-weight:700; letter-spacing:0.09em; text-transform:uppercase; color:rgba(255,255,255,0.38);}
  .nav-group-head:hover{color:rgba(255,255,255,0.62);}
  .nav-group-head .chev{transition:transform .18s ease; flex-shrink:0;}
  .nav-group-head.collapsed .chev{transform:rotate(-90deg);}
  .nav-group-head .badge{background:rgba(255,255,255,0.12); color:rgba(255,255,255,0.7); border-radius:999px; padding:1px 6px; font-size:9px; letter-spacing:0;}
  .nav-sub{display:flex; flex-direction:column; gap:2px;}
  .nav-sub .nav-btn{padding-left:14px;}
  .nav-btn.active{background:var(--primary); color:#fff; font-weight:600;}
  .sidebar-spacer{flex:1;}
  .sidebar-user{display:flex; align-items:center; gap:10px; padding:10px 8px; border-top:1px solid rgba(255,255,255,0.1); cursor:pointer; border-radius:10px;}
  .sidebar-user:hover{background:rgba(255,255,255,0.05);}
  .sidebar-user.active{background:rgba(255,255,255,0.1);}

  .back-link{display:flex; align-items:center; gap:6px; background:none; border:none; cursor:pointer; color:var(--primary); font-weight:600; font-size:13px; padding:2px 0; width:fit-content;}
  .profile-avatar{width:52px; height:52px; border-radius:999px; background:var(--primary); color:#fff; display:flex; align-items:center; justify-content:center; font-family:'Manrope',sans-serif; font-weight:700; font-size:18px; flex-shrink:0;}
  .avatar-sm{width:32px; height:32px; border-radius:999px; overflow:hidden; flex-shrink:0; background:var(--primary); color:#fff; display:flex; align-items:center; justify-content:center; font-size:12px; font-weight:700; font-family:'Manrope',sans-serif;}
  .avatar-sm img{width:100%; height:100%; object-fit:cover; display:block;}
  .portal-note{background:var(--primary-soft); color:var(--primary); border-radius:12px; padding:12px 16px; font-size:12.5px; font-weight:600; margin-bottom:18px;}
  .report-row{display:flex; align-items:center; justify-content:space-between; gap:12px; background:var(--card-bg); border:1px solid var(--border); border-radius:12px; padding:12px 16px;}
  .viewas-banner{display:flex; align-items:center; justify-content:space-between; gap:14px; background:var(--warn-bg); color:var(--warn-text); border-radius:12px; padding:12px 18px; font-size:13px; font-weight:600; margin-bottom:20px;}
  .save-confirm{display:flex; align-items:center; gap:6px; color:var(--success-text); font-size:13px; font-weight:600; margin-top:10px;}
  .avatar{width:30px; height:30px; border-radius:999px; background:oklch(56% 0.13 152); display:flex; align-items:center; justify-content:center; flex-shrink:0;}
  .avatar span{color:#fff; font-size:12px; font-weight:700; font-family:'Manrope',sans-serif;}
  .sidebar-user .name{color:#fff; font-size:12.5px; font-weight:600;}
  .sidebar-user .role{color:rgba(255,255,255,0.5); font-size:11px;}

  .dash-main{flex:1; overflow:auto; padding:28px 34px; box-sizing:border-box; background:var(--page-bg);}
  .dash-col{display:flex; flex-direction:column; gap:20px;}
  .dash-title{font-family:'Manrope',sans-serif; font-weight:700; font-size:24px; color:var(--text);}
  .kpi-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:14px;}
  .kpi-card{background:var(--card-bg); border:1px solid var(--border); border-radius:14px; padding:16px;}
  .kpi-label{font-size:12.5px; color:var(--muted); font-weight:500;}
  .kpi-value{font-family:'Manrope',sans-serif; font-weight:700; font-size:22px; margin-top:6px; color:var(--text);}
  .kpi-caption{font-size:12px; margin-top:4px; font-weight:600;}
  .kpi-caption.warn{color:oklch(50% 0.13 45);}
  .kpi-caption.good{color:oklch(45% 0.1 152);}
  .kpi-caption.neutral{color:oklch(50% 0.02 250);}

  .ai-summary{background:var(--primary-tint); border-radius:16px; padding:20px 22px; display:flex; flex-direction:column; gap:10px;}
  .ai-summary .head{display:flex; align-items:center; gap:8px;}
  .ai-summary .head b{font-weight:700; font-size:14px; color:oklch(28% 0.07 258);}
  body.dark .ai-summary .head b{color:oklch(88% 0.08 258);}
  .ai-summary .body{font-size:13.5px; color:oklch(32% 0.06 258); line-height:1.6;}
  body.dark .ai-summary .body{color:oklch(82% 0.06 258);}

  .ticket-row-simple{display:flex; justify-content:space-between; align-items:center; background:var(--card-bg); border:1px solid var(--border); border-radius:12px; padding:12px 16px;}
  .ticket-row-simple .title{font-size:13.5px; font-weight:600; color:var(--text);}
  .ticket-row-simple .meta{font-size:12px; color:var(--caption); margin-top:2px;}

  .filter-bar{display:flex; gap:10px; flex-wrap:wrap;}
  .filter-bar input[type=text]{flex:1; min-width:180px;}
  .filter-bar select{width:auto; min-width:150px;}

  .grid-row{display:grid; align-items:center; gap:10px; background:var(--card-bg); border:1px solid var(--border); border-radius:12px; padding:13px 16px;}
  .grid-tickets{grid-template-columns:1.2fr 0.9fr 1.3fr 0.8fr 0.85fr 2fr;}
  .grid-rent{grid-template-columns:1.3fr 1.3fr 0.9fr 1fr 1.1fr;}
  .grid-head{display:grid; gap:12px; padding:4px 16px; font-family:'Manrope',sans-serif; font-size:10.5px; font-weight:700; letter-spacing:0.07em; text-transform:uppercase; color:var(--muted);}
  .grid-invoices{grid-template-columns:1.1fr 1.6fr 1fr 0.9fr 0.85fr 1fr;}
  .grid-ledger{grid-template-columns:0.75fr 1fr 1.7fr 0.85fr 0.9fr;}
  .grid-accounts{grid-template-columns:1.2fr 1.3fr 0.9fr 0.9fr 0.9fr;}
  .amt-pos{color:oklch(50% 0.15 25); font-weight:700;}
  .amt-neg{color:var(--success-text); font-weight:700;}
  body.dark .amt-pos{color:oklch(75% 0.13 25);}
  .grid-units{grid-template-columns:1fr 1.2fr 0.8fr 1fr;}
  .cell-strong{font-size:13px; font-weight:600; color:var(--text);}
  .cell-muted{font-size:13px; color:oklch(40% 0.02 250);}
  body.dark .cell-muted{color:oklch(65% 0.01 250);}
  .assign-btn{justify-self:start; background:var(--primary-tint); border:none; border-radius:8px; padding:7px 12px; font-size:12px; font-weight:600; color:oklch(30% 0.06 258); cursor:pointer;}
  body.dark .assign-btn{color:oklch(85% 0.08 258);}
  .assign-btn:hover{filter:brightness(0.95);}
  .assign-btn.assigned{background:var(--success-bg); color:var(--success-text);}
  .edit-btn{background:transparent; border:1px solid var(--border); border-radius:8px; padding:7px 12px; font-size:12px; font-weight:600; color:var(--muted); cursor:pointer; white-space:nowrap;}
  .edit-btn:hover{background:var(--page-bg);}

  .overdue-banner{background:var(--warn-bg); border-radius:14px; padding:16px 20px; display:flex; justify-content:space-between; align-items:center;}
  .overdue-banner span:first-child{font-weight:600; font-size:14px; color:oklch(38% 0.13 45);}
  .overdue-banner span:last-child{font-family:'Manrope',sans-serif; font-weight:700; font-size:20px; color:oklch(38% 0.13 45);}
  body.dark .overdue-banner span{color:oklch(88% 0.1 45) !important;}

  .comm-layout{display:flex; gap:16px; flex:1; min-height:0;}
  .thread-list{width:250px; flex-shrink:0; display:flex; flex-direction:column; gap:8px; overflow:auto;}
  .thread-btn{text-align:left; border:1px solid var(--border); background:var(--card-bg); border-radius:12px; padding:12px 14px; cursor:pointer;}
  .thread-btn.active{border-color:var(--primary); background:var(--primary-tint);}
  .thread-btn .name{font-size:13px; font-weight:600; color:var(--text);}
  .thread-btn .last{font-size:12px; color:var(--caption); margin-top:3px;}
  .thread-panel{flex:1; background:var(--card-bg); border:1px solid var(--border); border-radius:14px; padding:20px; display:flex; flex-direction:column; gap:14px; overflow:auto;}
  .thread-panel .thread-name{font-weight:700; font-size:15px; color:var(--text);}
  .thread-msg{background:var(--page-bg); border-radius:12px; padding:14px 16px; font-size:13.5px; color:var(--text); align-self:flex-start; max-width:80%;}
  .draft-head{display:flex; align-items:center; gap:8px; margin-top:6px;}
  .draft-head span{font-size:12.5px; font-weight:600; color:oklch(38% 0.1 258);}
  body.dark .draft-head span{color:oklch(85% 0.08 258);}
  .draft-box{background:var(--primary-tint); border-radius:12px; padding:14px 16px; font-size:13.5px; color:oklch(30% 0.06 258); line-height:1.5;}
  body.dark .draft-box{color:oklch(88% 0.06 258);}
  .btn-send-draft{align-self:flex-start; background:var(--primary); color:#fff; border:none; border-radius:10px; padding:11px 18px; font-weight:600; font-size:13.5px; cursor:pointer;}
  .draft-sent{font-size:13px; font-weight:600; color:var(--success-text);}

  /* ---------- Objekte ---------- */
  .property-card{background:var(--card-bg); border:1px solid var(--border); border-radius:16px; padding:18px 20px; display:flex; flex-direction:column; gap:10px;}
  .property-head{display:flex; justify-content:space-between; align-items:center;}
  .property-name{font-family:'Manrope',sans-serif; font-weight:700; font-size:16px; color:var(--text);}
  .occ-badge{font-family:'Manrope',sans-serif; font-weight:700; font-size:14px; color:var(--primary); background:var(--primary-tint); padding:5px 12px; border-radius:999px;}
  .occ-bar{height:6px; border-radius:999px; background:var(--border); overflow:hidden;}
  .occ-bar-fill{height:100%; background:var(--primary); border-radius:999px;}
  .vacant-note{background:var(--warn-bg); color:var(--warn-text); font-size:12.5px; font-weight:600; padding:8px 12px; border-radius:10px; margin-top:4px;}
  .link-btn{background:none; border:none; padding:0; font-family:inherit; font-size:11.5px; font-weight:600; color:var(--primary); cursor:pointer;}
  .link-btn:hover{text-decoration:underline;}
  .search-trigger{display:flex; align-items:center; gap:8px; width:100%; margin:0 0 10px; padding:8px 10px; border-radius:9px; border:1px solid rgba(255,255,255,0.14); background:rgba(255,255,255,0.06); color:rgba(255,255,255,0.7); font-size:12px; cursor:pointer; font-family:inherit;}
  .search-trigger:hover{background:rgba(255,255,255,0.11); color:#fff;}
  .search-trigger kbd{font-family:inherit; font-size:10px; padding:2px 5px; border-radius:5px; border:1px solid rgba(255,255,255,0.25); color:rgba(255,255,255,0.7);}
  .search-card{width:720px; max-width:96vw; background:var(--card-bg); border:1px solid var(--border); border-radius:16px; box-shadow:0 24px 70px rgba(20,30,60,0.28); overflow:hidden; display:flex; flex-direction:column; max-height:78vh;}
  .search-input-row{display:flex; align-items:center; gap:10px; padding:14px 16px; border-bottom:1px solid var(--border); color:var(--muted);}
  .search-input-row input{flex:1; border:none; outline:none; background:transparent; font-size:15px; color:var(--text); font-family:inherit; padding:0; box-shadow:none;}
  .search-results{overflow-y:auto; padding:8px;}
  .search-group{font-size:10.5px; letter-spacing:0.08em; text-transform:uppercase; color:var(--muted); font-weight:700; padding:10px 10px 4px;}
  .search-result{display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%; text-align:left; padding:9px 10px; border-radius:10px; border:none; background:transparent; cursor:pointer; font-family:inherit;}
  .search-result:hover, .search-result.active{background:var(--primary-tint);}
  .search-result .t{font-size:13.5px; font-weight:600; color:var(--text);}
  .search-result .s{font-size:12px; color:var(--caption); margin-top:1px;}
  .search-empty{padding:18px 14px; color:var(--text); font-size:13px;}
  .progress-bar{width:100%; height:8px; background:var(--surface-2, oklch(93% 0.01 250)); border-radius:99px; overflow:hidden;}
  .progress-fill{height:100%; background:var(--primary, oklch(45% 0.15 255)); border-radius:99px; transition:width .3s;}

  .unit-row{background:var(--card-bg); border:1px solid var(--border); border-radius:12px; padding:12px 16px; display:flex; flex-direction:column; gap:8px;}

  .prop-image{width:100%; height:150px; object-fit:cover; border-radius:12px; display:block; background:var(--page-bg);}
  .prop-image-ph{width:100%; height:150px; border-radius:12px; background:var(--page-bg); border:1px dashed var(--border); display:flex; align-items:center; justify-content:center; gap:8px; color:var(--muted); font-size:12.5px; font-weight:600;}
  .detail-image{width:100%; height:190px; object-fit:cover; border-radius:12px; display:block;}
  .unit-thumb{width:52px; height:52px; border-radius:9px; object-fit:cover; display:block; flex-shrink:0;}
  .unit-thumb-ph{width:52px; height:52px; border-radius:9px; background:var(--page-bg); border:1px dashed var(--border); display:flex; align-items:center; justify-content:center; flex-shrink:0;}
  .unit-modal-preview{width:100%; height:130px; object-fit:cover; border-radius:10px; display:block;}
  .unit-row-top{display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap;}
  .unit-row-title{display:flex; align-items:center; gap:8px; flex-wrap:wrap;}
  .unit-name{font-weight:700; font-size:13.5px; color:var(--text);}
  .unit-row-mid{display:flex; align-items:center; gap:12px; font-size:12.5px; flex-wrap:wrap;}
  .unit-tags{display:flex; gap:6px; flex-wrap:wrap;}
  .tag{background:var(--page-bg); border:1px solid var(--border); border-radius:999px; padding:3px 10px; font-size:11px; color:var(--muted); font-weight:600;}
  .card-footer-btn{margin-top:8px; background:var(--primary-tint); border:none; border-radius:10px; padding:10px 14px; font-size:12.5px; font-weight:600; color:oklch(30% 0.06 258); cursor:pointer; width:fit-content;}
  body.dark .card-footer-btn{color:oklch(85% 0.08 258);}
  .card-footer-btn:hover{filter:brightness(0.95);}

  .stat-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:10px;}
  .add-form{display:flex; gap:8px; flex-wrap:wrap; align-items:center;}
  .add-form input[type=text]{flex:1; min-width:160px;}
  .btn-small{background:var(--primary); color:#fff; border:none; border-radius:10px; padding:10px 16px; font-weight:600; font-size:13px; cursor:pointer; white-space:nowrap;}
  .btn-small:hover{background:var(--primary-dark);}
  .btn-outline{background:transparent; color:var(--primary); border:1px solid var(--primary); border-radius:10px; padding:9px 15px; font-weight:600; font-size:13px; cursor:pointer; white-space:nowrap;}
  .btn-outline:hover{background:var(--primary-tint);}
  .btn-ghost-danger{background:none; border:none; color:oklch(50% 0.15 25); font-size:12px; font-weight:600; cursor:pointer; padding:6px 8px;}
  body.dark .btn-ghost-danger{color:oklch(75% 0.13 25);}
  .check-row{display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text); cursor:pointer;}
  input[type=checkbox]{width:16px; height:16px; accent-color:var(--primary); cursor:pointer;}

  /* ---------- Termine ---------- */
  .calendar-group{display:flex; flex-direction:column; gap:8px;}
  .event-row{display:flex; align-items:center; justify-content:space-between; gap:12px; background:var(--card-bg); border:1px solid var(--border); border-radius:12px; padding:12px 16px;}
  .event-icon{width:32px; height:32px; border-radius:999px; background:var(--primary-tint); display:flex; align-items:center; justify-content:center; flex-shrink:0;}
  .event-info .t{font-size:13.5px; font-weight:600; color:var(--text);}
  .event-info .s{font-size:12px; color:var(--caption); margin-top:2px;}

  /* ---------- Modal ---------- */
  .modal-overlay{position:fixed; inset:0; background:rgba(15,20,35,0.45); display:flex; align-items:center; justify-content:center; z-index:100; padding:20px;}
  .modal-card{background:var(--card-bg); border-radius:18px; padding:24px; width:400px; max-width:100%; display:flex; flex-direction:column; gap:12px; box-shadow:0 24px 70px rgba(20,30,60,0.3);}
  .modal-title{font-family:'Manrope',sans-serif; font-weight:700; font-size:17px; color:var(--text);}
  .modal-actions{display:flex; justify-content:flex-end; gap:10px; margin-top:6px;}
  .btn-cancel{background:transparent; border:1px solid var(--border); border-radius:10px; padding:11px 18px; font-weight:600; font-size:13.5px; cursor:pointer; color:var(--muted);}
  .handwerker-row{display:flex; justify-content:space-between; align-items:center; text-align:left; border:1px solid var(--border); background:var(--page-bg); border-radius:12px; padding:12px 14px; cursor:pointer; width:100%;}
  .handwerker-row.selected{border-color:var(--primary); background:var(--primary-tint);}
  .handwerker-row .t{font-size:13px; font-weight:600; color:var(--text);}
  .handwerker-row .s{font-size:11.5px; color:var(--caption); margin-top:2px;}

  @media (max-width: 1380px){
    .dashboard{transform:scale(0.72); transform-origin:top center; margin-bottom:-220px;}
  }
  @media (max-width: 980px){
    .dashboard{transform:scale(0.5); margin-bottom:-410px;}
  }

  /* ---- Ergänzungen der Web-App (Speicherstatus, Hinweise) ---- */
  .sync-status{font-size:11px; color:var(--caption); margin-left:6px; padding:2px 8px; border-radius:999px; background:transparent; transition:opacity .2s;}
  .sync-status.saving{color:var(--primary); background:var(--primary-tint);}
  .sync-status.saved{color:var(--success-text); background:var(--success-bg);}
  .sync-status.error, .sync-status.offline{color:var(--warn-text); background:var(--warn-bg);}
  .sync-status:empty{display:none;}
  .toast{position:fixed; left:50%; bottom:24px; transform:translateX(-50%); z-index:9999; max-width:min(560px, 92vw); padding:11px 16px; border-radius:12px; font-size:13px; line-height:1.5; box-shadow:0 10px 30px rgba(0,0,0,.18); background:oklch(24% 0.02 250); color:#fff;}
  .toast.error{background:oklch(42% 0.13 25);}
  .toast.ok{background:oklch(38% 0.1 152);}
  .toast[hidden]{display:none;}
  .login-hint{margin-top:12px; font-size:11.5px; color:var(--caption); line-height:1.5;}
