/* ============================================================
   FiveRoster — Shared Stylesheet
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: #0f1117;
  color: #e2e4eb;
  min-height: 100vh;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #0f1117; }
::-webkit-scrollbar-thumb { background: #2e3a52; border-radius: 3px; }

/* ── APP SHELL ── */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: #161b27;
  border-right: 1px solid #1e2a3d;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
}

.main { flex: 1; margin-left: 260px; min-height: 100vh; }

/* ── SIDEBAR ── */
.sb-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid #1e2a3d;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sb-logo-mark {
  width: 32px; height: 32px;
  background: #f5c518;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sb-logo-mark svg { width: 18px; height: 18px; fill: #000; }
.sb-logo-text { font-size: 1rem; font-weight: 700; color: #fff; }

.sb-avatar {
  padding: 16px 20px;
  border-bottom: 1px solid #1e2a3d;
  display: flex; align-items: center; gap: 12px;
}
.sb-avatar-img {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid #f5c518;
  background: #2e3a52;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #f5c518; font-size: .9rem;
  flex-shrink: 0;
}
.sb-avatar-info { flex: 1; min-width: 0; }
.sb-avatar-name {
  font-size: .88rem; font-weight: 600; color: #e2e4eb;
  display: flex; align-items: center; gap: 6px;
}
.verified { color: #f5c518; font-size: .7rem; }
.sb-avatar-sub { font-size: .75rem; color: #6b7a99; margin-top: 2px; }

.sb-nav {
  flex: 1;
  padding: 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.sb-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: .84rem; font-weight: 500;
  color: #8892b0;
  text-decoration: none;
  border: none; background: none;
  width: 100%; text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: 'Inter', sans-serif;
}
.sb-link:hover { background: rgba(255,255,255,.06); color: #e2e4eb; }
.sb-link.active { background: rgba(245,197,24,.1); color: #f5c518; }
.sb-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.sb-premium {
  margin: 12px;
  background: #1f1040;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid #6b36c8;
}
.sb-premium-title {
  font-size: .8rem; font-weight: 700; color: #c084fc;
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.sb-premium p { font-size: .75rem; color: #a78bfa; line-height: 1.5; margin-bottom: 12px; }
.sb-premium-btn {
  background: #7c3aed; color: #fff;
  border: none; border-radius: 5px;
  padding: 7px 14px; font-size: .78rem; font-weight: 600;
  cursor: pointer; width: 100%;
  font-family: 'Inter', sans-serif;
  transition: background .15s;
}
.sb-premium-btn:hover { background: #6d28d9; }

.lang-bar { padding: 12px 20px; border-top: 1px solid #1e2a3d; }
.lang-btn {
  background: #1e2a3d; border: none; color: #8892b0;
  font-size: .75rem; padding: 5px 12px; border-radius: 4px; cursor: pointer;
  font-family: 'Inter', sans-serif;
}

/* ── PAGE WRAPPER ── */
.page-content { padding: 32px 36px; max-width: 1100px; }

.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 1.5rem; font-weight: 700; color: #e8eaf6; }
.page-header .sub { font-size: .84rem; color: #6b7a99; margin-top: 4px; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: none; border-radius: 6px;
  padding: 8px 16px; font-size: .8rem; font-weight: 600;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: background .15s;
  text-decoration: none;
}
.btn-primary { background: #f5c518; color: #000; }
.btn-primary:hover { background: #e6b800; }
.btn-ghost { background: transparent; color: #8892b0; border: 1px solid #2e3a52; }
.btn-ghost:hover { background: rgba(255,255,255,.05); color: #e2e4eb; }

/* ── NOTICE ── */
.notice {
  background: #1a1f35; border: 1px solid #2e3a52; border-radius: 8px;
  padding: 14px 16px; display: flex; gap: 12px; margin-bottom: 24px;
}
.notice-icon { color: #f5c518; flex-shrink: 0; margin-top: 1px; }
.notice-icon svg { width: 18px; height: 18px; }
.notice-title { font-size: .84rem; font-weight: 600; color: #c8cde6; margin-bottom: 3px; }
.notice p { font-size: .78rem; color: #6b7a99; line-height: 1.5; }

/* ── ROSTER CARD ── */
.roster-card {
  background: #161b27; border: 1px solid #1e2a3d; border-radius: 10px;
  padding: 18px 20px; display: flex; align-items: center; gap: 16px;
  cursor: pointer; transition: border-color .15s, background .15s;
  margin-bottom: 12px; text-decoration: none;
}
.roster-card:hover { border-color: #3d47c9; background: #1a1f35; }
.roster-icon {
  width: 48px; height: 48px; border-radius: 8px;
  background: #1e2a3d;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.roster-info { flex: 1; }
.roster-name { font-size: .95rem; font-weight: 600; color: #e2e4eb; }
.roster-meta { font-size: .78rem; color: #6b7a99; margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.roster-rank { font-size: .78rem; color: #8892b0; display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.roster-arrow { color: #4a5568; }
.roster-arrow svg { width: 16px; height: 16px; }

/* ── SERVER SECTION ── */
.section-title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; margin-top: 36px;
}
.section-title { font-size: 1.1rem; font-weight: 700; color: #e8eaf6; }
.section-count { font-size: .8rem; color: #6b7a99; margin-top: 2px; }
.btn-row { display: flex; gap: 10px; }

/* ── SERVER GRID ── */
.server-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }

.server-card {
  background: #161b27; border: 1px solid #1e2a3d;
  border-radius: 10px; overflow: hidden;
  transition: border-color .15s, background .15s;
}
.server-card:hover { border-color: #f5c518; background: #1a1f2a; }
.server-card-body { padding: 20px 18px; }

.server-icon {
  width: 48px; height: 48px; border-radius: 8px;
  background: #1e2a3d;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.server-icon .placeholder { font-size: 1.1rem; font-weight: 700; color: #6b7a99; }
.server-name {
  font-size: .9rem; font-weight: 600; color: #e2e4eb;
  margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.role-badge {
  display: inline-block; font-size: .68rem; font-weight: 700;
  padding: 2px 8px; border-radius: 3px; letter-spacing: .04em;
  text-transform: uppercase; margin-bottom: 10px;
}
.role-owner { background: #2d2008; color: #f5c518; }
.role-admin { background: #1a1f3a; color: #7c86f0; }
.server-desc { font-size: .78rem; color: #6b7a99; line-height: 1.5; }

.server-card-footer { border-top: 1px solid #1e2a3d; padding: 10px 18px; }
.install-btn {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; background: #1e2a3d; color: #8892b0;
  border: none; border-radius: 5px; padding: 9px 0;
  font-size: .82rem; font-weight: 600; cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.install-btn:hover { background: #f5c518; color: #000; }
.install-btn svg { width: 14px; height: 14px; }

/* ── TEMPLATES ── */
.filter-row {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 24px; align-items: center;
}
.filter-btn {
  background: #161b27; border: 1px solid #1e2a3d; color: #8892b0;
  padding: 7px 16px; border-radius: 6px; font-size: .8rem; font-weight: 500;
  cursor: pointer; font-family: 'Inter', sans-serif; transition: all .15s;
}
.filter-btn:hover { border-color: #3d47c9; color: #e2e4eb; }
.filter-btn.active { background: #1a1f3a; border-color: #3d47c9; color: #7c86f0; }
.filter-search {
  flex: 1; min-width: 200px; background: #161b27; border: 1px solid #1e2a3d;
  color: #e2e4eb; padding: 7px 14px; border-radius: 6px;
  font-size: .82rem; font-family: 'Inter', sans-serif; outline: none;
}
.filter-search:focus { border-color: #3d47c9; }
.filter-search::placeholder { color: #4a5568; }

.template-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.template-card {
  background: #161b27; border: 1px solid #1e2a3d;
  border-radius: 10px; overflow: hidden; transition: border-color .15s;
  display: flex; flex-direction: column;
}
.template-card:hover { border-color: #3d47c9; }
.template-card-header { padding: 18px 18px 12px; flex: 1; }
.template-tag {
  font-size: .68rem; font-weight: 700; padding: 2px 8px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; display: inline-block;
}
.tag-police  { background: #0c1a3d; color: #7c86f0; }
.tag-fire    { background: #2d0d00; color: #f97316; }
.tag-ems     { background: #0d2818; color: #86efac; }
.tag-military{ background: #1f0d2e; color: #c084fc; }
.tag-community{background: #2d1a00; color: #f5c518; }

.template-name { font-size: .9rem; font-weight: 600; color: #e2e4eb; margin-bottom: 5px; }
.template-desc { font-size: .78rem; color: #6b7a99; line-height: 1.5; margin-bottom: 12px; }
.template-meta { display: flex; align-items: center; gap: 12px; font-size: .74rem; color: #4a5568; }
.template-meta span { display: flex; align-items: center; gap: 4px; }
.template-meta svg { width: 13px; height: 13px; }

.template-card-footer {
  border-top: 1px solid #1e2a3d; padding: 10px 18px; display: flex; gap: 8px;
}
.use-btn {
  flex: 1; background: #1a1f3a; color: #7c86f0; border: none;
  border-radius: 5px; padding: 8px 0; font-size: .8rem; font-weight: 600;
  cursor: pointer; font-family: 'Inter', sans-serif; transition: background .15s;
}
.use-btn:hover { background: #3d47c9; color: #fff; }
.preview-btn {
  background: transparent; color: #4a5568; border: 1px solid #1e2a3d;
  border-radius: 5px; padding: 8px 12px; font-size: .8rem;
  cursor: pointer; font-family: 'Inter', sans-serif; transition: all .15s;
}
.preview-btn:hover { border-color: #6b7a99; color: #8892b0; }

/* ── UPLOAD MODAL ── */
.modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.75); z-index: 500;
  align-items: center; justify-content: center;
}
.modal-bg.open { display: flex; }
.modal {
  background: #161b27; border: 1px solid #2e3a52; border-radius: 14px;
  padding: 32px; width: 100%; max-width: 480px; position: relative;
}
.modal h3 { font-size: 1.1rem; font-weight: 700; color: #e8eaf6; margin-bottom: 6px; }
.modal .modal-sub { font-size: .82rem; color: #6b7a99; margin-bottom: 24px; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: #6b7a99; cursor: pointer; padding: 4px;
}
.modal-close:hover { color: #e2e4eb; }
.modal-close svg { width: 18px; height: 18px; }

.form-group { margin-bottom: 18px; }
.form-label {
  font-size: .8rem; font-weight: 600; color: #8892b0;
  margin-bottom: 6px; display: block;
  text-transform: uppercase; letter-spacing: .06em;
}
.form-input, .form-select, .form-textarea {
  width: 100%; background: #0f1117; border: 1px solid #2e3a52;
  color: #e2e4eb; border-radius: 6px; padding: 10px 14px;
  font-size: .84rem; font-family: 'Inter', sans-serif; outline: none;
  transition: border-color .15s;
}
.form-input:focus, .form-textarea:focus { border-color: #3d47c9; }
.form-input::placeholder, .form-textarea::placeholder { color: #4a5568; }
.form-textarea { resize: vertical; min-height: 90px; }
.form-select { appearance: none; }

.drop-zone {
  border: 2px dashed #2e3a52; border-radius: 8px; padding: 28px;
  text-align: center; cursor: pointer; transition: border-color .15s;
}
.drop-zone:hover { border-color: #3d47c9; }
.drop-zone svg { width: 28px; height: 28px; color: #4a5568; margin: 0 auto 10px; display: block; }
.drop-zone p { font-size: .82rem; color: #6b7a99; }
.drop-zone span { font-size: .76rem; color: #4a5568; }

.modal-actions { display: flex; gap: 10px; margin-top: 24px; }

/* ── DOCS ── */
.docs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.doc-card {
  background: #161b27; border: 1px solid #1e2a3d;
  border-radius: 10px; padding: 24px 20px; cursor: pointer;
  transition: border-color .15s, background .15s; text-decoration: none; display: block;
}
.doc-card:hover { border-color: #f5c518; background: #1a1f2a; }
.doc-icon {
  width: 40px; height: 40px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}
.doc-card h3 { font-size: .9rem; font-weight: 600; color: #e2e4eb; margin-bottom: 6px; }
.doc-card p { font-size: .78rem; color: #6b7a99; line-height: 1.5; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #1a2a1a; border: 1px solid #16a34a; border-radius: 8px;
  padding: 14px 18px; font-size: .84rem; color: #86efac;
  display: none; z-index: 1000;
  animation: slideup .2s ease;
}
.toast.show { display: block; }
@keyframes slideup { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-260px); }
  .main { margin-left: 0; }
  .server-grid { grid-template-columns: 1fr 1fr; }
  .template-grid { grid-template-columns: 1fr 1fr; }
  .docs-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .server-grid { grid-template-columns: 1fr; }
  .template-grid { grid-template-columns: 1fr; }
  .page-content { padding: 20px 16px; }
}
/* ── Toast ── */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: #1e2a3d; color: #e2e4eb;
  padding: 10px 22px; border-radius: 8px; font-size: .84rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  z-index: 9999; white-space: nowrap; border: 1px solid #2e3a52;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-error { background: #2d0a0a; border-color: #7f1d1d; color: #fca5a5; }

/* ── Skeleton loading ── */
.skeleton-block {
  background: linear-gradient(90deg, #161b27 25%, #1e2a3d 50%, #161b27 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
