/* ============================================================
   Newsdesk – Stylesheet
   ============================================================ */

:root {
  --accent:        #e8380d;
  --accent-hover:  #c62e08;
  --bg:            #141414;
  --bg-card:       #1e1e1e;
  --bg-card2:      #252525;
  --border:        #2e2e2e;
  --text:          #e8e8e8;
  --text-muted:    #888;
  --topbar-h:      60px;
  --radius:        8px;
}

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

html, body {
  height: 100%;
  background: var(--bg) !important;
  color: var(--text) !important;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

/* ── Topbar ─────────────────────────────────────── */
.nd-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: #0f0f0f;
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  margin-right: 32px;
}
.nd-brand-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
}
.nd-brand-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.nd-nav {
  list-style: none;
  display: flex;
  gap: 4px;
  flex: 1;
  align-items: center;
}
.nd-nav a {
  padding: 6px 14px;
  border-radius: 6px;
  color: var(--text-muted);
  font-weight: 500;
  transition: background .15s, color .15s;
}
.nd-nav a:hover { background: var(--bg-card2); color: var(--text); }
.nd-nav a.active { background: var(--accent); color: #fff; }

.nd-user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nd-user-name { font-size: 13px; color: var(--text-muted); }
.nd-avatar-btn {
  width: 36px; height: 36px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
}

/* ── Main ────────────────────────────────────────── */
.nd-main {
  padding-top: var(--topbar-h);
  min-height: 100vh;
}
.nd-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ── Page header ─────────────────────────────────── */
.nd-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.nd-page-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}
.nd-page-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 10px;
}

/* ── Cards ───────────────────────────────────────── */
.nd-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.nd-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
}
.nd-card-body { padding: 20px; }

