*{
  box-sizing:border-box;
}

html,body{
  margin:0;
  padding:0;
}

body{
  font-family:Arial,sans-serif;
  background:#f5f7fb;
  color:#162033;
}

a{
  text-decoration:none;
  color:inherit;
}

svg{
  display:block;
}

.layout{
  display:flex;
  min-height:100vh;
}

.main{
  flex:1;
  min-width:0;
}

/* SIDEBAR */
.sidebar{
  width:240px;
  background:#07224a;
  color:#fff;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  min-height:100vh;
  flex-shrink:0;
}

.brand{
  font-size:22px;
  font-weight:800;
  padding:18px;
  border-bottom:1px solid rgba(255,255,255,.14);
}

.nav{
  padding:14px 12px;
}

.nav-link{
  display:block;
  color:#dce7ff;
  padding:12px;
  border-radius:10px;
  margin-bottom:6px;
  font-weight:600;
  text-decoration:none;
}

.nav-link:hover,
.nav-link.active{
  background:rgba(255,255,255,.12);
  color:#fff;
}

.sidebar-bottom{
  padding:14px;
  border-top:1px solid rgba(255,255,255,.12);
}

.user-box{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border-radius:12px;
  background:rgba(255,255,255,.08);
}

.avatar{
  width:40px;
  height:40px;
  border-radius:999px;
  background:#1769ff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  flex-shrink:0;
  color:#fff;
}

.user-name{
  font-size:14px;
  font-weight:700;
  color:#fff;
}

.user-role{
  font-size:12px;
  color:rgba(255,255,255,.65);
  margin-top:2px;
}

.change-pass-btn,
.logout-btn{
  display:block;
  margin-top:10px;
  text-align:center;
  padding:10px;
  border-radius:10px;
  color:#fff;
  text-decoration:none;
  font-weight:700;
}

.change-pass-btn{
  background:rgba(255,255,255,.08);
}

.change-pass-btn:hover,
.change-pass-btn.active-bottom{
  background:rgba(255,255,255,.14);
}

.logout-btn{
  background:rgba(255,255,255,.08);
}

.logout-btn:hover{
  background:rgba(255,255,255,.14);
}

/* TOPBAR */
.topbar{
  height:80px;
  background:#fff;
  border-bottom:1px solid #e6ebf2;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 22px;
  gap:18px;
}

.content{
  padding:22px;
}

.page-title{
  font-size:28px;
  font-weight:800;
  margin:0 0 20px;
  color:#0f274e;
}

.search-wrap{
  flex:1;
  max-width:620px;
  position:relative;
}

.search-wrap input{
  width:100%;
  height:44px;
  border:1px solid #d8dfeb;
  border-radius:12px;
  padding:0 16px 0 42px;
  font-size:14px;
  outline:none;
  background:#fff;
  color:#24324d;
}

.search-wrap svg{
  position:absolute;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  width:18px;
  height:18px;
  stroke:currentColor;
  fill:none;
  color:#8c97aa;
}

.top-actions{
  display:flex;
  align-items:center;
  gap:12px;
}

/* BUTTONS */
.btn,
.toolbar-btn{
  height:42px;
  border:none;
  border-radius:12px;
  background:#1769ff;
  color:#fff;
  padding:0 16px;
  font-weight:700;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
}

.btn.secondary,
.toolbar-btn.secondary{
  background:#fff;
  color:#24324d;
  border:1px solid #d8dfeb;
}

.toolbar-btn{
  background:#fff;
  color:#24324d;
  border:1px solid #d8dfeb;
  font-weight:600;
}

.toolbar-btn.primary{
  background:#1769ff;
  border:1px solid #1769ff;
  color:#fff;
}

.input,
.select{
  height:44px;
  border:1px solid #d8dfeb;
  border-radius:10px;
  padding:0 12px;
  font-size:14px;
  background:#fff;
  width:100%;
  color:#24324d;
}

.row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

.hidden{
  display:none !important;
}

/* SECTIONS */
.section-title{
  font-size:15px;
  font-weight:800;
  margin:10px 0 14px;
  color:#162033;
}

