:root{
  --navy: #0A1A47; --navy-deep: #071335; --navy-tint: #E9ECF5;
  --gold: #F2A81D; --gold-hover: #FFBB3D;
  --bg: #FFFFFF; --surface: #F5F6F8;
  --text: #10192E; --text-muted: #5B6472; --line: #E2E5EA;
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
  --danger: #C0293C; --success: #1A7A41;
}
*{box-sizing:border-box; margin:0; padding:0;}
body{background:var(--surface); color:var(--text); font-family:var(--font); line-height:1.5; -webkit-font-smoothing:antialiased;}
a{color:inherit;}
button{font-family:var(--font);}
:focus-visible{outline:2px solid var(--gold); outline-offset:2px;}

.login-page{
  min-height:100vh; display:flex; align-items:center; justify-content:center;
  background:linear-gradient(135deg, var(--navy) 0%, #142A6B 100%); padding:20px;
}
.login-card{
  background:#fff; border-radius:var(--radius); padding:40px 36px; width:100%; max-width:400px;
  box-shadow:0 24px 60px rgba(7,19,53,0.35);
}
.login-logo{display:flex; align-items:center; margin-bottom:28px;}
.login-logo img{height:40px; width:auto; display:block;}
.login-card h1{font-size:22px; color:var(--navy); margin-bottom:6px;}
.login-card .sub{color:var(--text-muted); font-size:13.5px; margin-bottom:26px;}
.field{margin-bottom:16px;}
.field label{display:block; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:0.03em; color:var(--text-muted); margin-bottom:6px;}
.field input{width:100%; border:1px solid var(--line); background:var(--surface); border-radius:4px; padding:12px 14px; font-size:14.5px; color:var(--text);}
.field input:focus{outline:none; border-color:var(--navy);}
.btn{display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:14.5px; padding:13px 22px; border-radius:var(--radius); border:1px solid transparent; cursor:pointer; transition:background .15s ease; width:100%;}
.btn-gold{background:var(--gold); color:var(--navy-deep);}
.btn-gold:hover{background:var(--gold-hover);}
.btn-outline{border-color:var(--line); background:#fff; color:var(--text);}
.btn-outline:hover{background:var(--surface);}
.alert{padding:12px 14px; border-radius:4px; font-size:13.5px; margin-bottom:16px; display:none;}
.alert.show{display:block;}
.alert-error{background:rgba(192,41,60,0.08); color:var(--danger); border:1px solid rgba(192,41,60,0.25);}
.alert-success{background:rgba(26,122,65,0.08); color:var(--success); border:1px solid rgba(26,122,65,0.25);}

body.admin-shell{display:flex; min-height:100vh;}
.admin-sidebar{
  width:230px; flex-shrink:0; background:var(--navy); display:flex; flex-direction:column;
  position:sticky; top:0; height:100vh; overflow-y:auto; transition:width 0.18s ease; z-index:30;
}
.admin-sidebar.collapsed{width:64px;}
.admin-sidebar-brand{
  display:flex; align-items:center; gap:10px; padding:20px 16px; color:#fff;
  font-weight:800; font-size:15px; white-space:nowrap; overflow:hidden; flex-shrink:0;
}
.admin-sidebar-brand .mark{width:30px; height:30px; border-radius:50%; border:2px solid #fff; display:flex; align-items:center; justify-content:center; flex-shrink:0;}
.admin-sidebar-brand .mark span{width:6px; height:6px; border-radius:50%; background:var(--gold);}
.admin-sidebar.collapsed .admin-sidebar-brand .brand-text{display:none;}

.admin-sidebar-nav{display:flex; flex-direction:column; gap:2px; padding:8px; flex:1;}
.admin-sidebar-nav a{
  display:flex; align-items:center; gap:10px; padding:11px 12px; border-radius:4px;
  color:rgba(255,255,255,0.75); font-size:13.5px; font-weight:600; white-space:nowrap; overflow:hidden;
}
.admin-sidebar-nav a:hover{background:rgba(255,255,255,0.08); color:#fff;}
.admin-sidebar-nav a.active{background:rgba(255,255,255,0.14); color:#fff;}
.admin-sidebar-nav a .nav-abbr{
  display:none; flex-shrink:0; width:26px; height:26px; border-radius:50%;
  background:rgba(255,255,255,0.12); align-items:center; justify-content:center; font-size:11px; font-weight:800;
}
.admin-sidebar.collapsed .admin-sidebar-nav a{justify-content:center;}
.admin-sidebar.collapsed .admin-sidebar-nav a .nav-abbr{display:flex;}
.admin-sidebar.collapsed .admin-sidebar-nav a .nav-label{display:none;}

.admin-sidebar-toggle{
  margin:8px; border:1px solid rgba(255,255,255,0.2); background:none; color:#fff;
  border-radius:4px; padding:10px; cursor:pointer; font-size:13px; flex-shrink:0;
}
.admin-sidebar-toggle:hover{background:rgba(255,255,255,0.08);}
.admin-sidebar.collapsed .admin-sidebar-toggle .toggle-icon{display:inline-block; transform:rotate(180deg);}

.admin-main{flex:1; min-width:0;}
.admin-topbar{
  background:#fff; border-bottom:1px solid var(--line); min-height:64px;
  display:flex; align-items:center; justify-content:flex-end; padding:12px 24px; gap:16px;
  position:sticky; top:0; z-index:20;
}
.admin-topbar .user{display:flex; align-items:center; gap:16px; color:var(--text); font-size:13.5px;}
.admin-topbar .user button{background:none; border:1px solid var(--line); color:var(--text); padding:8px 14px; border-radius:4px; cursor:pointer; font-size:13px;}
.admin-topbar .user button:hover{background:var(--surface);}

.back-to-top{
  position:fixed; right:24px; bottom:28px; z-index:70;
  width:48px; height:48px; border-radius:50%; border:none;
  background:var(--navy); color:#fff; font-size:20px;
  display:flex; align-items:center; justify-content:center;
  cursor:pointer; box-shadow:0 10px 24px rgba(10,26,71,0.28);
  opacity:0; visibility:hidden; transform:translateY(12px);
  transition:opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
}
.back-to-top.show{opacity:1; visibility:visible; transform:translateY(0);}
.back-to-top:hover, .back-to-top:focus-visible{background:var(--gold); color:var(--navy-deep);}
@media (max-width:560px){ .back-to-top{right:16px; bottom:16px; width:44px; height:44px;} }

.dash-wrap{max-width:1180px; margin:0 auto; padding:32px 24px 60px;}
.dash-header{display:flex; flex-wrap:wrap; justify-content:space-between; align-items:flex-end; gap:16px; margin-bottom:28px;}
.dash-header h1{font-size:26px; color:var(--navy);}
.dash-header p{color:var(--text-muted); font-size:14px; margin-top:4px;}

.stats-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(180px,1fr)); gap:16px; margin-bottom:32px;}
.stat-card{background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:20px;}
.stat-card .num{font-size:28px; font-weight:800; color:var(--navy);}
.stat-card .label{font-size:12.5px; color:var(--text-muted); text-transform:uppercase; letter-spacing:0.03em; margin-top:4px;}
.stat-card.accent .num{color:#C77E00;}

.toolbar{display:flex; flex-wrap:wrap; gap:12px; align-items:center; margin-bottom:18px; background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:14px 16px;}
.toolbar input[type="text"]{flex:1; min-width:200px; border:1px solid var(--line); border-radius:4px; padding:10px 12px; font-size:14px;}
.toolbar select{border:1px solid var(--line); border-radius:4px; padding:10px 12px; font-size:14px; background:#fff;}
.toolbar .btn{width:auto; padding:10px 18px;}

.bulk-bar{display:flex; flex-wrap:wrap; gap:12px; align-items:center; justify-content:space-between; background:var(--navy-tint); border:1px solid var(--line); border-radius:var(--radius); padding:12px 16px; margin-bottom:18px; font-size:13.5px; color:var(--navy); font-weight:600;}
.bulk-bar .bulk-actions{display:flex; flex-wrap:wrap; gap:10px;}
.bulk-bar .btn{width:auto; padding:8px 14px;}

.table-card{background:#fff; border:1px solid var(--line); border-radius:var(--radius); overflow-x:auto;}
table.requests{width:100%; border-collapse:collapse; font-size:13.5px;}
table.requests th{
  text-align:left; padding:12px 16px; background:var(--surface); color:var(--text-muted);
  font-size:11.5px; text-transform:uppercase; letter-spacing:0.04em; border-bottom:1px solid var(--line);
}
table.requests td{padding:14px 16px; border-bottom:1px solid var(--line); vertical-align:top;}
table.requests tr:last-child td{border-bottom:none;}
table.requests tr:hover td{background:rgba(233,236,245,0.4);}
.name-cell strong{display:block; color:var(--navy);}
.name-cell span{color:var(--text-muted); font-size:12.5px;}
.msg-cell{max-width:320px; color:var(--text-muted); overflow:hidden; text-overflow:ellipsis; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;}
.badge{display:inline-block; padding:4px 10px; border-radius:20px; font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:0.02em;}
.badge-neu{background:rgba(242,168,29,0.18); color:#946000;}
.badge-gelesen{background:rgba(10,26,71,0.08); color:var(--navy);}
.badge-bearbeitet{background:rgba(26,122,65,0.12); color:var(--success);}
.badge-archiviert{background:var(--surface); color:var(--text-muted);}
.row-actions{display:flex; gap:8px; flex-wrap:wrap; min-width:300px;}
.row-actions select{font-size:12px; padding:6px 8px; border-radius:4px; border:1px solid var(--line);}
.row-actions button{font-size:12px; padding:6px 10px; border-radius:4px; border:1px solid var(--line); background:#fff; cursor:pointer;}
.row-actions button.danger{color:var(--danger); border-color:rgba(192,41,60,0.3);}
.row-actions button.danger:hover{background:rgba(192,41,60,0.06);}
.row-actions a{font-size:12px; padding:6px 10px; border-radius:4px; border:1px solid var(--line); background:#fff; text-decoration:none; color:var(--text);}

.actions-menu-btn{width:32px; height:32px; border-radius:4px; border:1px solid var(--line); background:#fff; cursor:pointer; font-size:18px; line-height:1; color:var(--text-muted); display:flex; align-items:center; justify-content:center;}
.actions-menu-btn:hover{background:var(--surface); color:var(--navy);}
.actions-menu-dropdown{display:none; position:fixed; background:#fff; border:1px solid var(--line); border-radius:6px; box-shadow:0 8px 24px rgba(7,19,53,0.18); min-width:190px; z-index:200; overflow:hidden;}
.actions-menu-dropdown button{display:block; width:100%; text-align:left; padding:10px 14px; font-size:13px; border:none; background:#fff; cursor:pointer; color:var(--text);}
.actions-menu-dropdown button:hover{background:var(--surface);}
.actions-menu-dropdown button.danger{color:var(--danger);}
.actions-menu-dropdown button.danger:hover{background:rgba(192,41,60,0.06);}
.actions-menu-dropdown button + button{border-top:1px solid var(--line);}

.pagination{display:flex; justify-content:space-between; align-items:center; padding:14px 16px; font-size:13px; color:var(--text-muted);}
.pagination button{border:1px solid var(--line); background:#fff; border-radius:4px; padding:8px 14px; cursor:pointer; font-size:13px;}
.pagination button:disabled{opacity:0.4; cursor:not-allowed;}

.empty-state{padding:60px 20px; text-align:center; color:var(--text-muted);}
.empty-state strong{display:block; color:var(--navy); font-size:16px; margin-bottom:6px;}

.modal-overlay{position:fixed; inset:0; background:rgba(7,19,53,0.55); display:none; align-items:center; justify-content:center; padding:20px; z-index:50;}
.modal-overlay.show{display:flex;}
.modal-box{position:relative; background:#fff; border-radius:var(--radius); max-width:440px; width:100%; padding:28px;}
.modal-box h3{font-size:18px; color:var(--navy); margin-bottom:16px;}
.modal-close{
  position:absolute; top:18px; right:18px; width:32px; height:32px; border-radius:50%;
  background:var(--surface); border:none; color:var(--text-muted); cursor:pointer; font-size:14px;
  display:flex; align-items:center; justify-content:center;
}
.modal-close:hover{background:var(--navy-tint); color:var(--navy);}

.requests th.sortable{cursor:pointer; user-select:none; white-space:nowrap;}
.requests th.sortable:hover{color:var(--navy);}
.requests th.sortable .sort-arrow{display:inline-block; width:12px; opacity:0.5; font-size:11px;}
.requests th.sortable.sorted .sort-arrow{opacity:1;}

.pagination .page-size{display:flex; align-items:center; gap:6px; font-size:13px; color:var(--text-muted);}
.pagination .page-size select{border:1px solid var(--line); border-radius:4px; padding:6px 8px; font-size:13px; font-family:inherit;}


.connection-card{background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:24px; margin-bottom:24px; display:flex; flex-wrap:wrap; gap:20px; align-items:center; justify-content:space-between;}
.connection-status{display:flex; align-items:center; gap:10px;}
.status-dot{width:10px; height:10px; border-radius:50%; background:var(--danger);}
.status-dot.connected{background:var(--success);}
.connection-status strong{font-size:15px; color:var(--navy);}
.connection-status span{font-size:12.5px; color:var(--text-muted); display:block;}
.connection-actions{display:flex; gap:10px; flex-wrap:wrap;}
.btn-sm{width:auto; padding:9px 16px; font-size:13.5px;}

.token-form{display:flex; gap:10px; flex-wrap:wrap; align-items:flex-end; margin-top:16px;}
.token-form .field{flex:1; min-width:220px; margin-bottom:0;}

.collapsible-toggle{display:flex; align-items:center; justify-content:space-between; width:100%; background:none; border:none; cursor:pointer; padding:0; margin-bottom:12px; text-align:left;}
.collapsible-toggle:hover h3{color:var(--navy-deep);}
.collapsible-arrow{font-size:12px; color:var(--text-muted); transition:transform .15s ease; flex-shrink:0; margin-left:12px;}
.collapsible-toggle[aria-expanded="false"] .collapsible-arrow{transform:rotate(-90deg);}
.collapsible-toggle[aria-expanded="false"] + .collapsible-panel{display:none;}

.rte-toolbar{display:flex; flex-wrap:wrap; gap:4px; align-items:center; padding:8px; border:1px solid var(--line); border-bottom:none; border-radius:6px 6px 0 0; background:var(--surface);}
.rte-toolbar select{font-size:12.5px; padding:6px 8px; border-radius:4px; border:1px solid var(--line); background:#fff; cursor:pointer;}
.rte-toolbar button{width:32px; height:32px; border-radius:4px; border:1px solid var(--line); background:#fff; cursor:pointer; font-size:13px; color:var(--text); display:flex; align-items:center; justify-content:center;}
.rte-toolbar button:hover{background:var(--navy-tint);}
.rte-toolbar button.active{background:var(--navy); color:#fff; border-color:var(--navy);}
.rte-sep{width:1px; height:22px; background:var(--line); margin:0 4px;}
.rte-editor{min-height:220px; border:1px solid var(--line); border-radius:0 0 6px 6px; padding:16px; font-size:14px; line-height:1.6; color:var(--text); background:#fff;}
.rte-editor:focus{outline:none; border-color:var(--navy);}
.rte-editor h3{color:var(--navy); font-size:16px; margin:12px 0 6px;}
.rte-editor blockquote{border-left:3px solid var(--gold); padding-left:12px; color:var(--text-muted); margin:10px 0;}
.rte-editor ul, .rte-editor ol{padding-left:22px; margin:8px 0;}
.rte-editor p{margin:0 0 10px;}
.rte-editor a{color:var(--navy);}
.rte-source{display:block; width:100%; min-height:220px; border:1px solid var(--line); border-radius:0 0 6px 6px; padding:16px; font-family:monospace; font-size:12.5px; resize:vertical; color:var(--text);}
.rte-editor table{border-collapse:collapse; width:100%; margin:10px 0;}
.rte-editor table td{padding:6px 8px; min-width:20px;}
.rte-editor table.pdf-table-visible td{border:1px solid var(--line);}
.rte-editor table.pdf-table-layout td{border:1px dashed var(--line);}

.toggle{position:relative; display:inline-block; width:40px; height:22px; flex-shrink:0;}
.toggle input{opacity:0; width:0; height:0;}
.toggle .slider{position:absolute; inset:0; background:var(--line); border-radius:22px; cursor:pointer; transition:background .15s ease;}
.toggle .slider::before{content:''; position:absolute; width:16px; height:16px; left:3px; top:3px; background:#fff; border-radius:50%; transition:transform .15s ease;}
.toggle input:checked + .slider{background:var(--success);}
.toggle input:checked + .slider::before{transform:translateX(18px);}

.settings-card{background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:24px; margin-bottom:24px;}
.settings-card h3{font-size:16px; color:var(--navy); margin-bottom:6px;}
.settings-card .hint{font-size:13px; color:var(--text-muted); margin-bottom:16px;}
.toggle-row{display:flex; align-items:center; gap:14px;}
.toggle-row span{font-size:14px; color:var(--text);}
.checkbox-grid{display:grid; grid-template-columns:repeat(auto-fit, minmax(180px,1fr)); gap:12px;}
.checkbox-item{display:flex; align-items:center; gap:10px; font-size:14px; color:var(--text); background:var(--surface); border:1px solid var(--line); border-radius:4px; padding:10px 12px;}
.checkbox-item input{width:16px; height:16px;}
.area-row{display:flex; gap:10px; align-items:center; margin-bottom:10px;}
.area-row input{flex:1; border:1px solid var(--line); background:var(--surface); border-radius:4px; padding:10px 12px; font-size:14px; color:var(--text);}
.area-row input:focus{outline:none; border-color:var(--navy);}
.area-row button{flex-shrink:0; border:1px solid rgba(192,41,60,0.3); background:#fff; color:var(--danger); border-radius:4px; width:36px; height:36px; cursor:pointer; font-size:14px;}
.area-row button:hover{background:rgba(192,41,60,0.06);}

.category-row{
  display:grid; grid-template-columns:1fr 1.6fr auto; gap:10px; align-items:start;
  margin-bottom:12px; padding-bottom:12px; border-bottom:1px solid var(--line);
}
.category-row:last-child{border-bottom:none;}
.category-row input{border:1px solid var(--line); background:var(--surface); border-radius:4px; padding:10px 12px; font-size:14px; color:var(--text); width:100%;}
.category-row input:focus{outline:none; border-color:var(--navy);}
.category-row .cat-meta{font-size:11px; color:var(--text-muted); margin-top:4px;}
.category-row button{flex-shrink:0; border:1px solid rgba(192,41,60,0.3); background:#fff; color:var(--danger); border-radius:4px; width:36px; height:36px; cursor:pointer; font-size:14px;}
.category-row button:hover{background:rgba(192,41,60,0.06);}
.page-tabs{display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:24px;}
.page-tabs button{background:none; border:none; padding:10px 16px; font-size:14px; font-weight:600; color:var(--text-muted); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px;}
.page-tabs button:hover{color:var(--navy);}
.page-tabs button.active{color:var(--navy); border-color:var(--gold);}
.page-tab-panel{display:none;}
.page-tab-panel.active{display:block;}

.nav-item-row-static{
  display:flex; align-items:center; gap:12px;
  margin-bottom:10px; padding-bottom:10px; border-bottom:1px solid var(--line);
}
.nav-item-row-static:last-child{border-bottom:none;}
.nav-item-row-static span{font-size:14px; color:var(--text);}

.nav-item-row{
  display:grid; grid-template-columns:auto 1fr 1fr auto auto; gap:10px; align-items:center;
  margin-bottom:10px; padding-bottom:10px; border-bottom:1px solid var(--line);
  transition:opacity .15s ease;
}
.nav-item-row:last-child{border-bottom:none;}
.nav-item-row.nav-item-hidden{opacity:0.5;}

/* Untermenüs (21.08.2026): ein .nav-item-group fasst einen Top-Level-Punkt
   und seine Kinder optisch zusammen, .nav-item-children rückt die
   Untermenüpunkte sichtbar ein (linke Trennlinie wie ein Baum). */
.nav-item-group{margin-bottom:18px; padding-bottom:18px; border-bottom:2px solid var(--line);}
.nav-item-group:last-child{border-bottom:none; margin-bottom:0; padding-bottom:0;}
.nav-item-group > .nav-item-row{border-bottom:none; margin-bottom:0;}
.nav-item-children{margin:10px 0 0 42px; padding:2px 0 2px 18px; border-left:2px solid var(--line);}
.nav-item-children .nav-item-row-sub{margin-bottom:8px; padding-bottom:8px; border-bottom:1px dashed var(--line);}
.nav-add-sub-btn{margin-top:4px;}
@media (max-width:700px){
  .nav-item-children{margin-left:18px; padding-left:12px;}
}
.nav-item-order{display:flex; flex-direction:column; gap:4px;}
.nav-item-order button{border:1px solid var(--line); background:#fff; border-radius:4px; width:28px; height:22px; cursor:pointer; font-size:12px; color:var(--text);}
.nav-item-order button:hover:not(:disabled){background:var(--surface);}
.nav-item-order button:disabled{opacity:0.3; cursor:not-allowed;}
.nav-item-row input[type="text"]{border:1px solid var(--line); background:var(--surface); border-radius:4px; padding:10px 12px; font-size:14px; color:var(--text); width:100%;}
.nav-item-row input[type="text"]:focus{outline:none; border-color:var(--navy);}
.nav-item-row .nav-item-delete{flex-shrink:0; border:1px solid rgba(192,41,60,0.3); background:#fff; color:var(--danger); border-radius:4px; width:36px; height:36px; cursor:pointer; font-size:14px;}
.nav-item-row .nav-item-delete:hover{background:rgba(192,41,60,0.06);}
@media (max-width:700px){
  .nav-item-row{
    grid-template-columns:auto 1fr auto;
    grid-template-areas:"order label toggle" "order url delete";
    row-gap:8px;
  }
  .nav-item-row .nav-item-label{grid-area:label;}
  .nav-item-row .nav-item-url{grid-area:url;}
  .nav-item-row .toggle{grid-area:toggle; justify-self:end;}
  .nav-item-row .nav-item-delete{grid-area:delete; justify-self:end;}
  .nav-item-row .nav-item-order{grid-area:order;}
}

.necessary-card{background:var(--surface); border:1px solid var(--line); border-radius:4px; padding:14px 16px; margin-bottom:16px; font-size:13.5px; color:var(--text-muted);}
.necessary-card strong{color:var(--navy); display:block; margin-bottom:2px;}
textarea.settings-textarea{width:100%; border:1px solid var(--line); background:var(--surface); border-radius:4px; padding:10px 12px; font-size:14px; color:var(--text); resize:vertical; min-height:80px; font-family:var(--font);}
textarea.settings-textarea:focus{outline:none; border-color:var(--navy);}
.field-label{display:block; font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:0.03em; color:var(--text-muted); margin-bottom:6px;}

.equip-name-cell .equip-name-inner{display:flex; flex-direction:column;}
.equip-name-cell strong{color:var(--navy);}
.equip-name-cell span{font-size:12px; color:var(--text-muted);}
.sync-log-list{font-size:12.5px; color:var(--text-muted); margin-top:14px;}
.sync-log-list li{padding:6px 0; border-bottom:1px solid var(--line); display:flex; justify-content:space-between; gap:12px;}
.sync-log-list li:last-child{border-bottom:none;}


.layout-diagram{display:flex; gap:3px; width:30px; height:20px; flex-shrink:0;}
.layout-diagram .ld-box{background:var(--gold); border-radius:2px; flex-shrink:0;}
.layout-diagram .ld-lines{flex:1; display:flex; flex-direction:column; gap:2px; justify-content:center; min-width:0;}
.layout-diagram .ld-lines span{height:3px; background:var(--navy-tint); border-radius:1px; display:block;}
.layout-diagram .ld-lines span:nth-child(1){width:100%;}
.layout-diagram .ld-lines span:nth-child(2){width:70%;}
.layout-diagram .ld-lines span:nth-child(3){width:85%;}
.layout-diagram.layout-image-left .ld-box{width:13px; order:1;}
.layout-diagram.layout-image-left .ld-lines{order:2;}
.layout-diagram.layout-image-right .ld-box{width:13px; order:2;}
.layout-diagram.layout-image-right .ld-lines{order:1;}
.layout-diagram.layout-image-full{flex-direction:column; height:20px;}
.layout-diagram.layout-image-full .ld-box{width:100%; height:11px;}
.layout-diagram.layout-image-full .ld-lines{flex-direction:row; height:6px; gap:3px;}
.layout-diagram.layout-image-full .ld-lines span{height:100%; flex:1; width:auto !important;}
.layout-diagram.layout-text-only .ld-box{display:none;}
.layout-diagram.layout-text-only .ld-lines{width:100%; justify-content:space-between; height:100%;}
.layout-diagram.lg{width:64px; height:44px; gap:5px;}
.layout-diagram.lg .ld-lines{gap:4px;}
.layout-diagram.lg .ld-lines span{height:5px;}
.layout-diagram.lg.layout-image-left .ld-box,
.layout-diagram.lg.layout-image-right .ld-box{width:28px;}
.layout-diagram.lg.layout-image-full{height:44px;}
.layout-diagram.lg.layout-image-full .ld-box{height:26px;}
.layout-diagram.lg.layout-image-full .ld-lines{height:12px; gap:5px;}

.layout-picker{display:grid; grid-template-columns:repeat(auto-fit, minmax(130px,1fr)); gap:10px;}
.layout-option{
  display:flex; flex-direction:column; align-items:center; gap:8px; padding:14px 10px;
  border:1.5px solid var(--line); border-radius:6px; background:var(--surface); cursor:pointer; transition:border-color .15s ease, background .15s ease;
}
.layout-option:hover{border-color:var(--navy);}
.layout-option.active{border-color:var(--gold); background:rgba(242,168,29,0.1);}
.layout-option span.opt-label{font-size:12px; font-weight:600; color:var(--text); text-align:center;}

.project-grid{display:grid; grid-template-columns:repeat(auto-fill, minmax(260px,1fr)); gap:16px;}
.project-card{
  position:relative; background:#fff; border:1px solid var(--line); border-radius:8px; overflow:hidden;
  cursor:grab; transition:box-shadow .15s ease, border-color .15s ease, transform .15s ease; display:flex; flex-direction:column;
}
.project-card:hover{box-shadow:0 8px 20px rgba(10,26,71,0.1); border-color:var(--navy-tint);}
.project-card.dragging{opacity:0.4;}
.project-card.drag-over{border-color:var(--gold); box-shadow:0 0 0 2px var(--gold) inset;}
.project-card.hidden-project{opacity:0.55;}
.project-card-order{
  position:absolute; top:10px; left:10px; z-index:2; width:26px; height:26px; border-radius:50%;
  background:rgba(10,26,71,0.75); color:#fff; font-size:11.5px; font-weight:800;
  display:flex; align-items:center; justify-content:center;
}
.project-card-badge{
  position:absolute; top:10px; right:10px; z-index:2; background:rgba(255,255,255,0.92);
  border-radius:5px; padding:4px 5px; box-shadow:0 2px 6px rgba(10,26,71,0.15);
}
.project-card-thumb{
  height:130px; background:var(--navy-tint) repeating-linear-gradient(45deg, rgba(10,26,71,0.05) 0 10px, transparent 10px 20px);
  display:flex; align-items:center; justify-content:center; overflow:hidden;
}
.project-card-thumb img{width:100%; height:100%; object-fit:cover; display:block;}
.project-card-thumb .thumb-placeholder{font-size:26px; opacity:0.35;}
.project-card-body{padding:14px 16px; flex:1; display:flex; flex-direction:column; gap:4px;}
.project-card-tag{font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:0.04em; color:#C77E00;}
.project-card-title{font-size:15px; font-weight:700; color:var(--navy); line-height:1.3;}
.project-card-client{font-size:12.5px; color:var(--text-muted);}
.project-card-foot{display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 16px; border-top:1px solid var(--line); background:var(--surface);}
.project-card-foot .btn-icon{
  border:1px solid var(--line); background:#fff; border-radius:4px; width:30px; height:30px; cursor:pointer;
  font-size:13px; display:flex; align-items:center; justify-content:center; color:var(--text-muted);
}
.project-card-foot .btn-icon:hover{background:#fff; color:var(--navy); border-color:var(--navy);}
.project-card-foot .btn-icon.danger:hover{color:var(--danger); border-color:rgba(192,41,60,0.3); background:rgba(192,41,60,0.06);}

.add-project-card{
  border:2px dashed var(--line); border-radius:8px; background:transparent; cursor:pointer;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:8px;
  min-height:230px; color:var(--text-muted); transition:border-color .15s ease, color .15s ease, background .15s ease;
}
.add-project-card:hover{border-color:var(--gold); color:#946000; background:rgba(242,168,29,0.05);}
.add-project-card .plus{font-size:30px; font-weight:300; line-height:1;}
.add-project-card span.label{font-size:13.5px; font-weight:600;}

.meta-row{display:grid; grid-template-columns:1fr 1fr auto; gap:8px; align-items:center;}
.meta-row input{border:1px solid var(--line); background:var(--surface); border-radius:4px; padding:9px 11px; font-size:13.5px; color:var(--text); width:100%;}
.meta-row input:focus{outline:none; border-color:var(--navy);}
.meta-row button{flex-shrink:0; border:1px solid rgba(192,41,60,0.3); background:#fff; color:var(--danger); border-radius:4px; width:34px; height:34px; cursor:pointer; font-size:13px;}
.meta-row button:hover{background:rgba(192,41,60,0.06);}
