:root{
  --bg:#0b1220;
  --bg2:#0f172a;
  --line:rgba(255,255,255,.08);
  --text:#edf2ff;
  --muted:#9fb0d0;
  --blue:#4f46e5;
  --blue2:#60a5fa;
  --shadow:0 18px 45px rgba(0,0,0,.32);
}

*{ box-sizing:border-box; }

html, body{
  margin:0;
  min-height:100%;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color:var(--text);
  background:
    radial-gradient(900px 500px at 15% 0%, rgba(96,165,250,.14), transparent 55%),
    radial-gradient(800px 500px at 80% 0%, rgba(79,70,229,.14), transparent 50%),
    linear-gradient(180deg, var(--bg2), var(--bg));
}

button, input, textarea, select{
  font:inherit;
}

.center-wrap{
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}

.login-card{
  width:100%;
  max-width:460px;
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
  border:1px solid var(--line);
  border-radius:18px;
  padding:24px;
  box-shadow:var(--shadow);
}

.app-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:280px 1fr;
}

.sidebar{
  border-right:1px solid var(--line);
  background:rgba(10,15,28,.72);
  backdrop-filter: blur(10px);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  padding:18px;
}

.sidebar-top{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.brand{
  font-weight:900;
  font-size:18px;
  line-height:1.2;
}

.side-nav{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.side-link{
  text-align:left;
  border:1px solid transparent;
  background:transparent;
  color:var(--text);
  padding:11px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
}

.side-link:hover{
  background:rgba(255,255,255,.04);
}

.side-link.active{
  background:rgba(96,165,250,.12);
  border-color:rgba(96,165,250,.2);
}

.sidebar-bottom{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.user-mini{
  color:var(--muted);
  font-size:13px;
  word-break:break-word;
}

.logout-btn{
  border:none;
  background:linear-gradient(135deg, #ff7b7b, #ff4f4f);
  color:#fff;
  border-radius:12px;
  padding:11px 12px;
  font-weight:800;
  cursor:pointer;
}

.main{
  padding:22px;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:18px;
}

.topbar h1{
  margin:0;
  font-size:28px;
}

.topbar p{
  margin:8px 0 0;
  color:var(--muted);
}

.pathbar{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:14px;
}

.path-breadcrumb{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.crumb{
  border:none;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  font-weight:700;
  padding:0;
}

.crumb.active{
  color:var(--text);
}

.crumb-sep{
  color:var(--muted);
}

.soft-btn{
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  color:var(--text);
  border-radius:12px;
  padding:10px 12px;
  cursor:pointer;
  font-weight:700;
}

.soft-btn:hover{
  background:rgba(255,255,255,.07);
}

.drive-surface{
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.025));
  border:1px solid var(--line);
  border-radius:18px;
  padding:18px;
  box-shadow:var(--shadow);
}

.surface-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:16px;
}

.surface-toolbar-left{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.drive-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(170px, 1fr));
  gap:14px;
}

.drive-item{
  position:relative;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  border-radius:16px;
  padding:16px 14px 14px;
  min-height:120px;
  cursor:default;
  user-select:none;
}

.drive-item:hover{
  background:rgba(255,255,255,.055);
}

.drive-item-icon{
  font-size:34px;
  margin-bottom:12px;
}

.drive-item-name{
  font-weight:700;
  line-height:1.35;
  word-break:break-word;
  padding-right:28px;
}

.dots-btn{
  position:absolute;
  top:10px;
  right:10px;
  width:32px;
  height:32px;
  border:none;
  border-radius:10px;
  background:rgba(255,255,255,.05);
  color:var(--text);
  cursor:pointer;
  font-size:18px;
}

.dots-btn:hover{
  background:rgba(255,255,255,.1);
}

.empty-state{
  color:var(--muted);
  padding:22px 6px;
}

.context-menu{
  position:fixed;
  z-index:2000;
  min-width:220px;
  background:#111827;
  border:1px solid var(--line);
  border-radius:14px;
  box-shadow:0 18px 40px rgba(0,0,0,.45);
  padding:8px;
}

.context-menu[hidden]{
  display:none !important;
}

.context-menu button{
  width:100%;
  text-align:left;
  border:none;
  background:transparent;
  color:var(--text);
  padding:10px 12px;
  border-radius:10px;
  cursor:pointer;
}

.context-menu button:hover{
  background:rgba(255,255,255,.06);
}

.context-menu .danger-item{
  color:#ffb4b4;
}

.drawer{
  position:fixed;
  top:0;
  right:0;
  width:100%;
  max-width:520px;
  height:100vh;
  z-index:3000;
  background:#0f172a;
  border-left:1px solid var(--line);
  box-shadow:-10px 0 35px rgba(0,0,0,.4);
  display:flex;
  flex-direction:column;
}

.drawer[hidden]{
  display:none !important;
}

.drawer-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:18px;
  border-bottom:1px solid var(--line);
}

.drawer-head h2{
  margin:0;
  font-size:20px;
}

.icon-btn{
  width:38px;
  height:38px;
  border:none;
  border-radius:12px;
  background:rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
}

.drawer-body{
  padding:18px;
  overflow:auto;
}

.drawer-form{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.drawer-form input,
.drawer-form textarea,
.drawer-form select{
  width:100%;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  color:var(--text);
  padding:12px 14px;
}

.drawer-form textarea{
  min-height:220px;
  resize:vertical;
}

.drawer-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
}

.drawer-actions button{
  border:none;
  background:linear-gradient(135deg, var(--blue2), var(--blue));
  color:#fff;
  border-radius:12px;
  padding:11px 14px;
  font-weight:800;
  cursor:pointer;
}

.share-section{
  margin-top:18px;
  padding-top:18px;
  border-top:1px solid var(--line);
}

.share-section h3{
  margin:0 0 12px;
  font-size:16px;
}

.existing-shares{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.share-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  border:1px solid var(--line);
  background:rgba(255,255,255,.03);
  border-radius:12px;
  padding:12px;
}

.share-row-left{
  min-width:0;
  flex:1;
}

.share-email{
  font-weight:700;
  word-break:break-word;
}

.share-row-right{
  display:flex;
  gap:8px;
  align-items:center;
  flex-wrap:wrap;
}

.share-permission{
  min-width:140px;
  border-radius:10px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.04);
  color:var(--text);
  padding:10px 12px;
}

.share-save-btn,
.share-remove-btn{
  border:none;
  border-radius:10px;
  padding:10px 12px;
  cursor:pointer;
  font-weight:700;
}

.share-save-btn{
  background:linear-gradient(135deg, var(--blue2), var(--blue));
  color:#fff;
}

.share-remove-btn{
  background:rgba(255,255,255,.08);
  color:var(--text);
}

.muted{
  color:var(--muted);
}

.small{
  font-size:12px;
}

@media (max-width: 900px){
  .app-shell{
    grid-template-columns:1fr;
  }

  .sidebar{
    border-right:none;
    border-bottom:1px solid var(--line);
  }

  .main{
    padding:16px;
  }

  .drive-grid{
    grid-template-columns:repeat(auto-fill, minmax(140px, 1fr));
  }

  .drawer{
    max-width:none;
  }

  .share-row{
    flex-direction:column;
    align-items:flex-start;
  }

  .share-row-right{
    width:100%;
  }

  .share-permission{
    min-width:0;
    width:100%;
  }
}