/* ── Stats row ───────────────────────────────────── */
.nd-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.nd-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.nd-stat-value {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.nd-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.nd-stat-accent .nd-stat-value { color: var(--accent); }

/* ── Table ───────────────────────────────────────── */
.nd-table-wrap { overflow-x: auto; }
.nd-table {
  width: 100%;
  border-collapse: collapse;
}
.nd-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.nd-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.nd-table tr:last-child td { border-bottom: none; }
.nd-table tr:hover td { background: rgba(255,255,255,.025); }

.nd-table .title-cell a { color: var(--text); font-weight: 500; }
.nd-table .title-cell a:hover { color: var(--accent); }
.nd-table .sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Thumb in table ──────────────────────────────── */
.nd-thumb {
  width: 64px;
  height: 42px;
  object-fit: cover;
  border-radius: 4px;
  background: #2a2a2a;
}
.nd-thumb-placeholder {
  width: 64px; height: 42px;
  background: var(--bg-card2);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
}

/* ── Status badges ───────────────────────────────── */
.nd-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}
.nd-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.nd-status.published  { background: rgba(25,135,84,.2);  color: #2ecc71; }
.nd-status.draft      { background: rgba(108,117,125,.2);color: #aaa; }
.nd-status.archived   { background: rgba(0,0,0,.3);      color: #666; }

/* ── Action buttons ──────────────────────────────── */
.nd-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.nd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: opacity .15s;
  text-decoration: none;
  color: #fff;
}
.nd-btn:hover { opacity: .8; color: #fff; }
.nd-btn-edit    { background: #0d6efd; }
.nd-btn-copy    { background: #6c757d; }
.nd-btn-mail    { background: #198754; }
.nd-btn-share   { background: #0dcaf0; color: #000; }
.nd-btn-search  { background: #6c757d; }
.nd-btn-stats   { background: #ffc107; color: #000; }
.nd-btn-delete  { background: #dc3545; }
.nd-btn-invoice { background: #198754; }
.nd-btn-pdf     { background: #6f42c1; }

/* ── Buttons ─────────────────────────────────────── */
.btn-accent {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: background .15s;
  font-size: 14px;
}
.btn-accent:hover { background: var(--accent-hover); color: #fff; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 7px 16px;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: border-color .15s;
}
.btn-outline:hover { border-color: var(--accent); color: var(--text); }

/* ── Search bar ──────────────────────────────────── */
.nd-search {
  display: flex;
  gap: 8px;
}
.nd-search input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 14px;
  color: var(--text);
  font-size: 14px;
  width: 240px;
  outline: none;
  transition: border-color .15s;
}
.nd-search input:focus { border-color: var(--accent); }
.nd-search input::placeholder { color: var(--text-muted); }
.nd-search button {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 12px;
  color: var(--text);
  cursor: pointer;
}

/* ── Forms ───────────────────────────────────────── */
.nd-form-group { margin-bottom: 20px; }
.nd-form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.nd-form-group input,
.nd-form-group select,
.nd-form-group textarea {
  width: 100%;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}
.nd-form-group input:focus,
.nd-form-group select:focus,
.nd-form-group textarea:focus { border-color: var(--accent); }
.nd-form-group textarea { resize: vertical; min-height: 120px; }
.nd-form-group select option { background: #1e1e1e; }
.nd-form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.nd-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0 24px;
}

/* ── Upload zone ─────────────────────────────────── */
.nd-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.nd-upload-zone:hover,
.nd-upload-zone.dragover {
  border-color: var(--accent);
  background: rgba(232,56,13,.05);
}
.nd-upload-zone .icon { font-size: 40px; margin-bottom: 12px; }
.nd-upload-zone .label { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.nd-upload-zone .hint  { font-size: 13px; color: var(--text-muted); }
.nd-upload-zone input[type=file] { display: none; }

/* Upload progress list */
.nd-upload-list { margin-top: 16px; }
.nd-upload-item {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nd-upload-item .name  { flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nd-upload-item .size  { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.nd-upload-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 6px;
}
.nd-upload-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .2s;
}

/* ── Media grid ──────────────────────────────────── */
.nd-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.nd-media-item {
  position: relative;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.nd-media-item img,
.nd-media-item .nd-media-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}
.nd-media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--text-muted);
  background: var(--bg-card2);
}
.nd-media-info {
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nd-media-del {
  position: absolute;
  top: 6px; right: 6px;
  width: 26px; height: 26px;
  background: rgba(220,53,69,.85);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.nd-media-item:hover .nd-media-del { display: flex; }

/* ── Tabs ────────────────────────────────────────── */
.nd-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.nd-tab {
  padding: 10px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s;
}
.nd-tab:hover { color: var(--text); }
.nd-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Pagination ──────────────────────────────────── */
.nd-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.nd-page-info { font-size: 13px; color: var(--text-muted); }

/* ── Alert ───────────────────────────────────────── */
.nd-alert {
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 20px;
  font-size: 14px;
}
.nd-alert-success { background: rgba(25,135,84,.15);  border: 1px solid rgba(25,135,84,.3);  color: #2ecc71; }
.nd-alert-error   { background: rgba(220,53,69,.15);  border: 1px solid rgba(220,53,69,.3);  color: #e74c3c; }
.nd-alert-warning { background: rgba(255,193,7,.1);   border: 1px solid rgba(255,193,7,.3);  color: #ffc107; }
.nd-alert-info    { background: rgba(13,202,240,.1);  border: 1px solid rgba(13,202,240,.3); color: #0dcaf0; }

/* ── Login page ──────────────────────────────────── */
.nd-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.nd-login-box {
  width: 100%;
  max-width: 420px;
  padding: 0 16px;
}
.nd-login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.nd-login-logo .icon {
  width: 60px; height: 60px;
  background: var(--accent);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  margin-bottom: 14px;
}
.nd-login-logo h1 { font-size: 24px; font-weight: 700; color: #fff; }
.nd-login-logo p  { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.nd-login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}
.nd-login-card h2 { font-size: 18px; font-weight: 700; margin-bottom: 24px; }
.nd-login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Invoice print ───────────────────────────────── */
@media print {
  .nd-topbar, .nd-actions, .btn-accent, .btn-outline { display: none !important; }
  .nd-main { padding-top: 0; }
  body { background: #fff; color: #000; }
  .nd-card { border: none; }
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  .nd-content { padding: 16px 12px; }
  .nd-page-header { flex-wrap: wrap; gap: 12px; }
  .nd-stats { grid-template-columns: repeat(2, 1fr); }
  .nd-table th:nth-child(n+5), .nd-table td:nth-child(n+5) { display: none; }
}

/* ── Bootstrap overrides ─────────────────────────── */
.badge { font-weight: 600; }
.dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.dropdown-item { color: var(--text); font-size: 14px; }
.dropdown-item:hover { background: var(--bg-card2); color: var(--text); }
.dropdown-divider { border-color: var(--border); }
.modal-content { background: var(--bg-card); border: 1px solid var(--border); }
.modal-header  { border-color: var(--border); }
.modal-footer  { border-color: var(--border); }
