:root {
  --bg-color: #fff;
  --bg-content: #fff;
  --text-color: #222;
  --text-secondary: #9b9b9b;
  --border-color: #e9e9e9;
  --link-color: #222;
  --link-hover: #df4e09;
  --accent-color: #4487b9;
  --header-bg: #fff;
  --header-text: #222;
  --nav-bg: #f9f9f9;
  --tag-bg: #f9f9f9;
  --footer-bg: #f9f9f9;
  --footer-text: #444;
  --story-bg: #fff;
  --meta-color: #9b9b9b;
  --id-color: #fff;
  --id-bg: #4487b9;
  --like-color: #9b9b9b;
  --like-hover: #4487b9;
  --input-bg: #fff;
  --input-border: #222;
  --input-text: #222;
  --blockquote-border: #4487b9;
  --code-bg: #f9f9f9;
  --cloud-tag1: #cacaca;
  --cloud-tag2: #aeaeae;
  --cloud-tag3: #929292;
  --cloud-tag4: #767676;
  --cloud-tag5: #5a5a5a;
  --cloud-tag6: #3e3e3e;
  --cloud-tag7: #222;
}

[data-theme="dark"] {
  --bg-color: #1c1410;
  --bg-content: #2a1f1a;
  --text-color: #e0d8d0;
  --text-secondary: #b0a090;
  --border-color: #3a2a22;
  --link-color: #ff8c42;
  --link-hover: #ffa64d;
  --accent-color: #ff8c42;
  --header-bg: #0f0a08;
  --header-text: #ddd;
  --nav-bg: #0f0a08;
  --tag-bg: #1c1410;
  --footer-bg: #0f0a08;
  --footer-text: #8a7a6a;
  --story-bg: #2a1f1a;
  --meta-color: #9a8a7a;
  --id-color: #e0d8d0;
  --id-bg: #4a3a2a;
  --like-color: #c0b0a0;
  --like-hover: #ff8c42;
  --input-bg: #1c1410;
  --input-border: #3a2a22;
  --input-text: #e0d8d0;
  --blockquote-border: #ff8c42;
  --code-bg: #1c1410;
  --cloud-tag1: #5a4a3a;
  --cloud-tag2: #6a5a4a;
  --cloud-tag3: #7a6a5a;
  --cloud-tag4: #8a7a6a;
  --cloud-tag5: #a09080;
  --cloud-tag6: #c0b0a0;
  --cloud-tag7: #e0d8d0;
}

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

html {
  position: relative;
  min-height: 100%;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 100%;
  line-height: 1.5;
  margin-bottom: 140px;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.4s ease-out;
}

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

.wrapper {
  position: relative;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 0 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}

/* Header */
.header {
  background: var(--header-bg);
  padding: 24px 0 10px;
}

.header .wrapper {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  height: auto;
}

.logo a {
  color: var(--header-text);
  font-size: 28px;
  font-weight: bold;
  letter-spacing: -1px;
}

.logo a:hover {
  color: var(--link-hover);
  text-decoration: none;
}

.services {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
}

.services a {
  color: var(--header-text);
  font-size: 18px;
}

.services a:hover {
  color: var(--link-hover);
}

.services form {
  display: inline;
}

#search-query {
  background: var(--input-bg);
  border: none;
  border-bottom: 1px solid var(--input-border);
  color: var(--input-text);
  padding: 2px 4px;
  font-size: 13px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: normal;
  width: 180px;
  vertical-align: middle;
}

#search-query:focus {
  outline: none;
}

/* Theme toggle */
.theme-toggle {
  cursor: pointer;
  color: var(--header-text);
  font-size: 16px;
  font-style: normal;
}

.theme-toggle input {
  display: none;
}

.icon-theme {
  font-style: normal;
}

.icon-theme::before {
  content: "☾";
}

.theme-toggle input:checked + .icon-theme::before {
  content: "☀";
}

/* Nav */
.nav-stories {
  background: var(--nav-bg);
  box-shadow: inset 0 0 20px rgba(0,0,0,0.03);
  line-height: 28px;
  padding-top: 2px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font: normal 14px/22px "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.nav-stories .wrapper {
  display: flex;
  align-items: center;
}

.nav-stories .label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-right: 15px;
  white-space: nowrap;
  display: none;
}

.nav-stories ul {
  list-style: none;
  display: flex;
  gap: 0;
}

