/* SD Workspace — Simpaul Design brand system.
   Tokens: Dark #213343, Light #faf9f5, Mid #b0aea5, Light Gray #e8e6dc,
   Orange #ff5e29 (primary accent), Red #ff5f74, Green #788c5d.
   8px spacing scale; Plus Jakarta Sans, hierarchy by weight. */

:root {
  --dark: #213343;
  --light: #faf9f5;
  --mid: #b0aea5;
  --lightgray: #e8e6dc;
  --orange: #ff5e29;
  --red: #ff5f74;
  --green: #788c5d;
  --s-xs: 4px; --s-sm: 8px; --s-md: 16px; --s-lg: 24px; --s-xl: 32px; --s-2xl: 48px;
  --radius: 10px;
}

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

body {
  font-family: "Plus Jakarta Sans", Arial, sans-serif;
  background: var(--light);
  color: var(--dark);
  font-size: 15px;
  line-height: 1.5;
}

button { font: inherit; cursor: pointer; }
input, select { font: inherit; }
[v-cloak] { display: none; }

/* ---------- Login ---------- */

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--dark);
}
.login-card {
  background: var(--light);
  border-radius: var(--radius);
  padding: var(--s-2xl);
  width: min(400px, 90vw);
}
.login-card .brand {
  font-weight: 700;
  font-size: 24px;
  margin-bottom: var(--s-xs);
}
.login-card .brand span { color: var(--orange); }
.login-card .sub { color: var(--mid); margin-bottom: var(--s-lg); }
.field { margin-bottom: var(--s-md); }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: var(--s-xs);
}
.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--lightgray);
  border-radius: 8px;
  background: #fff;
}
.field input:focus { outline: 2px solid var(--orange); outline-offset: -1px; border-color: transparent; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s-sm);
  border: 1px solid var(--lightgray);
  background: #fff;
  color: var(--dark);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
}
.btn:hover { border-color: var(--mid); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.primary:hover { filter: brightness(0.94); }
.btn.danger:hover { border-color: var(--red); color: var(--red); }
.btn.block { width: 100%; justify-content: center; padding: 11px; }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--lightgray); }
.btn.sm { padding: 4px 10px; font-size: 13px; }

.error-note {
  background: #fff;
  border: 1px solid var(--red);
  color: var(--dark);
  border-left: 4px solid var(--red);
  padding: var(--s-sm) var(--s-md);
  border-radius: 8px;
  margin-bottom: var(--s-md);
  font-size: 14px;
}

/* ---------- App shell ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: var(--dark);
  color: var(--light);
  display: flex;
  flex-direction: column;
  padding: var(--s-lg) var(--s-md);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand {
  font-weight: 700;
  font-size: 18px;
  padding: 0 var(--s-sm);
  margin-bottom: var(--s-xl);
}
.sidebar .brand span { color: var(--orange); }
.side-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mid);
  padding: 0 var(--s-sm);
  margin-bottom: var(--s-sm);
}
.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--light);
  padding: 8px var(--s-sm);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
}
.side-item:hover { background: rgba(250, 249, 245, 0.08); }
.side-item.active { background: rgba(255, 94, 41, 0.18); }
.side-item .dot {
  width: 10px; height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.side-item .ico { width: 20px; text-align: center; }
.sidebar .spacer { flex: 1; }
.side-user {
  border-top: 1px solid rgba(250, 249, 245, 0.15);
  padding-top: var(--s-md);
  margin-top: var(--s-md);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.side-user .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.side-user .who { flex: 1; min-width: 0; }
.side-user .who .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who .rl { font-size: 12px; color: var(--mid); text-transform: capitalize; }
.side-user .logout {
  background: none; border: 0;
  color: var(--mid);
  font-size: 12px; font-weight: 600;
}
.side-user .logout:hover { color: var(--orange); }

/* ---------- Main pane ---------- */

.main {
  flex: 1;
  min-width: 0;
  padding: var(--s-xl) var(--s-2xl);
  max-width: 1200px;
}
.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--s-xs);
  font-size: 13px;
  color: var(--mid);
  margin-bottom: var(--s-sm);
  min-height: 20px;
}
.crumbs button {
  background: none; border: 0;
  color: var(--mid);
  font-size: 13px; font-weight: 500;
  padding: 0;
}
.crumbs button:hover { color: var(--orange); }
.crumbs .sep { color: var(--lightgray); }
.crumbs .here { color: var(--dark); font-weight: 600; }

.page-head {
  display: flex;
  align-items: center;
  gap: var(--s-md);
  margin-bottom: var(--s-lg);
}
.page-head h1 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  flex: 1;
  min-width: 0;
}
.page-head h1 .ws-dot { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.head-actions { display: flex; gap: var(--s-sm); flex-shrink: 0; }

.section-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mid);
  margin: var(--s-lg) 0 var(--s-sm);
}

