:root{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#172033;background:#f4f7fb;font-synthesis:none}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:#f4f7fb}
body{min-height:100vh}
button,input,select,textarea{font:inherit}
.hidden{display:none!important}

.login-shell{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:24px;
  background:
    radial-gradient(circle at 15% 20%,#2563eb1c,transparent 30%),
    radial-gradient(circle at 85% 75%,#0f172a16,transparent 34%),
    linear-gradient(145deg,#f8fbff,#eef3f9)
}

.login-card{
  width:min(430px,100%);
  background:#fffffff5;
  border:1px solid #cbd5e1cc;
  border-radius:22px;
  padding:36px;
  box-shadow:0 24px 70px #1e293b21
}

.brand-mark{
  width:48px;
  height:48px;
  border-radius:13px;
  display:grid;
  place-items:center;
  background:linear-gradient(145deg,#0f172a,#2563eb);
  color:#fff;
  font-weight:800;
  font-size:22px;
  box-shadow:0 8px 18px #2563eb38
}

.brand-mark.small{
  width:34px;
  height:34px;
  border-radius:9px;
  font-size:16px;
  flex:0 0 34px
}

.login-card h1{
  font-size:21px;
  margin:18px 0 5px
}

.login-card p{
  color:#64748b;
  margin:0 0 24px
}

.login-card label,
.form-grid label{
  display:block;
  font-size:13px;
  font-weight:700;
  color:#334155;
  margin-top:14px
}

.login-card input,
.form-grid input,
.form-grid select,
.search{
  width:100%;
  padding:12px;
  border:1px solid #d7deea;
  border-radius:10px;
  background:#fff;
  color:#172033;
  outline:none
}

.login-card input:focus,
.form-grid input:focus,
.form-grid select:focus,
.search:focus{
  border-color:#3b82f6;
  box-shadow:0 0 0 4px #3b82f61c
}

.primary,
.action,
.ghost{
  border-radius:10px;
  padding:9px 13px;
  font-weight:700;
  cursor:pointer
}

.primary,
.action{
  border:1px solid #1d4ed8;
  background:#1d4ed8;
  color:#fff
}

.primary:hover,
.action:hover{
  background:#1e40af
}

.ghost{
  border:1px solid #d6deea;
  background:#fff;
  color:#334155
}

.ghost:hover{
  background:#f8fafc
}

.wide{
  width:100%;
  margin-top:20px;
  padding:12px
}

.form-msg{
  min-height:20px;
  margin-top:13px;
  color:#b42318;
  font-size:13px;
  display:none
}

.form-msg.show{
  display:block
}

.topbar{
  height:68px;
  background:#ffffffef;
  border-bottom:1px solid #e5eaf1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 28px;
  position:sticky;
  top:0;
  z-index:20;
  backdrop-filter:blur(14px);
  box-shadow:0 4px 18px #0f172a08
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  letter-spacing:.03em
}

.top-actions{
  display:flex;
  align-items:center;
  gap:9px
}

.user-pill{
  font-size:12px;
  color:#64748b;
  background:#f1f5f9;
  padding:7px 10px;
  border-radius:999px
}

.content{
  max-width:1180px;
  margin:0 auto;
  padding:30px 24px 50px
}

.toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  margin-bottom:16px
}

.crumbs{
  flex:1;
  min-width:220px;
  color:#64748b;
  font-size:14px;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:4px
}

.crumbs button{
  border:0;
  background:transparent;
  color:#1d4ed8;
  font-weight:700;
  cursor:pointer;
  padding:3px 2px
}

.search{
  width:min(290px,100%)
}

.status{
  min-height:28px;
  color:#64748b;
  font-size:13px;
  padding:3px 2px 10px
}

.error-text{
  color:#b42318
}

.panel{
  background:#fff;
  border:1px solid #e2e8f0;
  border-radius:16px;
  overflow:visible;
  box-shadow:0 10px 34px #0f172a0c
}

.head,
.row{
  display:grid;
  grid-template-columns:minmax(220px,1fr) 180px 110px 44px;
  align-items:center;
  gap:14px;
  padding:13px 18px
}

.head{
  font-size:11px;
  font-weight:800;
  color:#7c8798;
  background:#f8fafc;
  border-bottom:1px solid #e8edf3;
  text-transform:uppercase;
  letter-spacing:.055em
}

.row{
  position:relative;
  border-bottom:1px solid #edf1f5;
  font-size:14px
}

.row:hover{
  background:#f8fbff
}

.row:last-child{
  border-bottom:0
}

.name{
  display:flex;
  align-items:center;
  gap:11px;
  min-width:0
}

.file-icon{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:#eff6ff;
  flex:0 0 34px
}

.name button{
  border:0;
  background:transparent;
  padding:4px 0;
  text-align:left;
  color:#172033;
  font-weight:650;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  cursor:pointer
}

.name button:hover{
  color:#1d4ed8
}

.muted{
  color:#7c8798
}

.empty{
  text-align:center;
  color:#8893a2;
  padding:62px 24px
}

.menu{
  position:relative;
  justify-self:end;
  z-index:30
}

.menu-btn{
  width:34px;
  height:34px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:#64748b;
  font-size:20px;
  cursor:pointer
}

.menu-btn:hover{
  background:#eef2f7
}

.menu-pop{
  position:absolute;
  right:0;
  top:38px;
  background:#fff;
  border:1px solid #dce3ec;
  border-radius:11px;
  box-shadow:0 14px 32px #0f172a29;
  min-width:205px;
  z-index:100;
  padding:6px
}

.menu-pop button{
  display:block;
  width:100%;
  border:0;
  background:transparent;
  color:#334155;
  text-align:left;
  padding:9px 10px;
  border-radius:8px;
  cursor:pointer
}

.menu-pop button:hover{
  background:#f1f5f9
}

.danger{
  color:#b42318!important
}

.overlay{
  position:fixed;
  inset:0;
  background:#0f172ac2;
  z-index:100;
  display:grid;
  place-items:center;
  padding:18px;
  backdrop-filter:blur(5px)
}

.modal{
  width:min(720px,100%);
  max-height:92vh;
  background:#fff;
  border-radius:18px;
  box-shadow:0 28px 80px #0005;
  overflow:hidden;
  display:flex;
  flex-direction:column
}

.modal.large{
  width:min(1120px,100%);
  height:min(91vh,920px)
}

.modal.medium{
  width:min(620px,100%)
}

.modal-head{
  min-height:62px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 16px;
  border-bottom:1px solid #e5eaf1
}

.modal-head>div{
  display:flex;
  gap:8px;
  flex-wrap:wrap
}

.preview-body{
  flex:1;
  min-height:0;
  background:#eef2f7;
  display:grid;
  place-items:center;
  overflow:auto
}

.preview-frame{
  width:100%;
  height:100%;
  border:0;
  background:#fff
}

.preview-image{
  max-width:100%;
  max-height:100%;
  object-fit:contain
}

.preview-text{
  width:100%;
  min-height:100%;
  margin:0;
  padding:26px;
  background:#fff;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  font:13px/1.6 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace
}

.doc-preview{
  align-self:start;
  justify-self:center;
  width:min(850px,100%);
  min-height:100%;
  background:#fff;
  padding:48px 54px;
  line-height:1.6;
  box-shadow:0 4px 18px #0f172a1a
}

.doc-preview table{
  border-collapse:collapse;
  width:100%
}

.doc-preview td{
  border:1px solid #d1d5db;
  padding:7px;
  white-space:pre-wrap
}

.note{
  background:#fffbeb;
  color:#7c5b13;
  border:1px solid #fde68a;
  border-radius:9px;
  padding:10px 12px;
  font-size:12px;
  margin-bottom:20px
}

.loading{
  color:#64748b;
  text-align:center;
  padding:30px
}

.editor-modal{
  height:min(88vh,820px)
}

.text-editor{
  flex:1;
  min-height:0;
  width:100%;
  border:0;
  padding:24px;
  font:14px/1.6 ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  outline:none;
  resize:none
}

.form-grid{
  padding:18px;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px
}

.form-grid label{
  margin:0
}

.form-grid .primary{
  align-self:end
}

.table-wrap{
  overflow:auto;
  flex:1
}

.admin-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px
}

.admin-table th,
.admin-table td{
  padding:10px 12px;
  border-bottom:1px solid #edf1f5;
  text-align:left;
  vertical-align:middle
}

.admin-table th{
  position:sticky;
  top:0;
  background:#f8fafc;
  color:#64748b
}

.admin-table select{
  padding:7px;
  border:1px solid #d7deea;
  border-radius:8px;
  background:#fff
}

.small-btn{
  padding:6px 8px;
  font-size:12px;
  margin-right:4px
}

@media(max-width:760px){
  .topbar{
    height:auto;
    min-height:62px;
    padding:10px 12px;
    align-items:flex-start
  }

  .brand{
    font-size:13px
  }

  .top-actions{
    flex-wrap:wrap;
    justify-content:flex-end
  }

  .user-pill{
    display:none
  }

  .content{
    padding:18px 12px 36px
  }

  .toolbar{
    align-items:stretch
  }

  .crumbs{
    width:100%;
    min-width:100%;
    order:-1
  }

  .search{
    width:100%;
    order:2
  }

  .toolbar .ghost,
  .toolbar .action{
    flex:1;
    text-align:center
  }

  .head{
    display:none
  }

  .row{
    grid-template-columns:minmax(0,1fr) 42px;
    padding:13px 12px
  }

  .row .date,
  .row .size{
    display:none
  }

  .panel{
    border-radius:13px
  }

  .menu-pop{
    max-width:calc(100vw - 34px)
  }

  .overlay{
    padding:0
  }

  .modal,
  .modal.large,
  .modal.medium{
    width:100%;
    height:100vh;
    max-height:none;
    border-radius:0
  }

  .modal-head{
    align-items:flex-start
  }

  .modal-head>strong{
    max-width:55%;
    overflow:hidden;
    text-overflow:ellipsis
  }

  .doc-preview{
    padding:24px 18px
  }

  .form-grid{
    grid-template-columns:1fr
  }

  .admin-table{
    min-width:740px
  }

  .login-card{
    padding:28px 22px
  }
}

/* File manager enhancements: selection, clipboard, recycle bin */

.head-name{
  display:flex;
  align-items:center;
  gap:10px
}

.row-check,
.head-name input{
  width:16px;
  height:16px;
  accent-color:#1d4ed8;
  flex:0 0 16px;
  cursor:pointer
}

.selected-row{
  background:#eff6ff!important;
  box-shadow:inset 3px 0 0 #2563eb
}

.selection-bar,
.clipboard-bar{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  margin:-4px 0 12px;
  padding:10px 12px;
  border:1px solid #dbe4ef;
  border-radius:12px;
  background:#fff;
  box-shadow:0 5px 18px #0f172a0a
}

.selection-bar span,
.clipboard-bar span{
  flex:1;
  min-width:220px;
  font-size:13px;
  font-weight:650;
  color:#475569
}

.clipboard-bar{
  border-color:#bfdbfe;
  background:#eff6ff
}

.clipboard-bar span{
  color:#1e3a8a
}

.danger-outline{
  color:#b42318!important;
  border-color:#fecaca!important;
  background:#fff!important
}

.danger-outline:hover{
  background:#fef2f2!important
}

.menu-separator{
  height:1px;
  background:#edf1f5;
  margin:5px 4px
}

.modal>.note{
  margin:12px 16px 16px
}

.admin-table td:last-child{
  white-space:nowrap
}

@media(max-width:760px){
  .selection-bar,
  .clipboard-bar{
    align-items:stretch
  }

  .selection-bar span,
  .clipboard-bar span{
    flex:1 0 100%;
    min-width:0
  }

  .selection-bar button,
  .clipboard-bar button{
    flex:1
  }

  .row-check{
    width:18px;
    height:18px;
    flex-basis:18px
  }

  .name{
    gap:8px
  }
}

/* Branding update */

.brand-logo{
  width:170px;
  height:170px;
  display:block;
  object-fit:contain;
  object-position:center;
  background:transparent
}

/* Center only the logo on the login screen */
.login-card .brand-logo{
  width:260px;
  height:auto;
  display:block;
  object-fit:contain;
  margin:0 auto 42px;
}

.brand-logo.small{
  width:40px;
  height:40px;
  flex:0 0 40px
}

.powered-by{
  margin-top:18px;
  text-align:center;
  color:#94a3b8;
  font-size:12px
}

.powered-by a{
  color:#2563eb;
  text-decoration:none;
  font-weight:700
}

.powered-by a:hover{
  text-decoration:underline
}

.app-powered{
  margin:18px auto 28px;
  max-width:1180px;
  padding:0 24px
}

@media(max-width:760px){
  .brand-logo{
    width:64px;
    height:64px
  }

  .brand-logo.small{
    width:34px;
    height:34px;
    flex-basis:34px
  }

  .app-powered{
    padding:0 12px;
    margin:14px auto 22px
  }
}

/* Center DOCUMENT PORTAL on login screen */
.login-title{
  width:100%;
  text-align:center !important;
  margin:0 0 24px;
  color:#444;
  font-weight:400;
  letter-spacing:.02em;
}