:root{
  --orange:#ea580c;
  --orange-dark:#c2410c;
  --orange-soft:#fff1e8;
  --orange-soft-2:#fff7ed;
  --orange-border:#fed7aa;

  --bg:#f8fafc;
  --panel:#ffffff;
  --panel-soft:#fffaf7;
  --border:#e5e7eb;
  --border-warm:#f1dfd3;

  --text:#1f2937;
  --muted:#6b7280;
  --muted-2:#94a3b8;

  --success:#15803d;
  --success-bg:#ecfdf5;
  --warning:#b45309;
  --warning-bg:#fffbeb;
  --danger:#dc2626;
  --danger-bg:#fef2f2;

  --shadow:0 12px 32px rgba(124,45,18,.10);
  --shadow-soft:0 4px 14px rgba(15,23,42,.07);
  --radius:14px;

  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

*{box-sizing:border-box}
html{
  min-width:0;
  min-height:100%;
  background:var(--bg);
  scrollbar-gutter:stable;
}
body{
  margin:0;
  min-width:0;
  min-height:100%;
  color:var(--text);
  background:var(--bg);
  overflow:auto;
}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.45}
.hidden{display:none!important}

/* ---------- common buttons ---------- */
.btn{
  border:0;
  border-radius:10px;
  padding:10px 15px;
  font-weight:750;
}
.btn.primary{background:var(--orange);color:#fff}
.btn.primary:hover{background:var(--orange-dark)}
.btn.secondary{
  background:var(--orange-soft);
  color:#9a3412;
  border:1px solid #fdba74;
}
.btn.secondary:hover{background:#ffeadb}
.btn.danger{background:var(--danger-bg);color:var(--danger)}
.btn.danger:hover{background:#fee2e2}

.icon-btn{
  width:36px;
  min-width:36px;
  height:36px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--text);
  display:grid;
  place-items:center;
  font-weight:800;
}
.icon-btn:hover:not(:disabled){background:var(--orange-soft)}

.danger-text{color:var(--danger)!important}

/* ---------- login ---------- */
.login-view{
  min-height:100dvh;
  display:grid;
  place-items:center;
  padding:28px 16px;
  background:
    radial-gradient(circle at 18% 12%,rgba(251,146,60,.15),transparent 34%),
    linear-gradient(180deg,#fffdfb,#fff7f2);
}
.login-card{
  width:min(430px,94vw);
  background:#fff;
  border:1px solid var(--border-warm);
  border-radius:22px;
  box-shadow:var(--shadow);
  padding:30px;
}
.login-logo{
  display:flex;
  align-items:center;
  gap:13px;
  margin-bottom:24px;
}
.brand-mark{
  width:50px;
  height:50px;
  flex:0 0 auto;
  border-radius:15px;
  background:linear-gradient(145deg,#f97316,var(--orange-dark));
  color:#fff;
  display:grid;
  place-items:center;
  font-size:24px;
  font-weight:950;
  box-shadow:0 10px 22px rgba(234,88,12,.25);
  position:relative;
}
.brand-mark::after{
  content:"";
  position:absolute;
  right:-3px;
  bottom:6px;
  width:10px;
  height:10px;
  background:#fb923c;
  border:2px solid #fff;
  border-radius:3px;
}
.brand-mark.small{
  width:40px;
  height:40px;
  border-radius:12px;
  font-size:20px;
}
.login-logo h1{margin:0;color:#9a3412;font-size:25px}
.login-logo p{margin:3px 0 0;color:var(--muted);font-size:12px}
.login-form label{
  display:block;
  font-size:13px;
  font-weight:750;
  margin:14px 0;
}
.login-form input{
  display:block;
  width:100%;
  margin-top:7px;
  padding:12px 13px;
  border:1px solid #e7d2c5;
  border-radius:10px;
  outline:none;
  background:#fff;
}
.login-form input:focus{
  border-color:#fb923c;
  box-shadow:0 0 0 3px rgba(249,115,22,.13);
}
.login-btn{width:100%;margin-top:4px}
.login-msg{
  min-height:20px;
  margin-top:12px;
  font-size:12px;
  color:var(--danger);
}
.login-footer{
  margin-top:22px;
  padding-top:14px;
  border-top:1px solid #f4e4da;
  text-align:center;
  color:var(--muted);
  font-size:11px;
}

/* ---------- app shell ---------- */
.app-view{
  width:100%;
  min-width:760px;
  min-height:100dvh;
  display:grid;
  grid-template-columns:248px minmax(0,1fr);
  background:var(--bg);
}
.sidebar{
  position:sticky;
  top:0;
  height:100dvh;
  min-height:0;
  overflow:auto;
  background:#fff;
  border-right:1px solid var(--border-warm);
  display:flex;
  flex-direction:column;
  z-index:30;
}
.sidebar-brand{
  min-height:68px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border-bottom:1px solid var(--border-warm);
}
.brand-text{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
}
.brand-text strong{
  color:#9a3412;
  font-size:15px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.brand-text span{font-size:10px;color:var(--muted)}
.sidebar-close{display:none}

.new-main-btn{
  margin:15px 13px 10px;
  border:1px solid #fdba74;
  background:#fff;
  color:#9a3412;
  min-height:44px;
  border-radius:13px;
  font-weight:850;
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 15px;
  box-shadow:0 3px 10px rgba(234,88,12,.07);
}
.new-main-btn:hover{background:var(--orange-soft)}
.new-main-btn span{font-size:21px;color:var(--orange)}

.nav-group{padding:4px 8px}
.nav-item{
  width:100%;
  min-height:40px;
  border:0;
  border-radius:10px;
  background:transparent;
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  margin:1px 0;
  color:#49372d;
  text-align:left;
}
.nav-item>span:first-child{
  width:21px;
  text-align:center;
  font-size:17px;
  color:#7b6254;
}
.nav-item:hover{background:#fff7f2}
.nav-item.active{
  background:#ffedd5;
  color:#9a3412;
  font-weight:800;
}
.nav-item.active>span:first-child{color:var(--orange)}
.nav-count{
  margin-left:auto;
  min-width:20px;
  padding:2px 6px;
  border-radius:999px;
  background:#ffedd5;
  color:#c2410c;
  text-align:center;
  font-size:10px;
  font-weight:850;
}
.nav-section-label{
  padding:15px 18px 4px;
  color:#94a3b8;
  font-size:9px;
  font-weight:900;
  letter-spacing:.14em;
}
.sidebar-profile{
  margin-top:auto;
  border-top:1px solid var(--border-warm);
  padding:10px 12px;
  display:flex;
  align-items:center;
  gap:10px;
}
.avatar{
  width:36px;
  height:36px;
  flex:0 0 auto;
  border-radius:50%;
  background:#9a3412;
  color:#fff;
  display:grid;
  place-items:center;
  font-weight:900;
}
.sidebar-profile-text{
  min-width:0;
  display:flex;
  flex-direction:column;
}
.sidebar-profile-text strong{
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.sidebar-profile-text span{
  font-size:10px;
  color:var(--muted);
  text-transform:uppercase;
}

/* ---------- main content ---------- */
.content{
  min-width:0;
  min-height:100dvh;
  display:flex;
  flex-direction:column;
  overflow:visible;
}
.topbar{
  position:sticky;
  top:0;
  z-index:20;
  min-height:60px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 14px;
  background:rgba(255,255,255,.97);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border-warm);
}
.top-left,.top-actions{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}
.top-left{flex:1}
.top-actions{flex:0 0 auto}

.breadcrumbs{
  min-width:80px;
  flex:1;
  display:flex;
  align-items:center;
  gap:3px;
  white-space:nowrap;
  overflow-x:auto;
  overflow-y:hidden;
  scrollbar-width:none;
}
.breadcrumbs::-webkit-scrollbar{display:none}
.crumb{
  border:0;
  background:transparent;
  border-radius:7px;
  padding:6px 5px;
  color:#5d4639;
  white-space:nowrap;
}
.crumb:hover{background:var(--orange-soft)}
.crumb.current{font-weight:800;color:#9a3412}
.crumb-sep{color:#a8a29e}

.search-wrap{
  width:min(420px,36vw);
  min-width:180px;
  height:39px;
  border:1px solid #ead8cd;
  border-radius:11px;
  background:#fffaf7;
  display:flex;
  align-items:center;
  gap:7px;
  padding:0 10px;
}
.search-wrap:focus-within{
  background:#fff;
  border-color:#fb923c;
  box-shadow:0 0 0 3px rgba(249,115,22,.10);
}
.search-wrap input{
  min-width:0;
  width:100%;
  border:0;
  outline:0;
  background:transparent;
  font-size:13px;
}

.master-pill{
  display:flex;
  align-items:center;
  gap:6px;
  white-space:nowrap;
  background:#f3f4f6;
  color:#6b7280;
  border-radius:999px;
  padding:7px 9px;
  font-size:11px;
}
.status-dot{
  width:8px;
  height:8px;
  border-radius:50%;
  background:#dc2626;
}
.master-pill.online{
  color:#166534;
  background:var(--success-bg);
}
.master-pill.online .status-dot{background:#22c55e}
.master-pill.offline .status-dot{background:#ef4444}

.notification-button{position:relative}
.notification-badge{
  position:absolute;
  top:0;
  right:-1px;
  min-width:16px;
  height:16px;
  padding:0 4px;
  border-radius:999px;
  background:#dc2626;
  color:#fff;
  display:grid;
  place-items:center;
  font-size:9px;
  font-weight:900;
}
.profile-button{
  width:36px;
  height:36px;
  border:0;
  border-radius:50%;
  background:#fff1e8;
  color:#c2410c;
  display:grid;
  place-items:center;
}
.profile-button:hover{background:#ffedd5}

.command-bar{
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:5px 12px;
  background:#fff;
  border-bottom:1px solid var(--border-warm);
  overflow:hidden;
}
.command-left,.command-right{
  display:flex;
  align-items:center;
  gap:3px;
  min-width:0;
}
.command-left{
  flex:1 1 auto;
  overflow-x:auto;
  overflow-y:hidden;
  padding-bottom:2px;
  scrollbar-width:thin;
}
.command-left::-webkit-scrollbar{height:5px}
.command-left::-webkit-scrollbar-thumb{
  background:#f1c5aa;
  border-radius:999px;
}
.command-right{flex:0 0 auto}
.cmd-btn{
  height:34px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#4b362b;
  padding:0 9px;
  white-space:nowrap;
  font-size:12px;
}
.cmd-btn:hover:not(:disabled){background:#fff4ec}
.command-separator{
  width:1px;
  height:24px;
  flex:0 0 auto;
  background:var(--border-warm);
  margin:0 4px;
}
.selection-info{
  font-size:11px;
  color:#9a5b38;
  white-space:nowrap;
}
.sort-select{
  height:33px;
  max-width:150px;
  border:1px solid #ead8cd;
  border-radius:8px;
  color:#5d4639;
  background:#fff;
  padding:0 7px;
  font-size:11px;
}

/* ---------- page ---------- */
.offline-banner{
  margin:12px 16px 0;
  padding:10px 12px;
  border:1px solid #f6d69e;
  border-radius:10px;
  background:#fff8e8;
  color:#7c5706;
  font-size:12px;
}
.offline-banner strong{margin-right:5px}

.page-heading{
  padding:16px 18px 10px;
}
.page-heading h2{
  margin:0;
  color:#9a3412;
  font-size:21px;
}
.page-heading p{
  margin:4px 0 0;
  color:var(--muted);
  font-size:12px;
}

.file-scroll-area{
  min-width:0;
  width:100%;
  overflow:auto;
  padding:0 18px 90px;
}
.file-area{
  min-height:260px;
  max-width:100%;
  background:#fff;
  border:1px solid var(--border-warm);
  border-radius:14px;
  overflow:hidden;
}
.file-area.list-view{overflow:auto}
.file-area.list-view .file-head,
.file-area.list-view .file-row{
  min-width:760px;
}
.file-head,.file-row{
  display:grid;
  grid-template-columns:minmax(260px,1fr) 150px 120px 130px 42px;
  align-items:center;
  gap:8px;
}
.file-head{
  min-height:39px;
  padding:0 12px;
  border-bottom:1px solid var(--border-warm);
  color:#7c8797;
  font-size:11px;
  font-weight:750;
}
.file-row{
  min-height:50px;
  padding:4px 12px;
  border-bottom:1px solid #f7ebe4;
  user-select:none;
}
.file-row:last-child{border-bottom:0}
.file-row:hover{background:#fffaf7}
.file-row.selected{
  background:#ffedd5;
  box-shadow:inset 3px 0 0 var(--orange);
}
.file-row:focus-visible{
  outline:2px solid var(--orange);
  outline-offset:-2px;
}

.name-cell{
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
}
.file-icon{
  width:32px;
  height:32px;
  flex:0 0 auto;
  border-radius:8px;
  display:grid;
  place-items:center;
  font-size:19px;
}
.file-icon.folder{background:#fff4d9;color:#d28d0c}
.file-icon.pdf{background:#fff0f0;color:#d43b3b}
.file-icon.image{background:#f4efff;color:#6d4bc4}
.file-icon.sheet{background:#eaf8f1;color:#14845d}
.file-icon.doc{background:#eef4ff;color:#2465bd}
.file-icon.video{background:#fff0f8;color:#b54c83}
.file-icon.other{background:#eef2f6;color:#607086}
.file-name{
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.file-sub{
  margin-top:2px;
  font-size:10px;
  color:var(--muted);
}
.cell-muted{
  color:#6d7a8d;
  font-size:11px;
}
.more-btn{
  width:34px;
  height:31px;
  border:0;
  border-radius:8px;
  background:transparent;
}
.more-btn:hover{background:#fff0e6}

.empty-state{
  padding:60px 20px;
  text-align:center;
  color:var(--muted);
}
.empty-state .big{font-size:42px;opacity:.7}
.empty-state strong{
  display:block;
  margin-top:6px;
  color:#5a4034;
}

.file-area.grid-view{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(165px,1fr));
  gap:10px;
  padding:10px;
  overflow:visible;
  background:transparent;
  border:0;
}
.grid-view .file-head{display:none}
.grid-view .file-row{
  min-width:0;
  min-height:145px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-start;
  gap:8px;
  border:1px solid var(--border-warm);
  border-radius:14px;
  background:#fff;
  padding:12px;
  position:relative;
}
.grid-view .name-cell{
  width:100%;
  flex-direction:column;
  align-items:flex-start;
}
.grid-view .file-icon{width:48px;height:48px;font-size:26px}
.grid-view .file-name{
  white-space:normal;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
}
.grid-view .cell-muted{display:none}
.grid-view .more-btn{
  position:absolute;
  right:7px;
  top:7px;
}

/* ---------- drag & drop ---------- */
.drop-zone{
  position:fixed;
  inset:86px 28px 28px 276px;
  z-index:80;
  display:grid;
  place-items:center;
  background:rgba(255,247,237,.91);
  border:2px dashed #fb923c;
  border-radius:18px;
  backdrop-filter:blur(5px);
}
.drop-zone-box{text-align:center;color:#c2410c}
.drop-zone-box strong{display:block;font-size:20px}
.drop-zone-box span{display:block;margin-top:6px;font-size:12px}

/* ---------- menus ---------- */
.floating-menu,.context-menu{
  position:fixed;
  z-index:120;
  min-width:205px;
  max-width:calc(100vw - 16px);
  max-height:min(72vh,520px);
  overflow:auto;
  padding:6px;
  border:1px solid var(--border-warm);
  border-radius:12px;
  background:#fff;
  box-shadow:var(--shadow);
}
.floating-menu button,.context-menu button{
  width:100%;
  min-height:36px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:var(--text);
  text-align:left;
  padding:7px 10px;
}
.floating-menu button:hover,.context-menu button:hover{background:#fff4ec}
.context-menu button.danger{color:var(--danger)}
.context-menu .sep{
  height:1px;
  margin:5px 4px;
  background:#f0e2d9;
}

/* ---------- side panels ---------- */
.side-panel{
  position:fixed;
  top:68px;
  right:14px;
  z-index:110;
  width:min(390px,calc(100vw - 28px));
  max-height:calc(100dvh - 88px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:#fff;
  border:1px solid var(--border-warm);
  border-radius:16px;
  box-shadow:var(--shadow);
}
.panel-header{
  min-height:58px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid #f3e5dc;
}
.panel-header>div:first-child{
  display:flex;
  flex-direction:column;
}
.panel-header strong{color:#9a3412}
.panel-header span{font-size:10px;color:var(--muted)}
.panel-list,.notification-list{
  min-height:80px;
  max-height:460px;
  overflow:auto;
}
.notification-actions{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  padding:9px 10px;
  border-bottom:1px solid #f3e5dc;
}
.notification-actions .btn{
  flex:1;
  padding:8px 9px;
  font-size:11px;
}
.notification-item{
  width:100%;
  border:0;
  border-bottom:1px solid #f7ebe4;
  background:#fff;
  text-align:left;
  padding:11px 12px;
  color:var(--text);
}
.notification-item:hover{background:#fffaf7}
.notification-item.unread{
  background:#fff7ed;
  border-left:3px solid var(--orange);
}
.notification-body{
  margin-top:3px;
  color:#6f584c;
  font-size:11px;
  line-height:1.45;
}
.notification-time{
  margin-top:5px;
  color:var(--muted);
  font-size:10px;
}

.transfer-item{
  padding:10px 12px;
  border-bottom:1px solid #f7ebe4;
}
.transfer-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-size:11px;
}
.transfer-row strong{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.transfer-row span{
  flex:0 0 auto;
  color:var(--muted);
}
.mini-progress{
  height:5px;
  margin-top:7px;
  overflow:hidden;
  border-radius:999px;
  background:#f3e6dd;
}
.mini-progress span{
  display:block;
  height:100%;
  border-radius:999px;
  background:var(--orange);
}

/* ---------- modal ---------- */
.modal-backdrop,.preview-backdrop{
  position:fixed;
  inset:0;
  z-index:150;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  background:rgba(30,20,15,.38);
  backdrop-filter:blur(2px);
}
.modal{
  width:min(560px,calc(100vw - 24px));
  max-height:88dvh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  background:#fff;
  border-radius:17px;
  box-shadow:var(--shadow);
}
.modal-header{
  min-height:57px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 14px;
  border-bottom:1px solid var(--border-warm);
}
.modal-header h3{margin:0;color:#9a3412;font-size:16px}
.modal-body{
  overflow:auto;
  padding:16px;
}
.modal-body label{
  display:block;
  margin:10px 0;
  font-size:12px;
  font-weight:750;
}
.modal-body input,.modal-body textarea,.modal-body select{
  width:100%;
  display:block;
  margin-top:6px;
  padding:10px 11px;
  border:1px solid #e6d5ca;
  border-radius:9px;
  outline:none;
}
.modal-body input:focus,.modal-body textarea:focus,.modal-body select:focus{
  border-color:#fb923c;
  box-shadow:0 0 0 3px rgba(249,115,22,.10);
}
.modal-footer{
  display:flex;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:8px;
  padding:10px 14px;
  border-top:1px solid var(--border-warm);
}

/* ---------- preview ---------- */
.preview-backdrop{
  z-index:160;
  padding:12px;
}
.preview-shell{
  width:min(1100px,98vw);
  height:min(850px,94dvh);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border-radius:16px;
  background:#fff;
  box-shadow:var(--shadow);
}
.preview-header{
  min-height:58px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:9px 13px;
  border-bottom:1px solid var(--border-warm);
}
.preview-header>div{display:flex;align-items:center;gap:6px}
.preview-body{
  flex:1;
  min-height:0;
  overflow:auto;
  display:grid;
  place-items:center;
  background:#f6f7f9;
  padding:12px;
}
.preview-body iframe{
  width:100%;
  height:100%;
  border:0;
  background:#fff;
}
.preview-body img,.preview-body video{
  max-width:100%;
  max-height:100%;
}
.preview-unsupported{text-align:center}

/* ---------- approval / members / settings ---------- */
.approval-toolbar{
  position:sticky;
  top:0;
  z-index:4;
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  padding:12px;
  background:#fffaf7;
  border-bottom:1px solid var(--border-warm);
}
.approval-toolbar label{
  display:flex;
  align-items:center;
  gap:7px;
  font-size:12px;
  font-weight:750;
}
.approval-toolbar-actions{
  margin-left:auto;
  display:flex;
  gap:7px;
  flex-wrap:wrap;
}
.request-card{
  margin:10px;
  padding:12px;
  border:1px solid var(--border-warm);
  border-radius:12px;
  background:#fff;
}
.request-card header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
}
.request-card p{
  margin:7px 0 0;
  color:var(--muted);
  font-size:11px;
  line-height:1.5;
}
.request-title{display:flex;align-items:center;gap:8px}
.request-check{width:16px;height:16px;accent-color:var(--orange)}
.request-actions{
  display:flex;
  justify-content:flex-end;
  gap:7px;
  flex-wrap:wrap;
  margin-top:10px;
}
.pending-request{border-left:3px solid #fb923c}

.status-tag{
  display:inline-flex;
  align-items:center;
  border-radius:999px;
  padding:4px 7px;
  background:#f3f4f6;
  color:#64748b;
  font-size:9px;
  font-weight:850;
  white-space:nowrap;
}
.status-tag.pending,.status-tag.awaiting_approval{background:#fff7e6;color:#a16207}
.status-tag.stored_local,.status-tag.approved,.status-tag.completed{background:#ecfdf5;color:#166534}
.status-tag.rejected,.status-tag.failed{background:#fef2f2;color:#b91c1c}
.status-tag.local_verified,.status-tag.approved_replace{background:#eff6ff;color:#1d4ed8}

.settings-panel{
  margin:15px;
  padding:18px;
  border:1px solid var(--border-warm);
  border-radius:14px;
  background:#fff;
  display:grid;
  grid-template-columns:54px minmax(0,1fr);
  gap:14px;
}
.settings-icon{
  width:50px;
  height:50px;
  border-radius:13px;
  background:#9a3412;
  color:#fff;
  display:grid;
  place-items:center;
  font-size:24px;
}
.settings-panel h3{margin:0 0 6px;color:#9a3412}
.settings-panel p{margin:0 0 10px;color:var(--muted);font-size:12px}
.path-box{
  padding:11px 12px;
  border:1px solid #ead8cd;
  border-radius:9px;
  background:#fffaf7;
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:12px;
  word-break:break-all;
}
.settings-meta{margin-top:8px;font-size:11px;color:#7a5a4a}
.settings-note{
  margin-top:12px;
  padding:10px 11px;
  border:1px solid #fdba74;
  border-radius:9px;
  background:#fff4e8;
  color:#8a3416;
  font-size:11px;
  line-height:1.55;
}
.folder-picker{
  max-height:55vh;
  overflow:auto;
  border:1px solid var(--border);
  border-radius:10px;
}
.folder-choice{
  padding:10px 11px;
  border-bottom:1px solid #eee;
  cursor:pointer;
  font-size:12px;
}
.folder-choice:last-child{border-bottom:0}
.folder-choice:hover{background:#fff4ec}

.props{
  display:grid;
  grid-template-columns:120px minmax(0,1fr);
  gap:8px 12px;
  font-size:12px;
}
.props dt{color:var(--muted)}
.props dd{margin:0;word-break:break-word}

/* ---------- mobile ---------- */
.mobile-fab,.mobile-bottom,.mobile-menu-btn{display:none}
.sidebar-scrim{display:none}

@media(max-width:1180px) and (min-width:761px){
  .app-view{grid-template-columns:220px minmax(0,1fr)}
  .topbar{flex-wrap:wrap}
  .top-left{flex:1 1 55%}
  .top-actions{flex:1 1 100%;justify-content:flex-end}
  .search-wrap{margin-right:auto;width:min(520px,55vw)}
  .command-left{min-width:620px}
}

/* proper phone file-manager experience */
@media(max-width:760px){
  html,body{
    width:100%;
    min-width:0;
    overflow-x:hidden;
  }

  .app-view{
    display:block;
    width:100%;
    min-width:0;
    min-height:100dvh;
    padding-bottom:calc(64px + env(safe-area-inset-bottom));
  }

  .sidebar{
    position:fixed;
    left:-290px;
    top:0;
    bottom:0;
    width:min(278px,86vw);
    height:100dvh;
    z-index:90;
    box-shadow:0 18px 52px rgba(80,35,12,.22);
    transition:left .2s ease;
    padding-bottom:env(safe-area-inset-bottom);
  }
  .sidebar.open{left:0}
  .sidebar-close{display:grid}
  .sidebar-scrim{
    position:fixed;
    inset:0;
    z-index:85;
    background:rgba(45,28,20,.30);
    backdrop-filter:blur(1px);
  }

  .content{
    width:100%;
    min-width:0;
    min-height:100dvh;
  }

  .topbar{
    position:sticky;
    top:0;
    z-index:60;
    min-height:auto;
    display:grid;
    grid-template-columns:40px minmax(0,1fr) auto auto;
    grid-template-rows:42px 42px;
    gap:4px 6px;
    padding:5px 8px 7px;
  }
  #menuBtn{display:grid;grid-column:1;grid-row:1}
  .top-left{
    display:contents;
  }
  #backBtn,#upBtn{display:none}
  .breadcrumbs{
    grid-column:2;
    grid-row:1;
    width:100%;
    min-width:0;
    font-size:11px;
  }
  .top-actions{display:contents}
  .search-wrap{
    grid-column:1/-1;
    grid-row:2;
    width:100%;
    min-width:0;
    height:38px;
    background:#fff8f3;
  }
  .master-pill{
    grid-column:3;
    grid-row:1;
    padding:5px 7px;
  }
  .master-pill b{display:none}
  #notificationsBtn{
    grid-column:4;
    grid-row:1;
  }
  #installPwaBtn{display:none!important}
  .profile-button{display:none}

  .command-bar{display:none}

  .offline-banner{
    margin:10px 9px 0;
    font-size:11px;
    line-height:1.45;
  }
  .page-heading{
    padding:13px 11px 9px;
  }
  .page-heading h2{font-size:18px}
  .page-heading p{
    max-width:88vw;
    font-size:11px;
  }

  .file-scroll-area{
    overflow:visible;
    padding:0 8px calc(96px + env(safe-area-inset-bottom));
  }
  .file-area,.file-area.list-view{
    width:100%;
    min-width:0;
    overflow:hidden;
    border-radius:14px;
  }
  .file-area.list-view .file-head{display:none}
  .file-area.list-view .file-row,
  .file-row{
    min-width:0;
    min-height:67px;
    display:grid;
    grid-template-columns:minmax(0,1fr) 38px;
    gap:8px;
    padding:8px 8px 8px 10px;
    touch-action:manipulation;
  }
  .file-row>.cell-muted{display:none}
  .name-cell{gap:12px}
  .file-icon{
    width:43px;
    height:43px;
    border-radius:11px;
    font-size:24px;
  }
  .file-name{
    font-size:14px;
    font-weight:700;
  }
  .file-sub{
    display:block;
    margin-top:3px;
    font-size:10px;
  }
  .more-btn{font-size:15px}

  .file-area.grid-view{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px;
    padding:0;
  }
  .grid-view .file-row{
    min-height:142px;
    padding:11px;
  }

  .mobile-fab{
    position:fixed;
    right:16px;
    bottom:calc(76px + env(safe-area-inset-bottom));
    z-index:75;
    width:55px;
    height:55px;
    border:0;
    border-radius:17px;
    background:var(--orange);
    color:#fff;
    display:grid;
    place-items:center;
    font-size:27px;
    box-shadow:0 10px 24px rgba(234,88,12,.34);
  }

  .mobile-bottom{
    position:fixed;
    left:0;
    right:0;
    bottom:0;
    z-index:70;
    height:calc(62px + env(safe-area-inset-bottom));
    padding-bottom:env(safe-area-inset-bottom);
    display:grid;
    grid-template-columns:repeat(4,1fr);
    background:rgba(255,255,255,.98);
    border-top:1px solid var(--border-warm);
    box-shadow:0 -8px 28px rgba(104,48,16,.08);
  }
  .mobile-bottom button{
    border:0;
    background:transparent;
    color:#6b7280;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:2px;
  }
  .mobile-bottom button span{font-size:18px}
  .mobile-bottom button small{font-size:9px}
  .mobile-bottom button.active{
    color:var(--orange-dark);
    font-weight:800;
  }

  .side-panel{
    left:8px;
    right:8px;
    top:auto;
    bottom:calc(70px + env(safe-area-inset-bottom));
    width:auto;
    max-height:65dvh;
    border-radius:16px;
  }

  .modal-backdrop{
    padding:10px 10px 0;
    align-items:flex-end;
  }
  .modal{
    width:100%;
    max-width:none;
    max-height:87dvh;
    border-radius:19px 19px 0 0;
  }

  .preview-backdrop{
    padding:0;
    align-items:stretch;
  }
  .preview-shell{
    width:100%;
    height:100dvh;
    border-radius:0;
  }

  .drop-zone{
    inset:90px 8px calc(74px + env(safe-area-inset-bottom));
  }

  .approval-toolbar-actions{
    width:100%;
    margin-left:0;
  }
  .approval-toolbar-actions .btn{
    flex:1;
    padding:9px 7px;
    font-size:10px;
  }
  .settings-panel{
    margin:7px;
    padding:14px;
    grid-template-columns:1fr;
  }
  .settings-icon{width:43px;height:43px}

  .toast-host{
    left:10px;
    right:10px;
    bottom:calc(72px + env(safe-area-inset-bottom));
  }
}

/* very narrow phones */
@media(max-width:390px){
  .master-pill{display:none}
  .topbar{
    grid-template-columns:40px minmax(0,1fr) auto;
  }
  #notificationsBtn{grid-column:3}
  .file-area.grid-view{grid-template-columns:1fr}
  .login-card{padding:23px 16px}
}

/* ---------- toasts ---------- */
.toast-host{
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:220;
  display:flex;
  flex-direction:column;
  gap:8px;
  pointer-events:none;
}
.toast{
  max-width:min(370px,calc(100vw - 24px));
  padding:10px 13px;
  border-radius:11px;
  background:#292524;
  color:#fff;
  box-shadow:var(--shadow-soft);
  font-size:12px;
  pointer-events:auto;
}
.toast.success{background:#166534}
.toast.error{background:#991b1b}

/* standalone PWA safe area */
@media(display-mode:standalone){
  .topbar{
    padding-top:max(5px,env(safe-area-inset-top));
  }
}
/* RSPD Storage final logo */

.brand-logo{
  display:block;
  flex:0 0 auto;
  object-fit:cover;
  object-position:center;
}

.login-brand-logo{
  width:54px;
  height:54px;
  border-radius:15px;
  box-shadow:0 8px 20px rgba(234,88,12,.18);
}

.sidebar-brand-logo{
  width:42px;
  height:42px;
  border-radius:12px;
}

@media(max-width:760px){
  .sidebar-brand-logo{
    width:40px;
    height:40px;
  }
}
/* ===== MOBILE MASTER STORAGE STATUS FIX ===== */

@media (max-width: 760px){

  .master-pill{
    display:flex !important;
    align-items:center;
    justify-content:center;
    gap:5px;
    min-width:auto;
    padding:6px 9px;
    border-radius:999px;
    font-size:10px;
    font-weight:800;
  }

  .master-pill b{
    display:inline !important;
    font-size:10px;
  }

  .master-pill.online{
    background:#ecfdf5;
    color:#166534;
  }

  .master-pill.offline{
    background:#fef2f2;
    color:#b91c1c;
  }

  .master-pill .status-dot{
    width:7px;
    height:7px;
    flex:0 0 auto;
  }
}

@media (max-width:390px){

  .master-pill{
    display:flex !important;
    padding:5px 7px;
  }

  .master-pill b{
    display:inline !important;
    font-size:9px;
  }

  .topbar{
    grid-template-columns:40px minmax(0,1fr) auto auto;
  }

  #notificationsBtn{
    grid-column:4;
  }
}