/* folder grid */
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--s-md);
}
.folder-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--lightgray);
  border-radius: var(--radius);
  padding: var(--s-md);
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  color: var(--dark);
  position: relative;
}
.folder-card:hover { border-color: var(--orange); }
.folder-card .fico { font-size: 20px; }
.folder-card .meta { font-size: 12px; color: var(--mid); font-weight: 500; }
.folder-card .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* file table */
.file-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--lightgray); border-radius: var(--radius); overflow: hidden; }
.file-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mid);
  padding: 10px var(--s-md);
  border-bottom: 1px solid var(--lightgray);
}
.file-table td {
  padding: 10px var(--s-md);
  border-bottom: 1px solid var(--lightgray);
  font-size: 14px;
  vertical-align: middle;
}
.file-table tr:last-child td { border-bottom: 0; }
.file-table tr:hover td { background: var(--light); }
.file-table .fname { font-weight: 600; display: flex; align-items: center; gap: var(--s-sm); }
.file-table .dim { color: var(--mid); font-size: 13px; white-space: nowrap; }
.row-actions { display: flex; gap: var(--s-xs); justify-content: flex-end; opacity: 0; }
tr:hover .row-actions, .folder-card:hover .row-actions { opacity: 1; }
.icon-btn {
  border: 0; background: none;
  color: var(--mid);
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 14px;
}
.icon-btn:hover { background: var(--lightgray); color: var(--dark); }
.icon-btn.danger:hover { color: var(--red); }

.empty {
  border: 1px dashed var(--lightgray);
  border-radius: var(--radius);
  padding: var(--s-xl);
  text-align: center;
  color: var(--mid);
  font-size: 14px;
}

/* version pill */
.pill {
  display: inline-block;
  background: var(--lightgray);
  color: var(--dark);
  font-size: 11px;
  font-weight: 600;
  border-radius: 99px;
  padding: 1px 8px;
}

/* ---------- Activity feed ---------- */

.feed { display: flex; flex-direction: column; gap: 0; background: #fff; border: 1px solid var(--lightgray); border-radius: var(--radius); }
.feed-item {
  display: flex;
  gap: var(--s-md);
  padding: var(--s-md);
  border-bottom: 1px solid var(--lightgray);
  font-size: 14px;
  align-items: baseline;
}
.feed-item:last-child { border-bottom: 0; }
.feed-item .when { color: var(--mid); font-size: 12px; white-space: nowrap; margin-left: auto; }
.feed-item .who { font-weight: 600; }
.feed-item .act { color: var(--green); font-weight: 600; }
.feed-item .act.deleted { color: var(--red); }

/* ---------- Modal ---------- */

.overlay {
  position: fixed; inset: 0;
  background: rgba(33, 51, 67, 0.55);
  display: grid; place-items: center;
  z-index: 50;
}
.modal {
  background: var(--light);
  border-radius: var(--radius);
  padding: var(--s-lg);
  width: min(440px, 92vw);
  max-height: 84vh;
  overflow-y: auto;
}
.modal h3 { font-size: 18px; font-weight: 600; margin-bottom: var(--s-md); }
.modal .actions { display: flex; justify-content: flex-end; gap: var(--s-sm); margin-top: var(--s-lg); }

.member-row {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  padding: var(--s-sm) 0;
  border-bottom: 1px solid var(--lightgray);
  font-size: 14px;
}
.member-row:last-child { border-bottom: 0; }
.member-row .who { flex: 1; min-width: 0; }
.member-row .who .em { color: var(--mid); font-size: 12px; }
.member-row select {
  border: 1px solid var(--lightgray);
  border-radius: 6px;
  padding: 4px 6px;
  background: #fff;
  font-size: 13px;
}

/* toast */
.toast {
  position: fixed;
  bottom: var(--s-lg);
  left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: var(--light);
  padding: 10px 18px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  z-index: 60;
  box-shadow: 0 6px 24px rgba(33, 51, 67, 0.3);
}
.toast.err { background: var(--red); color: #fff; }

/* drag & drop */
.dropzone.dragging { outline: 2px dashed var(--orange); outline-offset: 4px; border-radius: var(--radius); }

@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--s-xs); }
  .sidebar .brand { margin-bottom: 0; margin-right: var(--s-md); }
  .side-label { display: none; }
  .side-item { width: auto; }
  .sidebar .spacer { display: none; }
  .side-user { border-top: 0; padding-top: 0; margin-top: 0; margin-left: auto; }
  .main { padding: var(--s-lg) var(--s-md); }
}