/* FOLDERS */
.folder-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(210px,1fr));
  gap:14px;
  margin-bottom:24px;
}

.folder-card{
  background:#fff;
  border:1px solid #dce4ef;
  border-radius:12px;
  padding:16px;
  min-height:72px;
  display:flex;
  align-items:center;
  gap:10px;
}

.folder-card strong{
  font-size:15px;
  font-weight:700;
  color:#24324d;
}

/* FILES */
.file-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
  gap:16px;
}

.file-card{
  background:#fff;
  border:1px solid #d6deea;
  border-radius:12px;
  overflow:hidden;
}

.file-preview{
  height:180px;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  padding:10px;
  border-bottom:1px solid #e6ebf2;
}

.file-preview img{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
  background:#fff;
}

.file-body{
  padding:12px 14px 14px;
}

.file-row-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}

.file-name{
  font-size:14px;
  font-weight:700;
  color:#17233b;
  line-height:1.35;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  flex:1;
}

.file-meta{
  font-size:12px;
  color:#6d7890;
  display:flex;
  gap:4px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.file-actions-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}

/* ICON BUTTON */
.icon-btn,
.mini-btn{
  border:none;
  background:transparent;
  color:#8a95aa;
  cursor:pointer;
  padding:0;
  width:20px;
  height:20px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.icon-btn:hover,
.mini-btn:hover{
  color:#1769ff;
}

.icon-btn svg,
.mini-btn svg{
  width:18px;
  height:18px;
  stroke:currentColor;
  fill:none;
}

/* TABLE */
.table{
  width:100%;
  border-collapse:collapse;
}

.table th,
.table td{
  padding:12px;
  border-bottom:1px solid #e6ebf2;
  text-align:left;
  vertical-align:top;
}

/* CARD */
.card{
  background:#fff;
  border:1px solid #e1e8f2;
  border-radius:16px;
  padding:24px;
}

.cards{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:16px;
  margin-bottom:18px;
}

.card-stat{
  background:#fff;
  border:1px solid #e1e8f2;
  border-radius:16px;
  padding:22px;
}

.card-stat .value{
  font-size:34px;
  font-weight:800;
  margin-bottom:8px;
}

.card-stat .label{
  font-size:14px;
  color:#66748b;
  font-weight:600;
}

/* EMPTY */
.empty-box{
  background:#fff;
  border:1px solid #dce4ef;
  border-radius:14px;
  padding:24px;
  color:#5c687f;
}

/* MODAL */
.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(7,18,37,0.45);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:200;
  padding:20px;
}

.modal{
  width:100%;
  max-width:520px;
  background:#fff;
  border-radius:16px;
  padding:22px;
  box-shadow:0 20px 60px rgba(0,0,0,.16);
}

.modal.large{
  max-width:920px;
  min-height:520px;
}

.modal h3{
  margin:0 0 14px;
  color:#1f2b45;
}

.upload-drop-zone{
  min-height:320px;
  border:2px dashed #d7dde8;
  border-radius:10px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:30px;
  background:#fcfcfd;
}

/* CHART */
.chart{
  display:flex;
  align-items:flex-end;
  gap:12px;
  height:260px;
  padding-top:12px;
  border-bottom:1px solid #edf1f7;
}

.bar-wrap{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
  height:100%;
}

.bar{
  width:100%;
  max-width:60px;
  background:linear-gradient(180deg,#8ab9ff,#4c8dff);
  border-radius:10px 10px 0 0;
  min-height:6px;
}

.bar-value,
.bar-label{
  font-size:12px;
  color:#6b7891;
}

.bar-label{
  margin-top:10px;
  text-align:center;
  word-break:break-word;
}

/* TOAST */
.toast{
  position:fixed;
  right:20px;
  bottom:20px;
  background:#111827;
  color:#fff;
  padding:12px 16px;
  border-radius:10px;
  font-size:14px;
  opacity:0;
  transform:translateY(10px);
  pointer-events:none;
  transition:.2s;
  z-index:10000;
}

.toast.show{
  opacity:1;
  transform:translateY(0);
}