/* docs.tele-metron.com — Dark theme matching existing SVG docs */

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

body {
  font-family: 'IBM Plex Sans', sans-serif;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  min-height: 100vh;
}

a {
  color: #3b82f6;
  text-decoration: none;
}
a:hover {
  color: #60a5fa;
}

/* --- Top Nav --- */

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 56px;
  background: rgba(15, 23, 42, 0.9);
  border-bottom: 1px solid #334155;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.nav-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f8fafc;
  text-decoration: none;
}
.nav-brand span {
  color: #3b82f6;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-user {
  font-size: 0.85rem;
  color: #94a3b8;
  font-family: 'IBM Plex Mono', monospace;
}

.nav-link {
  font-size: 0.85rem;
  color: #94a3b8;
  text-decoration: none;
}
.nav-link:hover {
  color: #f8fafc;
}

/* --- Layout --- */

.layout {
  display: flex;
  min-height: calc(100vh - 56px);
  position: relative;
  z-index: 1;
}

/* --- Sidebar --- */

.sidebar {
  width: 260px;
  min-width: 260px;
  background: rgba(15, 23, 42, 0.6);
  border-right: 1px solid #334155;
  padding: 1.25rem 0;
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: 0.25rem;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
  text-decoration: none;
  transition: background 0.15s;
}
.sidebar-heading:hover {
  background: rgba(51, 65, 85, 0.4);
  color: #f8fafc;
}
.sidebar-heading.active {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}

.sidebar-icon {
  font-size: 1.1rem;
  width: 1.5rem;
  text-align: center;
}

.sidebar-docs {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
}

.sidebar-doc {
  display: block;
  padding: 0.4rem 1.25rem 0.4rem 3.25rem;
  font-size: 0.8rem;
  color: #94a3b8;
  text-decoration: none;
  transition: background 0.15s;
}
.sidebar-doc:hover {
  background: rgba(51, 65, 85, 0.4);
  color: #f8fafc;
}
.sidebar-doc.active {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.06);
}

/* --- Content --- */

.content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

/* --- Home page --- */

.home-header {
  text-align: center;
  padding: 2rem 1rem 1rem;
  max-width: 700px;
  margin: 0 auto;
}
.home-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.home-header h1 span {
  color: #3b82f6;
}
.home-header p {
  color: #94a3b8;
  font-size: 1rem;
  line-height: 1.6;
}

/* --- Cards --- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 2rem auto;
}

.card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.3s, background 0.3s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  border-color: #3b82f6;
  background: rgba(30, 41, 59, 0.9);
  color: inherit;
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.card-desc {
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.6;
  flex: 1;
}

.card-meta {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #334155;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: #64748b;
  display: flex;
  gap: 1rem;
}
.card-meta span {
  color: #94a3b8;
}

/* --- Category page --- */

.category-header {
  margin-bottom: 1.5rem;
}
.category-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.category-header p {
  color: #94a3b8;
  line-height: 1.6;
}
.category-icon {
  margin-right: 0.5rem;
}

/* --- Breadcrumb --- */

.breadcrumb {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 0.75rem;
  font-family: 'IBM Plex Mono', monospace;
}
.breadcrumb a {
  color: #94a3b8;
}
.breadcrumb a:hover {
  color: #f8fafc;
}

/* --- Document page --- */

.doc-header {
  margin-bottom: 1rem;
}
.doc-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

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

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 2rem;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}
.login-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #f8fafc;
}
.login-header h1 span {
  color: #3b82f6;
}
.login-header p {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.login-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}

.login-form {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 0.4rem;
}

.form-group input[type="text"],
.form-group input[type="password"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #475569;
  border-radius: 8px;
  color: #f8fafc;
  font-size: 0.95rem;
  font-family: 'IBM Plex Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
  border-color: #3b82f6;
}

.form-check {
  display: flex;
  align-items: center;
}
.form-check label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #94a3b8;
  cursor: pointer;
}
.form-check input[type="checkbox"] {
  accent-color: #3b82f6;
}

.btn-login {
  width: 100%;
  padding: 0.7rem;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'IBM Plex Sans', sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-login:hover {
  background: #2563eb;
}

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

.login-divider {
  display: flex;
  align-items: center;
  margin: 1.5rem 0;
  color: #64748b;
  font-size: 0.82rem;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #334155;
}
.login-divider span {
  padding: 0 0.75rem;
}

.btn-login-alt {
  background: #6366f1;
}
.btn-login-alt:hover {
  background: #4f46e5;
}

/* --- Presentation context bar --- */

.presentation-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.4rem 1rem;
  background: rgba(99, 102, 241, 0.15);
  border-bottom: 1px solid rgba(99, 102, 241, 0.3);
  font-size: 0.82rem;
  color: #a5b4fc;
  position: relative;
  z-index: 50;
}
.sidebar-pres-title {
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #a5b4fc;
  border-bottom: 1px solid #334155;
  margin-bottom: 0.25rem;
}