.nav-stories ul li {
  margin: 0;
  margin-right: 25px;
  border-bottom: 2px solid transparent;
  margin-bottom: 2px;
  white-space: nowrap;
}

.nav-stories ul li a {
  display: block;
  padding: 7px 0;
  font-size: 13px;
  color: var(--text-color);
  text-shadow: 0 1px 0 #fff;
}

.nav-stories ul li a:hover {
  background: none;
  color: var(--link-hover);
  text-shadow: 0 1px 5px #fff;
  text-decoration: none;
}

.nav-stories ul li.nav-submit {
  margin-left: auto;
}

/* Burger menu button - hidden by default */
.burger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 18px;
  cursor: pointer;
  padding: 0 10px;
  line-height: 28px;
}

/* Main */
.main {
  background: var(--bg-color);
  padding: 20px 0;
}

.main .wrapper {
  display: flex;
  gap: 20px;
}

.sidebar {
  width: 200px;
  flex-shrink: 0;
  font: normal 13px/19px "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.content {
  flex: 1;
  min-width: 0;
  width: 645px;
  max-width: 645px;
  padding-bottom: 30px;
}

/* Sidebar */
.sidebar > * {
  margin-top: 30px;
}

.sidebar > *:first-child {
  margin-top: 0;
}

.sidebar .section {
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 0;
  border-radius: 0;
}

