*{margin:0;padding:0;box-sizing:border-box}

body{
  font-family:'Lexend',Arial,sans-serif;
  background:linear-gradient(135deg,#74ABE2,#5563DE);
  min-height:100vh;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  overflow-x:hidden;
  color:#0f172a
}

.page{
  width:100%;
  max-width:1400px;
  padding:28px 32px 40px;
  background:transparent;
  margin-top:0 !important;
  padding-top:16px !important;
}

.header{
  width:100%;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:14px 16px;
  border-radius:16px;
  background:rgba(255,255,255,.16);
  backdrop-filter:saturate(160%) blur(10px);
  -webkit-backdrop-filter:saturate(160%) blur(10px);
  border:1px solid rgba(255,255,255,.28);
  margin-bottom:28px;
  margin-top:0 !important;
  padding-top:0 !important;
}

.header .left,
.header .brand{
  display:flex;
  align-items:center;
  gap:14px;
  height:100%; /* Ensure full height for proper centering */
}

.header .logo{
  width:50px !important;
  height:50px !important;
  max-width:none !important;
  object-fit:cover;
  border-radius:12px;
  display:block;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.2));
  margin: auto 0; /* Perfect vertical centering with equal gaps */
}

.header h1{
  font-size:30px;
  font-weight:700;
  color:#0f172a;
  letter-spacing:.2px
}

.header .user{
  font-size:13px;
  color:#475569;
  margin-top:2px
}

.header .right-buttons{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap
}

.header button{
  background:linear-gradient(135deg,#5563DE,#74ABE2);
  color:#fff;
  border:none;
  border-radius:24px;
  padding:10px 18px;
  cursor:pointer;
  font-size:14px;
  font-weight:600;
  transition:transform .15s ease,box-shadow .15s ease;
  box-shadow:0 6px 18px rgba(85,99,222,.35);
  height:42px;
  display:flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap
}

.header button:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 26px rgba(85,99,222,.45)
}

.header .btn-accessibility{
  background:linear-gradient(135deg,#f1c40f,#f39c12);
  color:#2c3e50;
  box-shadow:0 6px 18px rgba(241,196,15,.35);
  padding:10px 22px;
  position:relative
}

.header .btn-accessibility:before{
  content:"🧠";
  margin-right:8px
}

/* ============================= */
/*   3-column clean grid layout   */
/* ============================= */

.documents-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:22px;
  max-width:1200px;
  margin:10px auto 30px;
  padding:10px;
}

#docsList{display:contents}

.doc-card{
  position:relative;
  background:#fff;
  border:1px solid rgba(15,23,42,.12);
  border-radius:16px;
  box-shadow:0 16px 34px rgba(17,24,39,.18);
  padding:20px;
  min-height:220px;
  display:flex;
  flex-direction:column;
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.doc-card:hover{
  transform:translateY(-2px);
  box-shadow:0 22px 44px rgba(17,24,39,.22);
  border-color:rgba(15,23,42,.18);
}

.doc-card::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  border-radius:16px;
  background:radial-gradient(520px 160px at 0 0, rgba(99,102,241,.08), transparent 60%);
}

/* title & preview text */
.doc-card h3{
  position:relative;
  z-index:1;
  font-size:18px;
  font-weight:700;
  color:#0f172a;
  margin-bottom:8px;
  line-height:1.25;
  padding-right:46px;
}

.doc-card p{
  position:relative;
  z-index:1;
  font-size:14px;
  color:#334155;
  line-height:1.6;
  margin-bottom:12px;
  overflow:hidden;
  text-overflow:ellipsis;
  display:-webkit-box;
  -webkit-line-clamp:4;
  -webkit-box-orient:vertical;
}

.doc-card .updated{
  position:absolute;
  right:16px;
  bottom:14px;
  font-size:12px;
  font-weight:600;
  color:#6b7280;
}

/* Menu icon (⋮) */
.menu-toggle{
  position:absolute;
  top:10px;
  right:10px;
  width:30px;
  height:30px;
  border-radius:10px;
  border:1px solid #e5e7eb;
  background:#fff;
  color:#6b7280;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  z-index:2;
  transition:background .15s ease, color .15s ease, border-color .15s ease;
}

.menu-toggle:hover{
  background:#f8fafc;
  color:#111827;
  border-color:#dbe3f0;
}

/* dropdown menu */
.menu-dropdown{
  position:absolute;
  top:44px;
  right:10px;
  z-index:5;
  min-width:160px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  box-shadow:0 20px 44px rgba(0,0,0,.14);
  padding:8px 6px;
  opacity:0;
  visibility:hidden;
  transform:translateY(-6px);
  transition:opacity .15s ease, transform .15s ease, visibility .15s step-end;
}

.menu-dropdown.show{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
}

.menu-dropdown button{
  width:100%;
  padding:10px 12px;
  border:none;
  background:#fff;
  text-align:left;
  font-size:14px;
  border-radius:8px;
  cursor:pointer;
  color:#0f172a;
}

.menu-dropdown button:hover{
  background:#f8fafc;
}

.menu-dropdown .delete{
  color:#e11d48;
}

/* Floating action button */
.fab-container{
  position:fixed;
  bottom:28px;
  right:28px;
  z-index:50;
}

.fab-main{
  width:74px;
  height:74px;
  background:#5563DE;
  color:#fff;
  border:4px solid #fff;
  border-radius:50%;
  font-size:30px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 10px 28px rgba(0,0,0,.35);
  transition:transform .15s ease,box-shadow .15s ease;
}

.fab-main:hover{
  transform:scale(1.06);
  box-shadow:0 16px 36px rgba(0,0,0,.42);
  background:#4a52cc;
}

.fab-menu{
  position:absolute;
  right:0;
  bottom:86px;
  display:flex;
  flex-direction:column;
  gap:14px;
  opacity:0;
  visibility:hidden;
  transform:translateY(12px);
  transition:opacity .15s ease,transform .15s ease,visibility .15s step-end;
}

.fab-container:hover .fab-menu{
  opacity:1;
  visibility:visible;
  transform:translateY(0);
  transition:opacity .15s ease,transform .15s ease,visibility 0s;
}

.fab-item{
  width:52px;
  height:52px;
  border-radius:50%;
  border:2px solid #fff;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  box-shadow:0 8px 20px rgba(0,0,0,.25);
  cursor:pointer;
}

.fab-item.microphone{background:#ef4444}
.fab-item.camera{background:#22c55e}
.fab-item.import{background:#f59e0b}

/* Responsive adjustments */
@media (max-width:1100px){
  .documents-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}

@media (max-width:820px){
  .header{flex-direction:column;align-items:stretch;gap:10px}
  .header .right-buttons{justify-content:center;flex-wrap:wrap}
  .header .logo{width:45px;height:45px;border-radius:12px}
}

@media (max-width:720px){
  .documents-grid{grid-template-columns:1fr;}
  .doc-card{min-height:200px;}
}

@media (max-width:520px){
  .page{padding:18px}
  .header h1{font-size:24px}
  .header .logo{width:40px;height:40px;border-radius:10px}
}