.presentation-bar a {
  color: #f8fafc;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.presentation-bar a:hover {
  color: #e0e7ff;
}

/* --- Demo restricted page --- */

.demo-restricted {
  text-align: center;
  padding: 4rem 2rem;
  max-width: 480px;
  margin: 0 auto;
}
.demo-restricted h2 {
  color: #e2e8f0;
  margin-bottom: 1rem;
}
.demo-restricted p {
  color: #94a3b8;
  margin-bottom: 2rem;
  line-height: 1.6;
}
.demo-restricted .btn-login {
  width: auto;
  display: inline-block;
  padding: 0.7rem 2rem;
  text-decoration: none;
}

/* --- Buttons (shared) --- */

.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  font-family: 'IBM Plex Sans', sans-serif;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s, opacity 0.2s;
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-primary {
  background: #3b82f6;
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: #2563eb;
}
.btn-secondary {
  background: #334155;
  color: #cbd5e1;
}
.btn-secondary:hover:not(:disabled) {
  background: #475569;
}
.btn-danger {
  background: #ef4444;
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background: #dc2626;
}
.btn-success {
  background: #22c55e;
  color: #fff;
}
.btn-success:hover:not(:disabled) {
  background: #16a34a;
}
.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
}

/* --- Page Header --- */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

/* --- Users Table --- */

.users-table {
  width: 100%;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid #334155;
  border-radius: 12px;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}
.users-table th,
.users-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #334155;
}
.users-table th {
  background: rgba(15, 23, 42, 0.6);
  font-weight: 600;
  color: #94a3b8;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.users-table tr:last-child td {
  border-bottom: none;
}
.users-table tr:hover td {
  background: rgba(51, 65, 85, 0.3);
}
.user-subtext {
  font-size: 0.78rem;
  color: #64748b;
}
.last-login-cell {
  font-size: 0.78rem;
  color: #64748b;
  font-family: 'IBM Plex Mono', monospace;
}
.action-buttons {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* --- Role & Status Badges --- */

.role-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 500;
}
.role-admin {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}
.role-editor {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}
.role-viewer {
  background: rgba(100, 116, 139, 0.3);
  color: #94a3b8;
}
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 500;
}
.status-active {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}
.status-inactive {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

/* --- Modals --- */

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-content {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 14px;
  padding: 1.75rem;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #334155;
}
.modal-header h2 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}
.modal-close {
  font-size: 1.5rem;
  cursor: pointer;
  color: #64748b;
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
}
.modal-close:hover {
  color: #f8fafc;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #334155;
}
.modal-note {
  color: #64748b;
  font-size: 0.85rem;
}
.modal-warning {
  color: #f87171;
  font-weight: 600;
  font-size: 0.85rem;
}

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

.modal-form-group {
  margin-bottom: 1.1rem;
}
.modal-form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 0.35rem;
}
.modal-form-group input[type="text"],
.modal-form-group input[type="email"],
.modal-form-group input[type="password"],
.modal-form-group select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #475569;
  border-radius: 8px;
  color: #f8fafc;
  font-size: 0.9rem;
  font-family: 'IBM Plex Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}
.modal-form-group input:focus,
.modal-form-group select:focus {
  border-color: #3b82f6;
}
.modal-form-group input:disabled,
.modal-form-group select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.helper-text {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.3rem;
  line-height: 1.5;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #cbd5e1;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  accent-color: #3b82f6;
}
.info-text {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: #93c5fd;
  margin-bottom: 1.25rem;
}

/* --- Password Result --- */

.password-result {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #86efac;
  line-height: 1.8;
}
.password-result code {
  background: rgba(15, 23, 42, 0.6);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  color: #f8fafc;
  user-select: all;
}
.copy-btn {
  margin-left: 0.5rem;
  padding: 0.15rem 0.5rem !important;
  font-size: 0.72rem !important;
  background: #334155;
  color: #cbd5e1;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}
.copy-btn:hover {
  background: #475569;
}

/* --- Toast --- */

.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 0.75rem 1.25rem;
  background: #22c55e;
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: none;
  z-index: 1100;
  font-size: 0.88rem;
  font-weight: 500;
}
.toast.error {
  background: #ef4444;
}