.sidebar .section h3 {
  font: normal 14px/22px "Helvetica Neue", Helvetica, Arial, sans-serif;
  border-bottom: 2px solid var(--accent-color);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar .section h3 a {
  color: var(--text-color);
}

.sidebar .section .tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.sidebar .section .tags li {
  display: inline;
}

.sidebar .section .tags li a {
  padding: 2px 4px;
  border-radius: 2px;
  color: var(--link-color);
}

.sidebar .section ul.best {
  list-style: none;
}

.sidebar .section ul.best li {
  margin-bottom: 10px;
  font-size: 13px;
  line-height: 1.4;
  position: relative;
}

.sidebar .section ul.best li a {
  display: block;
  margin-left: 54px;
  color: var(--link-color);
}

.sidebar .section ul.best li .rating {
  position: absolute;
  top: 0;
  right: auto;
  left: 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 21px;
  letter-spacing: 1px;
  text-align: left;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: normal;
  margin-right: 0;
}

/* Sidebar tag cloud */
.sidebar .section .cloud {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-right: -14px;
  max-width: 280px;
}

.sidebar .section .cloud li {
  display: inline-block;
  margin-right: 14px;
  margin-bottom: 6px;
}

.sidebar .section .cloud li a {
  font-weight: 300;
  color: #3e3e3e;
}

.sidebar .section .cloud li a:hover {
  color: var(--link-hover);
}

.sidebar .section .tag1 a { font-size: 10px; color: var(--cloud-tag1); }
.sidebar .section .tag2 a { font-size: 11px; color: var(--cloud-tag2); }
.sidebar .section .tag3 a { font-size: 11px; color: var(--cloud-tag3); }
.sidebar .section .tag4 a { font-size: 12px; color: var(--cloud-tag4); }
.sidebar .section .tag5 a { font-size: 12px; color: var(--cloud-tag5); }
.sidebar .section .tag6 a { font-size: 13px; color: var(--cloud-tag6); }
.sidebar .section .tag7 a { font-size: 13px; color: var(--cloud-tag7); }

/* Story */
.story {
  /*background: var(--story-bg);*/
  border: none;
  padding: 0;
  margin-bottom: 30px;
  margin-top: 35px;
  border-radius: 0;
  position: relative;
}

.story:first-child {
  margin-top: 0;
}

.story .id {
  position: absolute;
  left: -55px;
  width: 55px;
  /*top: 9px;*/
  text-align: right;
  font-size: inherit;
  color: inherit;
  font-weight: normal;
  line-height: 1;
}

.story .id span {
  display: inline-block;
  border-radius: 10px;
  margin-right: 10px;
  padding: 3px 6px;
  background: var(--id-bg);
  color: var(--id-color);
  text-shadow: 0 1px 1px rgba(0,0,0,0.15);
  font: normal 11px/17px "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.story h1,
.story h2 {
  font-size: 20px;
  font-weight: normal;
  margin-bottom: 8px;
  line-height: 1.3;
  padding-right: 0;
}

.story h1 {
  font-size: 27px;
  font-weight: normal;
  line-height: 32px;
  letter-spacing: -1px;
  /*margin-top: 26px;*/
  margin-bottom: 8px;
  position: relative;
  top: -4px;
}

.story h1 a,
.story h2 a {
  color: var(--text-color);
}

.story h1 a:hover,
.story h2 a:hover {
  color: var(--link-hover);
}

.meta {
  font-size: 12px;
  color: var(--meta-color);
  margin-bottom: 15px;
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
  text-transform: uppercase;
  letter-spacing: 1px;
  font: normal 11px/18px "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.meta .date-time {
  padding-right: 30px;
  color: var(--meta-color);
  white-space: nowrap;
}

.meta .tags ul {
  display: inline;
  list-style: none;
}

.meta .tags ul li {
  display: inline;
  margin-right: 12px;
}

.meta .tags ul li::after {
  content: "";
}

.meta .tags ul li:last-child::after {
  content: "";
}

.meta .tags ul li a {
  color: var(--meta-color);
  font: normal 11px/18px "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.meta .tags ul li a:hover {
  color: var(--link-hover);
}

.meta .tags i {
  margin-right: 9px;
}

.text {
  font-size: 15px;
  line-height: 23px;
  margin-bottom: 15px;
  overflow-wrap: break-word;
  word-wrap: break-word;
  hyphens: auto;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.text p {
  margin-bottom: 12px;
}

.text br {
  display: block;
  margin: 5px 0;
}

.text a {
  color: #004cbe;
}

.text a:hover {
  color: var(--link-hover);
}

.text blockquote {
  padding: 0 15px;
  margin-left: 15px;
  border-left: 1px solid var(--blockquote-border);
}

.text code {
  border-radius: 3px;
  padding: 0 0.4em;
  letter-spacing: -1px;
  font-family: "Courier New", Courier, monospace;
  display: inline-block;
  background: var(--code-bg);
}

.text pre {
  white-space: pre-wrap;
  background: var(--code-bg);
  margin-bottom: 12px;
}

.text hr {
  border: none;
  margin-bottom: 12px;
}

.text hr:after {
  display: block;
  width: 100%;
  color: var(--text-secondary);
  content: "\00b7 \00b7 \00b7";
  text-align: center;
  letter-spacing: 0.3em;
  font-size: 30px;
}

/* Actions / Like */
.actions {
  border-top: none;
  padding-top: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-secondary);
  font: normal 12px/30px "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.actions i,
.actions .rating,
.actions .label,
.actions .button,
.actions .button-group {
  display: inline-block;
  vertical-align: middle;
}

.button-group {
  display: flex;
  align-items: center;
}

.button-group.like {
  margin-right: 25px;
}

.button-group.like .button {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  color: var(--like-color);
}

.button-group.like .button:hover {
  background: none;
}

.button-group.like .button:hover .rating {
  color: var(--like-hover);
}

.button-group.like .button.voted {
  opacity: 0.6;
  cursor: default;
}

.button-group.like .button.voting {
  opacity: 0.5;
  cursor: default;
}

.button-group.like .rating {
  font-weight: normal;
  color: var(--like-color);
  font-size: 15px;
  margin-left: 4px;
  overflow: hidden;
}

/* Share buttons */
.share-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 25px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 3px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.share-btn:hover {
  text-decoration: none;
}

.share-btn-vk:hover {
  background: #4a76a8;
  color: #fff;
  border-color: #4a76a8;
}

.share-btn-tg:hover {
  background: #0088cc;
  color: #fff;
  border-color: #0088cc;
}

.share-btn-tw:hover {
  background: #000;
  color: #fff;
  border-color: #000;
}

.share-btn-copy:hover {
  background: var(--link-color);
  color: #fff;
  border-color: var(--link-color);
}

.share-btn-copy.copied {
  background: #28a745;
  color: #fff;
  border-color: #28a745;
}

/* Navigation */
.nav {
  margin-bottom: 20px;
  /*margin-top: 30px;*/
}

.nav-common ul {
  list-style: none;
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  font: normal 14px/22px "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-common ul li {
  display: inline;
  float: left;
  border-bottom: 2px solid transparent;
  margin-bottom: 2px;
  margin-right: 16px;
  position: relative;
}

.nav-common ul li a {
  display: block;
  padding: 7px 0;
  border: none;
  border-radius: 0;
  font-size: 13px;
  background: none;
  color: var(--text-color);
}

.nav-common ul li a:hover {
  background: none;
  color: var(--link-hover);
}

.nav-common ul li.current {
  border-color: var(--accent-color);
  padding: 7px 0;
  font-weight: normal;
  font-size: 13px;
  border-bottom: 2px solid var(--accent-color);
  margin-bottom: 2px;
}

.nav-common ul li.last a span {
  font-weight: bold;
}

.nav-bottom {
  margin-top: 10px;
  margin-bottom: 20px;
}

.nav-bottom .prev {
  float: left;
}

.nav-bottom .next {
  float: right;
  margin-right: 0;
}

/* Icons - Font Awesome overrides */
.icon-rss,
.icon-search,
.icon-tags,
.icn-like {
  font-style: normal;
}

/* Tag cloud (full page) */
.tag-cloud {
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
}

.tag-cloud .cloud {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-right: -20px;
  font: normal 16px/32px "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.tag-cloud .cloud li {
  display: inline-block;
  margin-right: 20px;
  white-space: nowrap;
}

.tag-cloud .cloud li a {
  padding: 5px 0;
  color: var(--text-color);
}

.tag-cloud .cloud li a:hover {
  color: var(--link-hover) !important;
}

.tag-cloud .tag1 a { font-size: 13px; color: var(--cloud-tag1); }
.tag-cloud .tag2 a { font-size: 14px; color: var(--cloud-tag2); }
.tag-cloud .tag3 a { font-size: 15px; color: var(--cloud-tag3); }
.tag-cloud .tag4 a { font-size: 16px; color: var(--cloud-tag4); }
.tag-cloud .tag5 a { font-size: 17px; font-weight: normal; color: var(--cloud-tag5); }
.tag-cloud .tag6 a { font-size: 18px; font-weight: normal; color: var(--cloud-tag6); }
.tag-cloud .tag7 a { font-size: 18px; font-weight: normal; color: var(--cloud-tag7); }

/* Search info, tag header */
.search-info,
.tag-header {
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 20px;
  border-radius: 0;
}

.search-info h2,
.tag-header h2 {
  font-size: 18px;
  margin-bottom: 5px;
  margin-top: 0;
}

/* Best years/months navigation */
.nav-years ul,
.nav-months ul {
  list-style: none;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font: normal 12px/18px "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-years ul li,
.nav-months ul li {
  float: left;
  border-bottom: 2px solid transparent;
  margin-bottom: 2px;
  margin-right: 12px;
}

.nav-years ul li.current,
.nav-months ul li.current {
  border-color: var(--accent-color);
}

.nav-years ul li a,
.nav-months ul li a {
  display: block;
  padding: 4px 0;
  font-size: 11px;
  color: var(--text-color);
}

.nav-years ul li a:hover,
.nav-months ul li a:hover {
  color: var(--link-hover);
}

.nav-months {
  margin-top: 6px;
}

.nav-months li {
  font-size: 10px;
  line-height: 16px;
}

/* Footer */
.footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: 20px 0;
  font-size: 12px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.03);
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: auto;
  min-height: 80px;
  font: normal 12px/17px "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.footer .wrapper {
  display: block;
}

.footer p {
  margin-bottom: 15px;
}

.footer a {
  color: var(--footer-text);
  white-space: nowrap;
  font-weight: bold;
}

.footer a:hover {
  color: var(--link-hover);
}

.footer .rated-18 {
  font-weight: bold;
  color: #c00;
  border: 1px solid var(--text-secondary);
  border-radius: 10px;
  padding: 2px 5px;
}

.footer span {
  margin-right: 19px;
}

/* ===== Responsive ===== */

@media (max-width: 1060px) {
  .story .id {
    position: static;
    display: inline-block;
    width: auto;
    top: auto;
    left: auto;
    text-align: left;
    vertical-align: middle;
    margin-right: 6px;
  }

  .story .id span {
    margin-right: 0;
  }

  .story h1,
  .story h2 {
    display: inline;
    /*font-size: 17px;*/
    line-height: 1.4;
  }

  .story h1 {
    /*font-size: 22px;*/
    line-height: 26px;
    margin-top: 30px;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 13px;
  }

  .wrapper {
    padding: 0 8px;
  }

  .content {
    max-width: 100%;
    width: 100%;
  }

  /* Header */
  .header {
    padding: 15px 0 8px;
  }

  .logo a {
    font-size: 22px;
  }

  .services {
    gap: 5px;
  }

  .services a {
    font-size: 16px;
  }

  #search-query {
    width: 120px;
    font-size: 11px;
  }

  /* Nav - burger menu */
  .nav-stories {
    line-height: 34px;
    position: relative;
  }

  .nav-stories .label {
    display: none;
  }

  .burger-btn {
    display: block;
  }

  .nav-stories ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  }

  .nav-stories ul.open {
    display: flex;
  }

  .nav-stories ul li {
    margin-right: 0;
    border-bottom: none;
    margin-bottom: 0;
  }

  .nav-stories ul li a {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 8px 16px;
  }

  /* Main layout */
  .main {
    padding: 10px 0;
  }

  .main .wrapper {
    flex-direction: column;
    gap: 10px;
  }

  .sidebar {
    width: 100%;
    order: -1;
  }

  /* Story */
  .story {
    padding: 0;
    margin-bottom: 20px;
    margin-top: 25px;
  }

  .meta {
    gap: 8px;
    font-size: 11px;
  }

  .text {
    font-size: 14px;
    line-height: 21px;
  }

  .text blockquote {
    padding: 0 10px;
    margin-left: 10px;
  }

  /* Tag cloud */
  .tag-cloud {
    padding: 0;
  }

  .tag-cloud .cloud {
    gap: 5px;
  }

  .tag-cloud .cloud li {
    margin-right: 12px;
  }

  /* Search info, tag header */
  .search-info,
  .tag-header {
    padding: 0;
  }

  .search-info h2,
  .tag-header h2 {
    font-size: 15px;
  }

  /* Footer */
  .footer {
    padding: 15px 0;
    font-size: 11px;
    min-height: auto;
  }

  .footer p {
    margin-bottom: 10px;
  }

  /* Nav years/months */
  .nav-years ul,
  .nav-months ul {
    flex-wrap: wrap;
    gap: 3px;
  }

  .nav-years ul li,
  .nav-months ul li {
    margin-right: 10px;
  }

  .nav-years ul li a,
  .nav-months ul li a {
    padding: 3px 0;
    font-size: 12px;
  }

  /* Share buttons */
  .share-buttons {
    gap: 4px;
  }

  .share-btn {
    width: 26px;
    height: 26px;
    font-size: 12px;
  }

  /* Actions */
  .actions {
    font-size: 11px;
  }

  .button-group.like .rating {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .header .wrapper {
    flex-wrap: wrap;
    gap: 0;
  }

  .logo {
    flex-shrink: 0;
  }

  .logo a {
    font-size: 18px;
  }

  .services {
    gap: 4px;
  }

  .services a {
    font-size: 14px;
  }

  #search-query {
    width: 90px;
    font-size: 10px;
    padding: 2px 3px;
  }

  .story {
    margin-bottom: 15px;
  }

  .story h1 {
    font-size: 19px;
  }

  .story h2 {
    font-size: 15px;
  }

  .button-group.like .button {
    padding: 0;
    font-size: 12px;
  }

  .nav-common ul li a {
    padding: 5px 0;
    font-size: 12px;
  }

  .actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .share-buttons {
    margin-left: 0;
  }
}

