:root {
  --cc-log-bg: #16110d;
  --cc-log-panel: #fffaf1;
  --cc-log-panel-soft: #f4e7d3;
  --cc-log-line: #d7c1a0;
  --cc-log-brown: #5e402c;
  --cc-log-brown-dark: #2e2017;
  --cc-log-green: #436b46;
  --cc-log-red: #a64036;
  --cc-log-text: #34261d;
  --cc-log-muted: #806a58;
}

.cc-logs-login-page,
.cc-logs-page {
  min-height: 100dvh;
  color: var(--cc-log-text);
  background:
    radial-gradient(circle at 50% 0%, rgba(205, 166, 110, .18), transparent 38%),
    var(--cc-log-bg);
}

.cc-logs-login-page *,
.cc-logs-page * { box-sizing: border-box; }

.cc-logs-login-page input,
.cc-logs-login-page button,
.cc-logs-page input,
.cc-logs-page button { font: inherit; }

.cc-logs-login-shell {
  display: grid;
  min-height: 100dvh;
  padding: 22px;
  place-items: center;
}

.cc-logs-gate {
  width: min(100%, 380px);
  padding: 24px;
  border: 1px solid rgba(226, 202, 164, .42);
  border-radius: 18px;
  background: rgba(31, 23, 17, .94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}

.cc-logs-gate__logo {
  display: block;
  width: 122px;
  height: 88px;
  margin: 0 auto 17px;
  object-fit: contain;
}

.cc-logs-login-form { display: grid; gap: 11px; }
.cc-logs-login-form input,
.cc-log-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  color: var(--cc-log-text);
  border: 1px solid var(--cc-log-line);
  border-radius: 10px;
  background: #fffdf8;
  outline: none;
}
.cc-logs-login-form input { color: #f7efe3; border-color: #554634; background: #120e0b; }
.cc-logs-login-form input:focus,
.cc-log-search input:focus { border-color: #a87b4d; box-shadow: 0 0 0 3px rgba(168, 123, 77, .16); }
.cc-logs-login-form button,
.cc-log-more {
  min-height: 44px;
  padding: 0 15px;
  color: #fffaf1;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #76533a, #4a3325);
  font-weight: 850;
  cursor: pointer;
}

.cc-logs-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cc-logs-alert {
  margin: 0 0 14px;
  padding: 10px 12px;
  color: #7b2722;
  border: 1px solid #e3aaa5;
  border-radius: 10px;
  background: #fbe8e6;
  font-size: .86rem;
}
.cc-logs-alert[hidden] { display: none; }

.cc-logs-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 17px 0 42px;
}
.cc-logs-topbar {
  display: flex;
  min-height: 62px;
  margin-bottom: 14px;
  padding: 0 2px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #fffaf1;
  border-bottom: 1px solid rgba(226, 202, 164, .3);
}
.cc-logs-brand { display: flex; align-items: center; gap: 11px; }
.cc-logs-brand img { width: 58px; height: 46px; object-fit: contain; }
.cc-logs-brand span { display: block; color: #d9bf98; font-size: .66rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.cc-logs-brand h1 { margin: 2px 0 0; font-size: clamp(1.2rem, 2vw, 1.55rem); }
.cc-logs-close {
  display: inline-flex;
  min-height: 39px;
  padding: 0 13px;
  align-items: center;
  color: #fffaf1;
  border: 1px solid rgba(226, 202, 164, .36);
  border-radius: 9px;
  text-decoration: none;
  font-weight: 750;
}

.cc-logs-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.cc-logs-summary article {
  display: flex;
  min-width: 0;
  padding: 12px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--cc-log-line);
  border-radius: 11px;
  background: var(--cc-log-panel);
}
.cc-logs-summary span { color: var(--cc-log-muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; }
.cc-logs-summary strong { color: var(--cc-log-brown); font-size: 1.2rem; }

.cc-log-sections { display: grid; gap: 12px; }

.cc-log-archive {
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--cc-log-line);
  border-radius: 14px;
  background: var(--cc-log-panel);
}

.cc-log-section__summary {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto 24px;
  gap: 10px;
  min-height: 58px;
  padding: 10px 14px;
  align-items: center;
  color: var(--cc-log-brown-dark);
  background: linear-gradient(135deg, #fffdf8, #f6ebda);
  cursor: pointer;
  list-style: none;
}

.cc-log-section__summary::-webkit-details-marker { display: none; }
.cc-log-section__summary:hover { background: linear-gradient(135deg, #fffdf8, #f1e2ce); }
.cc-log-section__icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: #fffaf1;
  border-radius: 10px;
  background: linear-gradient(145deg, #76533a, #4a3325);
  font-weight: 900;
}
.cc-log-section__title { font-size: .98rem; font-weight: 900; }
.cc-log-section__count { color: var(--cc-log-muted); font-size: .72rem; font-weight: 800; }
.cc-log-section__chevron { color: #8b6847; font-size: 1.05rem; font-weight: 900; transition: transform 160ms ease; }
.cc-log-section[open] .cc-log-section__chevron { transform: rotate(180deg); }
.cc-log-section__body { padding: 15px 16px 16px; border-top: 1px solid var(--cc-log-line); }
.cc-log-toolbar {
  display: grid;
  grid-template-columns: minmax(210px, .75fr) minmax(280px, 1.25fr);
  gap: 16px;
  align-items: end;
  margin-bottom: 10px;
}
.cc-log-toolbar span { display: block; margin-bottom: 3px; color: #8a6d50; font-size: .63rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.cc-log-toolbar h2 { margin: 0; font-size: 1.2rem; }
.cc-log-search input { min-height: 42px; }
.cc-log-meta { margin-bottom: 10px; color: var(--cc-log-muted); font-size: .74rem; font-weight: 750; }
.cc-log-content { display: grid; gap: 9px; }
.cc-log-loading,
.cc-log-empty { padding: 18px; color: var(--cc-log-muted); border: 1px dashed var(--cc-log-line); border-radius: 10px; text-align: center; }

.cc-log-week,
.cc-log-day { overflow: hidden; border: 1px solid var(--cc-log-line); border-radius: 11px; background: #fffdf8; }
.cc-log-day { border-color: #e4d6c1; }
.cc-log-week > summary,
.cc-log-day > summary {
  display: flex;
  padding: 11px 13px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  font-weight: 850;
}
.cc-log-week > summary::-webkit-details-marker,
.cc-log-day > summary::-webkit-details-marker { display: none; }
.cc-log-week > summary { color: #fffaf1; background: linear-gradient(135deg, #715039, #3f2c20); }
.cc-log-day > summary { color: var(--cc-log-brown-dark); background: var(--cc-log-panel-soft); }
.cc-log-week > summary::after,
.cc-log-day > summary::after { content: '⌄'; transition: transform .16s ease; }
.cc-log-week:not([open]) > summary::after,
.cc-log-day:not([open]) > summary::after { transform: rotate(-90deg); }
.cc-log-count { margin-left: auto; color: inherit; font-size: .67rem; font-weight: 750; opacity: .8; }
.cc-log-days,
.cc-log-entries { display: grid; gap: 8px; padding: 8px; }
.cc-log-entries { border-top: 1px solid #eadfce; background: #fbf4e9; }

.cc-log-entry {
  min-width: 0;
  padding: 11px;
  border: 1px solid #e2d1b8;
  border-radius: 10px;
  background: #fff;
}
.cc-log-entry.is-reversed { opacity: .68; background: #f3ede5; }
.cc-log-entry__head { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.cc-log-entry__title strong,
.cc-log-entry__title small,
.cc-log-entry__title span { display: block; }
.cc-log-entry__title strong { font-size: .9rem; }
.cc-log-entry__title small { margin-top: 2px; color: var(--cc-log-muted); font-size: .68rem; }
.cc-log-entry__title span { margin-top: 4px; color: var(--cc-log-green); font-size: .67rem; font-weight: 800; }
.cc-log-entry__actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; }
.cc-log-status { padding: 4px 7px; color: #315c36; border-radius: 999px; background: #e2efdd; font-size: .64rem; font-weight: 900; }
.cc-log-entry.is-reversed .cc-log-status { color: #82451f; background: #f8dfc8; }
.cc-log-undo { min-height: 30px; padding: 0 9px; color: var(--cc-log-brown-dark); border: 1px solid #d8c2a0; border-radius: 8px; background: #f3e6d2; font-size: .67rem; font-weight: 850; cursor: pointer; }
.cc-log-entry__details { display: grid; grid-template-columns: repeat(5, minmax(105px, 1fr)); gap: 7px; }
.cc-log-detail { min-width: 0; padding: 7px 8px; border: 1px solid #eee1cf; border-radius: 8px; background: #fffaf1; }
.cc-log-detail span,
.cc-log-detail strong { display: block; }
.cc-log-detail span { margin-bottom: 2px; color: var(--cc-log-muted); font-size: .56rem; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.cc-log-detail strong { overflow-wrap: anywhere; font-size: .73rem; }
.cc-log-entry__note { margin: 8px 0 0; padding: 7px 9px; color: #6e5846; border-left: 3px solid #a77f55; background: #f7ead8; font-size: .72rem; line-height: 1.4; }
.cc-order-log-entry__items { display: grid; gap: 4px; margin-top: 8px; }
.cc-order-log-entry__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 9px;
  padding: 6px 8px;
  align-items: center;
  border-radius: 8px;
  background: #f8efe1;
  font-size: .7rem;
}
.cc-order-log-entry__item span:first-child { overflow-wrap: anywhere; font-weight: 780; }
.cc-order-log-entry__item span:not(:first-child) { color: #6f5743; font-weight: 800; }
.cc-order-log-statuses { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.cc-order-log-status {
  padding: 4px 7px;
  color: #694e36;
  border: 1px solid #dfcdb2;
  border-radius: 999px;
  background: #fff9ef;
  font-size: .62rem;
  font-weight: 850;
}
.cc-log-more { display: block; width: min(320px, 100%); margin: 12px auto 0; }
.cc-log-more[hidden] { display: none; }

@media (max-width: 900px) {
  .cc-logs-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .cc-logs-summary { grid-template-columns: 1fr; }
  .cc-log-toolbar { grid-template-columns: 1fr; }
  .cc-log-entry__details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-log-section__summary { grid-template-columns: 34px minmax(0, 1fr) 20px; }
  .cc-log-section__count { display: none; }
}

@media (max-width: 480px) {
  .cc-logs-shell { width: min(100% - 18px, 1180px); }
  .cc-log-archive { padding: 11px; }
  .cc-log-section { padding: 0; }
  .cc-log-section__body { padding: 11px; }
  .cc-log-entry__head { display: grid; }
  .cc-log-entry__actions { justify-content: start; }
  .cc-log-entry__details { grid-template-columns: 1fr; }
  .cc-order-log-entry__item { grid-template-columns: minmax(0, 1fr) auto; }
  .cc-order-log-entry__item span:last-child { grid-column: 1 / -1; }
}