/* --- Profile Page --- */

.profile-container {
  max-width: 560px;
}
.profile-container h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}
.profile-container h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
}
.profile-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 1.5rem;
}
.profile-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid #334155;
}
.profile-field:last-child {
  border-bottom: none;
}
.profile-label {
  font-size: 0.85rem;
  color: #64748b;
  font-weight: 500;
}
.profile-value {
  font-size: 0.9rem;
  color: #f8fafc;
  font-family: 'IBM Plex Mono', monospace;
}
.profile-alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 1rem;
}
.profile-alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.profile-alert-success {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86efac;
}

/* --- Markdown Document --- */

.markdown-body {
  max-width: 820px;
  line-height: 1.7;
  font-size: 0.95rem;
  color: #e2e8f0;
}

.markdown-body h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 2rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #334155;
  color: #f8fafc;
}
.markdown-body h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 1.75rem 0 0.75rem;
  color: #f8fafc;
}
.markdown-body h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  color: #cbd5e1;
}
.markdown-body h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  color: #94a3b8;
}

.markdown-body p {
  margin: 0.75rem 0;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0.75rem 0;
  padding-left: 1.75rem;
}
.markdown-body li {
  margin: 0.3rem 0;
}
.markdown-body li > ul,
.markdown-body li > ol {
  margin: 0.2rem 0;
}

.markdown-body blockquote {
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  border-left: 3px solid #3b82f6;
  background: rgba(59, 130, 246, 0.08);
  color: #94a3b8;
}
.markdown-body blockquote p {
  margin: 0.25rem 0;
}

.markdown-body code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85em;
  background: rgba(15, 23, 42, 0.8);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  color: #e2e8f0;
}

.markdown-body pre {
  margin: 1rem 0;
  border-radius: 8px;
  overflow-x: auto;
}
.markdown-body pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.markdown-body table {
  width: 100%;
  margin: 1rem 0;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.markdown-body th,
.markdown-body td {
  padding: 0.6rem 0.85rem;
  border: 1px solid #334155;
  text-align: left;
}
.markdown-body th {
  background: rgba(15, 23, 42, 0.6);
  font-weight: 600;
  color: #94a3b8;
}
.markdown-body tr:nth-child(even) {
  background: rgba(30, 41, 59, 0.3);
}

.markdown-body hr {
  border: none;
  border-top: 1px solid #334155;
  margin: 1.5rem 0;
}

.markdown-body a {
  color: #60a5fa;
}
.markdown-body a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.markdown-body strong {
  color: #f8fafc;
}

/* --- Pygments / codehilite dark theme --- */

.codehilite {
  background: rgba(15, 23, 42, 0.9);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  border: 1px solid #1e293b;
}
.codehilite pre { margin: 0; background: none; }
.codehilite .hll { background: rgba(59, 130, 246, 0.15); }
.codehilite .c,
.codehilite .cm,
.codehilite .c1,
.codehilite .cs { color: #64748b; font-style: italic; }  /* comments */
.codehilite .k,
.codehilite .kn,
.codehilite .kd,
.codehilite .kp { color: #c084fc; }  /* keywords */
.codehilite .s,
.codehilite .s1,
.codehilite .s2,
.codehilite .sb,
.codehilite .sc,
.codehilite .se { color: #86efac; }  /* strings */
.codehilite .nb,
.codehilite .bp { color: #60a5fa; }  /* builtins */
.codehilite .nf,
.codehilite .nx { color: #38bdf8; }  /* function names */
.codehilite .nn { color: #fbbf24; }  /* module names */
.codehilite .mi,
.codehilite .mf,
.codehilite .mh,
.codehilite .mo { color: #f472b6; }  /* numbers */
.codehilite .o,
.codehilite .ow { color: #94a3b8; }  /* operators */
.codehilite .p { color: #cbd5e1; }   /* punctuation */
.codehilite .gd { color: #f87171; }  /* diff deleted */
.codehilite .gi { color: #4ade80; }  /* diff inserted */
.codehilite .gh { color: #f8fafc; font-weight: bold; }  /* diff header */
.codehilite .na { color: #38bdf8; }  /* attribute names */
.codehilite .nt { color: #f472b6; }  /* tag names */
.codehilite .nv,
.codehilite .vi,
.codehilite .vm { color: #fbbf24; }  /* variables */

/* --- Responsive --- */

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .content {
    padding: 1.25rem;
  }
  .home-header h1 {
    font-size: 1.5rem;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
}