/* Admin panel styles */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
  font-size: 14px;
}
.admin-table thead th {
  background: var(--nav-bg);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-color);
}
.admin-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background 0.15s;
}
.admin-table tbody tr:nth-child(even) {
  background: var(--nav-bg);
}
.admin-table tbody tr:hover {
  background: var(--tag-bg);
}
.admin-table tbody td {
  padding: 8px 12px;
  vertical-align: middle;
  color: var(--text-color);
}
.admin-table .actions {
  white-space: nowrap;
  display: flex;
  gap: 4px;
  align-items: center;
}
.admin-table .actions form {
  margin: 0;
}
.admin .button.small-btn {
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}
.admin .button.small-btn i {
  font-size: 13px;
}
.admin .publish-btn {
  background: #4CAF50;
  color: white;
  border: none;
  cursor: pointer;
}
.admin .publish-btn:hover {
  background: #45a049;
}
.admin .unpublish-btn {
  background: #ff9800;
  color: white;
  border: none;
  cursor: pointer;
}
.admin .unpublish-btn:hover {
  background: #f57c00;
}
.admin .reject-btn {
  background: #f44336;
  color: white;
  border: none;
  cursor: pointer;
}
.admin .reject-btn:hover {
  background: #d32f2f;
}
.status-published {
  color: #4CAF50;
  font-weight: 500;
}
.status-draft {
  color: #ff9800;
  font-weight: 500;
}
.status-unknown {
  color: var(--text-secondary);
}
.admin .edit-form {
  max-width: 800px;
  margin: 20px 0;
}
.admin .edit-form label {
  display: block;
  margin-bottom: 15px;
  font-weight: bold;
  color: var(--text-color);
}
.admin .edit-form input[type='text'],
.admin .edit-form input[type='number'],
.admin .edit-form input[type='date'],
.admin .edit-form select,
.admin .edit-form textarea {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--input-text);
  box-sizing: border-box;
}
.admin .edit-form textarea {
  min-height: 300px;
  resize: vertical;
  font-family: inherit;
}
.admin .edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.admin .edit-actions .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}
.admin .edit-actions .cancel-btn {
  background: var(--nav-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}
.admin .edit-actions .cancel-btn:hover {
  background: var(--border-color);
}
.admin .pager {
  margin: 20px 0;
  display: flex;
  gap: 10px;
}
.admin .pager a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--nav-bg);
  color: var(--text-color);
  text-decoration: none;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}
