/* Registre — Clients & Devis : feuille de style
   Palette : bleu marine, gris, rouge, bleu ciel. */

:root{
    --ink:#0F2A4E;
    --ink-2:#1D3E68;
    --paper:#F7F8FA;
    --paper-dim:#EBEEF2;
    --line:#D7DCE3;
    --line-strong:#B7C0CB;
    --brass:#2F7DC1;
    --brass-dark:#1F5F98;
    --brass-tint:#E1EFFA;
    --green:#2F7DC1;
    --green-tint:#E1EFFA;
    --red:#C0392B;
    --red-tint:#FBE7E4;
    --slate:#5B6472;
    --text:#1A2233;
    --shadow: 0 1px 2px rgba(15,42,78,.07), 0 8px 24px rgba(15,42,78,.08);
    --radius: 3px;
  }
  *{box-sizing:border-box;}
  html,body{margin:0;padding:0;}
  body{
    background:var(--paper-dim);
    color:var(--text);
    font-family:'IBM Plex Sans', sans-serif;
    -webkit-font-smoothing:antialiased;
  }
  #app{display:flex; min-height:100vh;}

  /* ---------- Sidebar ---------- */
  .sidebar{
    width:236px;
    flex-shrink:0;
    background:var(--ink);
    color:#E7EAF0;
    display:flex;
    flex-direction:column;
    padding:28px 0 18px;
  }
  .brand{
    padding:0 22px 22px;
    border-bottom:1px solid rgba(231,234,240,.14);
    margin-bottom:18px;
  }
  .brand .mark{
    font-family:'Fraunces', serif;
    font-size:15px;
    letter-spacing:.14em;
    text-transform:uppercase;
    color:var(--brass);
    font-weight:600;
  }
  .brand h1{
    font-family:'Fraunces', serif;
    font-weight:600;
    font-size:22px;
    margin:6px 0 2px;
    line-height:1.15;
  }
  .brand .sub{
    font-size:11.5px;
    color:#B7BFCC;
    letter-spacing:.03em;
  }
  .brand .logo-wrap{
    display:flex; align-items:center; gap:10px; margin-bottom:10px;
  }
  .brand .logo-wrap img{
    width:34px; height:34px; object-fit:contain; border-radius:4px; background:#fff; padding:2px;
  }
  .lang-select{
    all:unset; cursor:pointer; margin-top:14px; width:100%;
    border:1px solid rgba(231,234,240,.22); border-radius:var(--radius);
    padding:7px 10px; font-size:12px; color:#CDD3DE; background:rgba(255,255,255,.03);
  }
  .lang-select option{ color:#111; }
  .logo-upload-row{display:flex; align-items:center; gap:14px; margin-bottom:14px;}
  .logo-preview{
    width:64px; height:64px; border-radius:var(--radius); border:1px solid var(--line-strong);
    display:flex; align-items:center; justify-content:center; background:#fff; overflow:hidden; flex-shrink:0;
  }
  .logo-preview img{max-width:100%; max-height:100%; object-fit:contain;}
  .logo-preview .placeholder{font-size:10px; color:var(--slate); text-align:center;}
  .sheet-top .from img.doc-logo{
    max-width:120px; max-height:64px; object-fit:contain; margin-bottom:10px;
  }
  nav{display:flex; flex-direction:column; gap:2px; padding:0 12px;}
  nav button{
    all:unset;
    cursor:pointer;
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 12px;
    border-radius:var(--radius);
    font-size:13.5px;
    color:#CDD3DE;
    letter-spacing:.01em;
  }
  nav button .num{
    font-family:'IBM Plex Mono', monospace;
    font-size:11px;
    color:#7C879C;
    width:16px;
  }
  nav button:hover{ background:rgba(255,255,255,.07); color:#fff;}
  nav button.active{ background:rgba(47,125,193,.22); color:#fff;}
  nav button.active .num{ color:var(--brass);}
  .sidebar-foot{
    margin-top:auto;
    padding:16px 22px 0;
    border-top:1px solid rgba(231,234,240,.14);
    font-size:11px;
    color:#7C879C;
    line-height:1.6;
  }
  .sidebar-foot b{color:#B7BFCC; font-weight:600;}

  .nav-icon{ display:inline-flex; width:16px; height:16px; flex-shrink:0; }
  .nav-icon svg{ width:100%; height:100%; }

  /* ---------- Content area + Topbar ---------- */
  .content-area{ flex:1; display:flex; flex-direction:column; min-width:0; }

  .topbar{
    display:flex; align-items:center; justify-content:space-between;
    padding:8px 40px; border-bottom:1px solid var(--line); background:var(--paper);
    position:sticky; top:0; z-index:10; min-height:44px;
  }
  .topbar-left{ display:flex; align-items:center; }
  .topbar-right{ display:flex; align-items:center; gap:18px; margin-left:auto; }
  .topbar-icon-btn{
    all:unset; cursor:pointer; position:relative;
    width:34px; height:34px; display:flex; align-items:center; justify-content:center;
    border-radius:50%; color:var(--slate);
  }
  .topbar-icon-btn:hover{ background:var(--paper-dim); color:var(--ink); }
  .topbar-icon-btn svg{ width:18px; height:18px; }
  .topbar-notif-wrap{ position:relative; }
  .topbar-notif-dot{
    position:absolute; top:2px; right:2px; min-width:15px; height:15px; padding:0 3px;
    border-radius:50%; background:var(--red); color:#fff; font-size:9.5px; font-weight:700;
    display:flex; align-items:center; justify-content:center; line-height:1;
  }
  .topbar-notif-panel{
    position:absolute; top:44px; right:0; width:280px; background:var(--paper);
    border:1px solid var(--line); border-radius:var(--radius); box-shadow:var(--shadow);
    overflow:hidden; z-index:20;
  }
  .topbar-notif-panel-title{
    font-family:'Fraunces', serif; font-weight:600; font-size:13.5px; color:var(--ink);
    padding:12px 16px; border-bottom:1px solid var(--line);
  }
  .topbar-notif-empty{ padding:20px 16px; font-size:12.5px; color:var(--slate); text-align:center; }
  .topbar-notif-item{
    all:unset; display:block; width:100%; box-sizing:border-box; cursor:pointer;
    padding:11px 16px; font-size:12.5px; color:var(--text); border-bottom:1px solid var(--line);
  }
  .topbar-notif-item:last-child{ border-bottom:none; }
  .topbar-notif-item:hover{ background:var(--paper-dim); }
  .topbar-notif-item.topbar-notif-warn{ color:var(--red); }
  .topbar-notif-item.topbar-notif-info{ color:var(--brass-dark); }
  .topbar-lang-wrap{
    display:flex; align-items:center;
    border:1px solid var(--line); border-radius:20px; background:var(--paper-dim);
    padding:5px 12px 5px 10px; transition:border-color .12s ease;
  }
  .topbar-lang-wrap:focus-within{ border-color:var(--brass); }
  .topbar-lang-select{
    all:unset; cursor:pointer; font-size:12.5px; color:var(--text); line-height:1;
  }
  .topbar-lang-select option{ font-size:14px; }
  .topbar-user{ display:flex; align-items:center; gap:10px; padding-left:14px; border-left:1px solid var(--line); }
  .topbar-username{ font-size:12.5px; color:var(--slate); }

  /* ---------- Main ---------- */
  main{flex:1; padding:34px 40px 60px; max-width:1180px;}
  .page-head{
    display:flex; justify-content:space-between; align-items:flex-end;
    margin-bottom:26px; gap:16px; flex-wrap:wrap;
  }
  .page-head .eyebrow{
    font-family:'IBM Plex Mono', monospace;
    font-size:11px; letter-spacing:.12em; text-transform:uppercase;
    color:var(--brass-dark); margin-bottom:4px;
  }
  .page-head h2{
    font-family:'Fraunces', serif; font-weight:600; font-size:30px; margin:0;
    color:var(--ink);
  }
  .page-head p{margin:6px 0 0; color:var(--slate); font-size:13.5px;}

  .btn{
    all:unset; cursor:pointer;
    display:inline-flex; align-items:center; gap:8px;
    padding:10px 18px; border-radius:var(--radius);
    font-size:13px; font-weight:600; letter-spacing:.01em;
    transition:transform .08s ease;
  }
  .btn:active{ transform: translateY(1px); }
  .btn-primary{ background:var(--brass); color:#fff; }
  .btn-primary:hover{ background:var(--brass-dark); }
  .btn-ghost{ background:transparent; color:var(--ink); border:1px solid var(--line-strong); }
  .btn-ghost:hover{ background:var(--paper); }
  .btn-danger{ background:transparent; color:var(--red); }
  .btn-danger:hover{ background:var(--red-tint); }
  .btn-sm{ padding:6px 12px; font-size:12px; }

  /* ---------- Dashboard ---------- */
  .stat-row{display:grid; grid-template-columns:repeat(4,1fr); gap:14px; margin-bottom:34px;}
  .stat-card{
    background:var(--paper); border:1px solid var(--line); border-radius:var(--radius);
    padding:16px 18px;
  }
  .stat-card .label{font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--slate);}
  .stat-card .value{
    font-family:'Fraunces', serif; font-size:28px; font-weight:600; color:var(--ink); margin-top:6px;
  }
  .stat-card .value.mono{font-family:'IBM Plex Mono', monospace; font-size:24px;}

  .panel{
    background:var(--paper); border:1px solid var(--line); border-radius:var(--radius);
    margin-bottom:24px;
  }
  .panel-head{
    padding:16px 20px; border-bottom:1px solid var(--line);
    display:flex; justify-content:space-between; align-items:center;
  }
  .panel-head h3{
    font-family:'Fraunces', serif; font-size:17px; margin:0; font-weight:600; color:var(--ink);
  }

  /* ---------- Tables (ledger style) ---------- */
  table{width:100%; border-collapse:collapse;}
  thead th{
    text-align:left; font-size:11px; letter-spacing:.08em; text-transform:uppercase;
    color:var(--slate); font-weight:600; padding:10px 20px; border-bottom:1px solid var(--line-strong);
  }
  tbody td{
    padding:13px 20px; font-size:13.5px; border-bottom:1px solid var(--line);
    color:var(--text);
  }
  tbody tr:last-child td{border-bottom:none;}
  tbody tr:hover{background:rgba(47,125,193,.05);}
  td.mono, .mono{font-family:'IBM Plex Mono', monospace;}
  td.num{text-align:right; font-family:'IBM Plex Mono', monospace;}
  th.num{text-align:right;}
  .row-actions{display:flex; gap:6px; justify-content:flex-end; flex-wrap:wrap;}
  .icon-btn{
    all:unset; cursor:pointer; padding:5px 9px; border-radius:var(--radius);
    font-size:12px; color:var(--slate); border:1px solid transparent;
  }
  .icon-btn:hover{border-color:var(--line-strong); color:var(--ink); background:var(--paper-dim);}

  .empty{
    padding:48px 20px; text-align:center; color:var(--slate);
  }
  .empty .glyph{font-family:'Fraunces', serif; font-size:34px; color:var(--line-strong); margin-bottom:8px;}
  .empty p{font-size:13.5px; margin:4px 0 16px;}

  .badge{
    display:inline-flex; align-items:center; gap:5px;
    padding:3px 9px; border-radius:20px; font-size:11px; font-weight:600; letter-spacing:.02em;
  }
  .badge::before{content:''; width:6px; height:6px; border-radius:50%; background:currentColor;}
  .badge.brouillon{ background:var(--paper-dim); color:var(--slate);}
  .badge.envoye{ background:#E6EEF6; color:var(--ink-2);}
  .badge.accepte{ background:var(--green-tint); color:var(--green);}
  .badge.refuse{ background:var(--red-tint); color:var(--red);}
  .badge.expire{ background:var(--paper-dim); color:var(--slate);}
  .badge.envoyee{ background:#E6EEF6; color:var(--ink-2);}
  .badge.payee{ background:var(--green-tint); color:var(--green);}
  .badge.en_retard{ background:var(--red-tint); color:var(--red);}
  .badge.annulee{ background:var(--paper-dim); color:var(--slate);}

  .searchbar{
    display:flex; align-items:center; gap:8px;
    border:1px solid var(--line-strong); border-radius:var(--radius);
    padding:8px 12px; background:var(--paper); min-width:220px;
  }
  .searchbar input{
    all:unset; font-size:13px; flex:1; color:var(--text); font-family:'IBM Plex Sans',sans-serif;
  }
  .searchbar svg{flex-shrink:0; opacity:.5;}

  /* ---------- Modal / forms ---------- */
  .overlay{
    position:fixed; inset:0; background:rgba(16,35,63,.45);
    display:flex; align-items:flex-start; justify-content:center;
    padding:44px 20px; overflow-y:auto; z-index:50;
  }
  .modal{
    background:var(--paper); border-radius:var(--radius); width:100%; max-width:640px;
    box-shadow:var(--shadow); animation:rise .18s ease;
  }
  @keyframes rise{ from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:translateY(0);} }
  .modal.wide{max-width:820px;}
  .modal-head{
    padding:20px 26px; border-bottom:1px solid var(--line);
    display:flex; justify-content:space-between; align-items:center;
  }
  .modal-head h3{font-family:'Fraunces', serif; font-size:19px; margin:0; font-weight:600; color:var(--ink);}
  .modal-head .close{ all:unset; cursor:pointer; color:var(--slate); font-size:20px; padding:4px 8px;}
  .modal-head .close:hover{color:var(--ink);}
  .modal-body{padding:22px 26px; max-height:65vh; overflow-y:auto;}
  .modal-foot{
    padding:16px 26px; border-top:1px solid var(--line);
    display:flex; justify-content:flex-end; gap:10px;
  }

  .field-grid{display:grid; grid-template-columns:1fr 1fr; gap:14px 16px;}
  .field{display:flex; flex-direction:column; gap:6px; margin-bottom:14px;}
  .field.full{grid-column:1 / -1;}
  .field label{font-size:11.5px; letter-spacing:.04em; text-transform:uppercase; color:var(--slate); font-weight:600;}
  .field input, .field select, .field textarea{
    all:unset; border:1px solid var(--line-strong); border-radius:var(--radius);
    padding:9px 11px; font-size:13.5px; font-family:'IBM Plex Sans',sans-serif; color:var(--text);
    background:#fff;
  }
  .field input:focus, .field select:focus, .field textarea:focus{ border-color:var(--brass); }
  .field textarea{resize:vertical; min-height:60px;}
  .field .hint{font-size:11px; color:var(--slate);}
  .req::after{content:' *'; color:var(--red);}

  /* line items in devis form */
  .lines-table{width:100%; border-collapse:collapse; margin-top:6px;}
  .lines-table th{
    font-size:10.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--slate);
    text-align:left; padding:6px 8px; border-bottom:1px solid var(--line-strong);
  }
  .lines-table td{padding:6px 8px; vertical-align:top;}
  .lines-table input{
    all:unset; border:1px solid var(--line-strong); border-radius:var(--radius);
    padding:7px 9px; font-size:13px; width:100%; background:#fff;
  }
  .lines-table input:focus{border-color:var(--brass);}
  .lines-table .line-total{
    font-family:'IBM Plex Mono', monospace; font-size:13px; padding-top:9px; text-align:right; white-space:nowrap;
  }
  .add-line{margin-top:10px;}
  .totals-box{
    margin-top:16px; margin-left:auto; width:280px;
    border-top:1px solid var(--line-strong); padding-top:10px;
  }
  .totals-box .trow{display:flex; justify-content:space-between; font-size:13px; padding:5px 0; color:var(--slate);}
  .totals-box .trow.grand{
    font-family:'Fraunces', serif; font-size:19px; font-weight:600; color:var(--ink);
    border-top:1px solid var(--line-strong); margin-top:6px; padding-top:10px;
  }
  .totals-box .trow input{
    all:unset; width:60px; text-align:right; border-bottom:1px dotted var(--line-strong); font-family:'IBM Plex Mono',monospace;
  }

  /* ---------- Devis preview / print ---------- */
  .sheet{
    background:#fff; border:1px solid var(--line); box-shadow:var(--shadow);
    padding:44px 48px; max-width:760px; margin:0 auto;
  }
  .sheet-top{display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:30px;}
  .sheet-top .from h2{font-family:'Fraunces', serif; font-size:22px; margin:0 0 4px; color:var(--ink);}
  .sheet-top .from p{margin:0; font-size:12.5px; color:var(--slate); line-height:1.6;}
  .sheet-top .devis-id{text-align:right;}
  .devis-qr{
    display:inline-block; margin-top:8px; padding:8px; background:#fff; border:1px solid var(--line);
    border-radius:2px; width:92px; height:92px;
  }
  .devis-qr-fallback{
    display:inline-block; margin-top:8px; padding:10px 14px; background:#fff; border:1px solid var(--line);
    border-radius:2px; font-size:13px; color:var(--ink);
  }
  .doc-type-heading{
    font-family:'Fraunces', serif; font-weight:700; font-size:19px; color:#000000;
    text-transform:uppercase; letter-spacing:.04em; margin:26px 0 10px;
  }

  .checkbox-row{ display:flex; align-items:center; gap:9px; cursor:pointer; }
  .checkbox-row input{ width:16px; height:16px; accent-color:var(--brass); }
  .portfolio-saved-note{
    background:var(--green-tint); color:var(--green); border-radius:var(--radius);
    padding:9px 12px; font-size:12.5px; margin-bottom:16px;
  }
  .portfolio-items-grid{
    display:grid; grid-template-columns:repeat(auto-fill, minmax(220px,1fr)); gap:16px; padding:20px;
  }
  .portfolio-item-card{
    border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; background:var(--paper);
  }
  .portfolio-item-image{
    width:100%; height:130px; background:var(--paper-dim); display:flex; align-items:center; justify-content:center;
  }
  .portfolio-item-image img{ width:100%; height:100%; object-fit:cover; }
  .portfolio-item-noimage{ width:100%; height:100%; background:var(--paper-dim); }
  .portfolio-item-body{ padding:14px; }
  .portfolio-item-title{ font-family:'Fraunces', serif; font-weight:600; color:var(--ink); font-size:15px; margin-bottom:6px; }
  .portfolio-item-desc{ font-size:12.5px; color:var(--slate); line-height:1.5; margin-bottom:8px; }
  .portfolio-item-link{ font-size:12px; color:var(--brass-dark); word-break:break-all; }
  .sheet-meta{
    display:grid; grid-template-columns:1fr 1fr; gap:18px;
    padding:18px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); margin-bottom:24px;
  }
  .sheet-meta .k{font-size:10.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--slate);}
  .sheet-meta .v{font-size:13.5px; color:var(--text); margin-top:2px;}
  .sheet-meta .v.name{font-weight:600;}
  .sheet table.lines{width:100%; border-collapse:collapse; margin-bottom:8px;}
  .sheet table.lines th{
    text-align:left; font-size:10.5px; text-transform:uppercase; letter-spacing:.06em; color:var(--slate);
    padding:8px 4px; border-bottom:1.5px solid var(--ink);
  }
  .sheet table.lines td{padding:10px 4px; font-size:13.5px; border-bottom:1px solid var(--line);}
  .sheet table.lines td.num, .sheet table.lines th.num{text-align:right; font-family:'IBM Plex Mono', monospace;}
  .sheet .sheet-totals{margin-left:auto; width:260px; margin-top:14px;}
  .sheet .sheet-totals .trow{display:flex; justify-content:space-between; font-size:13px; padding:5px 0; color:var(--slate); font-family:'IBM Plex Mono', monospace;}
  .sheet .sheet-totals .trow.grand{
    font-family:'Fraunces', serif; font-size:20px; font-weight:600; color:var(--ink);
    border-top:1.5px solid var(--ink); margin-top:6px; padding-top:10px;
  }
  .sheet .notes{margin-top:28px; padding-top:16px; border-top:1px solid var(--line); font-size:12.5px; color:var(--slate); white-space:pre-wrap;}
  .preview-actions{display:flex; gap:10px; margin-bottom:20px; max-width:760px; margin-left:auto; margin-right:auto; justify-content:space-between;}

  @media print{
    .sidebar, .topbar, .page-head, .preview-actions, .no-print{display:none !important;}
    body, #app, main, .content-area{background:#fff; padding:0; margin:0;}
    main{padding:0 !important; max-width:none;}
    .sheet{box-shadow:none; border:none; max-width:none; padding:0;}
  }

  select#statutFilter, select.select-plain{
    all:unset; border:1px solid var(--line-strong); border-radius:var(--radius);
    padding:8px 12px; font-size:12.5px; color:var(--text); background:#fff;
  }

  ::placeholder{color:#A6ADB9;}

  .sidebar-foot{ display:flex; flex-direction:column; gap:10px; }
  .user-row{
    display:flex; align-items:center; justify-content:space-between; gap:8px;
    padding-top:10px; border-top:1px solid rgba(231,234,240,.14);
    font-size:12px; color:#B7BFCC;
  }
  .link-btn{
    all:unset; cursor:pointer; color:var(--brass); font-size:11.5px; text-decoration:underline;
  }
  .link-btn:hover{ color:#4A9AD9; }

  .login-screen{
    min-height:100vh; width:100%; display:flex; align-items:center; justify-content:center;
    background:var(--ink);
  }
  .login-card{
    background:var(--paper); border-radius:var(--radius); padding:38px 34px;
    width:100%; max-width:360px; box-shadow:var(--shadow);
  }
  .login-card h2{
    font-family:'Fraunces', serif; font-size:24px; font-weight:600; color:var(--ink); margin:0;
  }
  .login-card .field{ margin-bottom:16px; }
  .login-error{
    background:var(--red-tint); color:var(--red); border-radius:var(--radius);
    padding:9px 12px; font-size:12.5px; margin-bottom:16px;
  }
  .login-switch{
    margin-top:18px; padding-top:16px; border-top:1px solid var(--line);
    font-size:12.5px; color:var(--slate); text-align:center;
  }
  .login-switch .link-btn{ color:var(--brass-dark); font-weight:600; }
  .back-to-landing{
    display:inline-block; margin-bottom:14px; color:var(--slate); text-decoration:none;
  }
  .back-to-landing:hover{ color:var(--brass-dark); }

  /* ---------- Page d'accueil (plein écran) ---------- */
  .landing-page{ min-height:100vh; width:100%; background:var(--paper); }

  .landing-header{
    display:flex; align-items:center; justify-content:space-between;
    padding:18px 40px; background:var(--ink);
  }
  .landing-header-actions{ display:flex; align-items:center; gap:12px; }
  .landing-lang-select{
    width:auto; margin-top:0; padding:6px 10px;
  }

  .landing-hero{
    background:var(--ink); color:#fff; text-align:center;
    padding:90px 24px 130px;
  }
  .landing-hero h1{
    font-family:'Fraunces', serif; font-size:44px; font-weight:600; color:#fff;
    max-width:760px; margin:0 auto 18px; line-height:1.15;
  }
  .landing-tagline{
    font-size:16px; color:#C6CEDA; max-width:520px; margin:0 auto 36px; line-height:1.6;
  }
  .landing-actions{ display:flex; gap:14px; justify-content:center; flex-wrap:wrap; }
  .landing-actions .btn{ min-width:170px; }
  .landing-hero-ghost{ color:#fff; border-color:rgba(255,255,255,.35); background:transparent; }
  .landing-hero-ghost:hover{ background:rgba(255,255,255,.08); }
  .landing-multilingual-note{ margin-top:24px; margin-bottom:0; color:#8FA0B8; }
  .landing-hero-illustration{ max-width:380px; margin:44px auto 0; }
  .landing-hero-illustration svg{ width:100%; height:auto; display:block; }

  .landing-features-section{
    max-width:1000px; margin:-72px auto 90px; padding:0 24px;
    display:grid; grid-template-columns:repeat(3,1fr); gap:20px;
  }
  .landing-feature{
    background:var(--paper); border:1px solid var(--line); border-radius:var(--radius);
    padding:22px; box-shadow:var(--shadow);
  }
  .landing-feature-icon{
    width:38px; height:38px; border-radius:50%; background:var(--brass-tint); color:var(--brass-dark);
    display:flex; align-items:center; justify-content:center; margin-bottom:12px;
  }
  .landing-feature-icon svg{ width:19px; height:19px; }
  .landing-feature-title{
    font-family:'Fraunces', serif; font-weight:600; color:var(--ink); margin-bottom:8px; font-size:16px;
  }

  .landing-portfolios-section{ max-width:1100px; margin:0 auto; padding:0 24px 100px; }
  .landing-section-head{ text-align:center; margin-bottom:32px; }
  .landing-section-head h2{
    font-family:'Fraunces', serif; font-size:26px; font-weight:600; color:var(--ink); margin:0 0 8px;
  }
  .landing-portfolios-loading, .landing-portfolios-empty{
    text-align:center; color:var(--slate); padding:50px 20px;
    background:var(--paper-dim); border-radius:var(--radius); border:1px solid var(--line);
  }
  .landing-portfolios-empty .glyph{ font-family:'Fraunces', serif; font-size:32px; color:var(--line-strong); margin-bottom:8px; }
  .landing-portfolio-grid{
    display:grid; grid-template-columns:repeat(auto-fill, minmax(210px,1fr)); gap:18px;
  }
  .landing-portfolio-card{
    display:block; background:var(--paper); border:1px solid var(--line); border-radius:var(--radius);
    padding:26px 20px; text-align:center; text-decoration:none; color:inherit;
    transition:box-shadow .15s ease, transform .15s ease;
  }
  .landing-portfolio-card:hover{ box-shadow:var(--shadow); transform:translateY(-2px); }
  .landing-portfolio-logo{
    width:64px; height:64px; border-radius:50%; object-fit:cover; margin:0 auto 14px;
    background:#fff; border:1px solid var(--line); display:block;
  }
  .landing-portfolio-logo-placeholder{
    display:flex; align-items:center; justify-content:center;
    font-family:'Fraunces', serif; font-size:24px; font-weight:600; color:var(--brass);
    background:var(--brass-tint);
  }
  .landing-portfolio-title{
    font-family:'Fraunces', serif; font-weight:600; color:var(--ink); font-size:15px; margin-bottom:4px;
  }
  .landing-portfolio-tagline{ font-size:12px; color:var(--slate); line-height:1.5; }

  .landing-footer{
    text-align:center; padding:26px; font-size:12px; color:var(--slate);
    border-top:1px solid var(--line);
  }

  @media (max-width: 760px){
    .landing-header{ flex-direction:column; gap:12px; align-items:flex-start; }
    .landing-hero h1{ font-size:32px; }
    .landing-features-section{ grid-template-columns:1fr; margin-top:-40px; }
  }

  .db-connected-row{ display:flex; align-items:center; gap:12px; }
  .db-dot{ width:10px; height:10px; border-radius:50%; flex-shrink:0; }
  .db-dot-on{ background:var(--green); box-shadow:0 0 0 3px var(--green-tint); }
  .db-dot-off{ background:var(--line-strong); }
  .db-file-name{ font-family:'IBM Plex Mono', monospace; font-size:13.5px; color:var(--ink); }

  @media (max-width: 900px){
    #app{flex-direction:column;}
    .sidebar{width:100%; flex-direction:row; align-items:center; padding:14px 16px; gap:20px;}
    .brand{border:none; padding:0; margin:0;}
    .brand .sub{display:none;}
    nav{flex-direction:row; padding:0;}
    .sidebar-foot{display:none;}
    .topbar{padding:10px 16px;}
    .topbar-user .topbar-username{display:none;}
    main{padding:22px 16px 50px;}
    .stat-row{grid-template-columns:1fr 1fr;}
    .field-grid{grid-template-columns:1fr;}
  }
