/* LAYOUT.CSS - Layout styles */

/* HEADER */
header{
  position:fixed; 
  top:0; 
  left:0;
  right:0;
  z-index:11;
  background:#fff;
  border-bottom:1px solid var(--stroke);
  padding:20px 20px;
  display:flex; align-items:center; gap:16px; justify-content:space-between;
}

.brand{display:flex; align-items:center; gap:10px; font-weight:700}
.brand .dot{width:10px; height:10px; border-radius:50%; background:var(--indigo)}

.tabs{display:flex; gap:8px; flex:1; padding-right: 5px;}
.tab{
  padding:10px 12px;
  border:1px solid var(--stroke);
  border-radius:10px;
  background:#fff;
  cursor:pointer;
  color:#111827;
  font-size:13px;
  font-weight:600;
  transition: all 0.2s;
  position: relative;
  white-space: nowrap;
}
.logout-btn{
  margin-left: auto;
}
.tab.active{background:var(--primary-weak); border-color:var(--indigo); color:var(--indigo);}
.tab:hover{border-color:var(--indigo)}

/* Badge для непрочитанных сообщений на вкладке */
.tab-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-actions{display:flex; gap:8px; align-items:center}
.mass-comment-container{display:flex; gap:8px; align-items:center; margin-left:2px; width:180px; justify-content:flex-start;}
.mass-comment-container .mass-comment-btn{display:flex; align-items:center; justify-content:center; padding:10px 12px; border:1px solid var(--stroke); border-radius:10px; background:#fff; cursor:pointer; transition:all 0.2s;}
.mass-comment-container .mass-comment-btn:hover{border-color:var(--indigo);}
.mass-comment-container .mass-comment-btn.active{background:var(--primary-weak); border-color:var(--indigo);}
.last-update{font-size:11px; color:var(--muted); margin-right:8px}

/* CONTAINER */
.container{max-width:1200px; margin:20px auto 10px; padding:0 16px; margin-left:72px; transition: margin-left 0.3s ease; height:calc(100vh - 90px); overflow:hidden; display:flex; flex-direction:column;}
.container.panel-hidden{margin-left:16px;}
.grid{display:grid; grid-template-columns:1.5fr 1fr; gap:16px; flex:1; min-height:0; max-height:100%; overflow:hidden;}
.row{display:grid; grid-template-columns:repeat(3,1fr); gap:16px}

/* CARD */
.card{
  border:1px solid var(--stroke);
  border-radius:16px;
  background:var(--card);
  padding:16px;
  box-shadow:0 1px 0 rgba(16,24,40,.04);
  display:flex;
  flex-direction:column;
  min-height:0;
  max-height:100%;
  overflow:hidden;
}
.card h3{margin:0 0 12px 0; font-size:16px; flex-shrink:0;}
.card .list{
  flex:1;
  overflow-y:auto !important;
  min-height:0;
  max-height:100%;
}
.card-header{display:flex; justify-content:space-between; align-items:center; margin-bottom:12px}

/* VIEW SECTIONS */
section.view{
  display:none;
  flex:1;
  min-height:0;
  max-height:100%;
  overflow:hidden;
}
section.view:not(.hidden){
  display:flex;
  flex-direction:column;
}

#kanban:not(.hidden){
  display:flex;
  flex-direction:column;
  overflow:hidden;
  max-height:100%;
}

#table:not(.hidden){
  display:flex;
  flex-direction:column;
  overflow:hidden;
  max-height:100%;
}

#table .card{
  flex:1;
  min-height:0;
  max-height:100%;
  overflow:hidden;
}

/* RIGHT COLUMN */
.grid > div:nth-child(2){
  display:flex;
  flex-direction:column;
  min-height:0;
  max-height:100%;
  overflow:hidden;
}

.grid > div:nth-child(2) > .card{
  flex:1;
  min-height:0;
  max-height:100%;
  overflow:hidden;
}

/* LIST */
.list{
  display:flex; 
  flex-direction:column; 
  gap:10px; 
  flex:1; 
  overflow-y:auto !important; 
  overflow-x:hidden;
  padding-right:8px; 
  min-height:0;
  max-height:100%;
}
.list::-webkit-scrollbar{width:6px;}
.list::-webkit-scrollbar-track{background:#f1f1f1; border-radius:10px;}
.list::-webkit-scrollbar-thumb{background:#d1d5db; border-radius:10px;}
.list::-webkit-scrollbar-thumb:hover{background:#9ca3af;}

@media (max-width: 960px){
  .grid{grid-template-columns:1fr}
  .row{grid-template-columns:1fr}
  .admin-panel{width:48px}
  .container{margin-left:68px}
}
@media (max-width: 640px){
  .header-actions{flex-wrap:wrap}
  .admin-panel{transform: translateX(-100%)}
  .admin-toggle{display:flex}
  .container{margin-left:0}
}