.admin .pager a:hover {
  background: var(--border-color);
}
.admin .submission {
  background: var(--story-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 15px;
  margin-bottom: 15px;
}
.admin .submission h3 {
  margin: 0 0 5px 0;
  font-size: 16px;
}
.admin .submission .meta {
  color: var(--text-secondary);
  font-size: 12px;
  margin: 0 0 10px 0;
}
.admin .submission .text {
  margin-bottom: 10px;
  line-height: 1.5;
  max-height: 200px;
  overflow-y: auto;
}
.admin .submission form {
  display: inline;
  margin-right: 8px;
}
.admin .submission .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  border: none;
  color: white;
  background: #4CAF50;
}
.admin .submission .button:hover {
  background: #45a049;
}
.admin .submission .edit-btn {
  background: var(--accent-color);
}
.admin .submission .edit-btn:hover {
  opacity: 0.9;
}
.admin .submission-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}
.admin .submission-actions form {
  display: inline;
  margin: 0;
}
.admin .submission-rejected {
  opacity: 0.75;
  border-left: 3px solid #f44336;
}
.admin .status-rejected {
  color: #f44336;
  font-weight: 500;
  margin-left: 10px;
}
.admin .status-pending {
  color: #ff9800;
  font-weight: 500;
  margin-left: 10px;
}
.admin-nav {
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.admin-nav .button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  color: white;
  background: var(--accent-color);
  text-decoration: none;
  transition: opacity 0.15s;
}
.admin-nav .button:hover {
  opacity: 0.9;
}
.pending-link {
  position: relative;
}
.pending-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #f44336;
  color: white;
  font-size: 12px;
  font-weight: bold;
  line-height: 1;
}

/* Admin edit form additional styles */
.admin .edit-form {
  background: var(--story-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 24px;
}
.admin .edit-form label {
  font-size: 14px;
  margin-bottom: 18px;
}
.admin .edit-form input[type='text'],
.admin .edit-form input[type='number'],
.admin .edit-form input[type='date'],
.admin .edit-form select {
  padding: 10px;
  font-size: 14px;
  border-radius: 6px;
}
.admin .edit-form input[name='title'] {
  font-size: 18px;
  font-weight: 600;
  padding: 12px 10px;
  border-width: 2px;
}
.admin .edit-form textarea {
  padding: 10px;
  font-size: 14px;
  border-radius: 6px;
  line-height: 1.5;
}
.admin .edit-form label:first-of-type {
  margin-top: 0;
}
.admin .edit-form label:has(input[name='title']) {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 18px;
  margin-bottom: 18px;
}
.admin .edit-form input:focus,
.admin .edit-form textarea:focus,
.admin .edit-form select:focus {
  border-color: var(--accent-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(68, 135, 185, 0.15);
}
.admin .edit-form select {
  cursor: pointer;
}
.admin .edit-actions .button[type='submit'] {
  background: var(--accent-color);
  color: white;
  border: none;
}
.admin .edit-actions .button[type='submit']:hover {
  opacity: 0.9;
}
.admin h2 {
  font-size: 20px;
  margin-bottom: 15px;
  color: var(--text-color);
}
.admin h2 i {
  margin-right: 8px;
}
.admin h1 {
  font-size: 24px;
  margin-bottom: 20px;
  color: var(--text-color);
}
.admin > p {
  color: var(--text-secondary);
  font-size: 14px;
}
.admin .button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  color: white;
  background: var(--accent-color);
  text-decoration: none;
  transition: opacity 0.15s;
}
.admin .button:hover {
  opacity: 0.9;
}
