/*
 * Modal Theme: Slate
 * Jediný zdroj stylů pro .modal-theme-slate (#modalEditAkce).
 * Inline <style> blok v modal.php byl odstraněn — vše je zde.
 */

/* ── CSS proměnné ───────────────────────────────────────────────────────────── */
.modal-theme-slate {
  --accent:        #52525b;
  --accent-hover:  #3f3f46;
  --text-primary:  #18181b;
  --text-secondary:#71717a;
  --text-muted:    #a1a1aa;
  --border:        #e5e7eb;
  --border-light:  #f4f4f5;
  --bg-subtle:     #fafafa;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */
.modal-theme-slate .modal-dialog {
  max-height: calc(100vh - 3.5rem);
  display: flex;
  flex-direction: column;
}

.modal-theme-slate .modal-content {
  border: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  max-height: 100%;
  overflow: hidden;
}

.modal-theme-slate #editAkceForm {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.modal-theme-slate .modal-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
}
.modal-theme-slate .modal-title {
  font-size: 16px;
  font-weight: 400;
  letter-spacing: -.02em;
  color: var(--text-primary);
}
.modal-theme-slate #modalHeaderActions .btn {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  font-size: 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-secondary);
  transition: all .15s ease;
}
.modal-theme-slate #modalHeaderActions .btn:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}
.modal-theme-slate #modalHeaderActions .btn-primary {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: #fff;
}
.modal-theme-slate #modalHeaderActions .btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ── Body wrapper ──────────────────────────────────────────────────────────── */
.modal-theme-slate .modal-body-wrapper {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}

/* ── Sidebar ───────────────────────────────────────────────────────────────── */
.modal-theme-slate .modal-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 60px;
  min-width: 60px;
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 20px 0 16px;
  gap: 12px;
}
.modal-theme-slate .sidebar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  position: relative;
  opacity: 0.42;
  transform: scale(0.82);
  transition: opacity .15s ease, transform .15s ease;
}
.modal-theme-slate .sidebar-btn:hover {
  opacity: 0.65;
  transform: scale(0.9);
  background: transparent;
}
.modal-theme-slate .sidebar-btn.active {
  color: var(--accent);
  background: transparent;
  opacity: 1;
  transform: scale(1);
}
.modal-theme-slate .sidebar-btn.active::after {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: currentColor;
  transition: all .2s ease;
}
.modal-theme-slate .sidebar-btn .badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}
.modal-theme-slate .sidebar-separator {
  width: 20px;
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* ── Modal body ────────────────────────────────────────────────────────────── */
.modal-theme-slate .modal-body-wrapper > .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: #fff;
  padding: 20px 32px;
}

/* ── Section wrappers ──────────────────────────────────────────────────────── */
.modal-theme-slate .section-wrapper {
  margin-top: 20px;
  margin-bottom: 20px;
}
.modal-theme-slate .section-wrapper.section-first {
  margin-top: 0;
}
/* Technika sekce — na desktopu mírně oddělit od sekce výše (na mobilu zůstává standard) */
@media (min-width: 768px) {
  .modal-theme-slate .section-wrapper.section-technika {
    margin-top: 60px;
  }
}
.modal-theme-slate .section-wrapper > h6 {
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ── Labels ────────────────────────────────────────────────────────────────── */
.modal-theme-slate .form-label {
  font-weight: 700;
  color: #000;
  margin-bottom: 4px;
  letter-spacing: .06em;
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* ── Row gutter — víc vzduchu mezi řadami formuláře ────────────────────────── */
.modal-theme-slate .row.g-3 {
  --bs-gutter-y: 1.4rem;
}

/* ── Inputs ────────────────────────────────────────────────────────────────── */
.modal-theme-slate .form-control,
.modal-theme-slate .form-control-sm,
.modal-theme-slate .form-select {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid #d4d4d8;
  padding: 6px 0 8px;
  background: transparent;
  transition: all .15s ease;
  font-size: 0.95rem;
  color: #52525b;
}
.modal-theme-slate .form-control:hover:not(:disabled),
.modal-theme-slate .form-control-sm:hover:not(:disabled),
.modal-theme-slate .form-select:hover:not(:disabled) {
  border-bottom-color: var(--accent) !important;
}
.modal-theme-slate .form-control:focus,
.modal-theme-slate .form-control-sm:focus,
.modal-theme-slate .form-select:focus {
  border-bottom-color: var(--accent);
  box-shadow: none;
  outline: none;
}
.modal-theme-slate .form-control:disabled,
.modal-theme-slate .form-control-sm:disabled,
.modal-theme-slate .form-select:disabled {
  background: transparent;
  color: var(--text-secondary);
  border-bottom-color: var(--border) !important;
  border-left: 2px dotted var(--text-muted);
  padding-left: 8px !important;
  cursor: default;
  opacity: 1;
}

/* ── Textareas ─────────────────────────────────────────────────────────────── */
.modal-theme-slate textarea.form-control {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
  border: 1px solid var(--border);
  padding: 12px;
  background: var(--bg-subtle);
  transition: all .15s ease;
}
.modal-theme-slate textarea.form-control:hover:not(:disabled) {
  border-color: var(--accent) !important;
}
.modal-theme-slate textarea.form-control:focus {
  border-color: var(--accent);
  background: #fff;
}

/* ── Auto-grow textarey (záložka Program) ──────────────────────────────────── */
.modal-theme-slate textarea.auto-grow {
  resize: none;
  overflow: hidden;
  min-height: 0;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.modal-theme-slate .modal-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 16px 24px;
}
.modal-theme-slate .modal-footer .text-muted {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
}
.modal-theme-slate .modal-footer .text-muted i {
  color: #d4d4d8;
}

/* ── Input groups ──────────────────────────────────────────────────────────── */
.modal-theme-slate .input-group-text {
  border-radius: 0;
  font-size: 18px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 8px 12px 8px 0;
}

/* ── Dropzone ──────────────────────────────────────────────────────────────── */
.modal-theme-slate #dropZone {
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: auto !important;
  border: 1px dashed #d4d4d8 !important;
  border-radius: 0 !important;
  background: var(--bg-subtle);
  padding: 32px !important;
  text-align: center !important;
  transition: border-color .2s;
  cursor: pointer;
}
.modal-theme-slate #dropZone:hover {
  border-color: var(--text-muted) !important;
}
.modal-theme-slate #dropZone br { display: none; }
.modal-theme-slate #dropZone i {
  color: var(--text-muted);
}
.modal-theme-slate #dropZone .small {
  color: var(--text-muted);
  font-size: 0.8rem;
}
.modal-theme-slate #dropZone.drag-over {
  border-color: var(--accent) !important;
  background: var(--border-light);
}

/* ── Ridery – přílohy ──────────────────────────────────────────────────────── */
.modal-theme-slate .priloha-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  color: var(--accent-hover);
}
.modal-theme-slate .priloha-row:last-child {
  border-bottom: none;
}
.modal-theme-slate .priloha-row a {
  color: var(--accent-hover);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}
.modal-theme-slate .priloha-row a:hover {
  color: var(--text-primary);
}
.modal-theme-slate .priloha-row a i {
  color: var(--text-muted);
}
.modal-theme-slate .priloha-row:hover,
.modal-theme-slate .priloha-row:has(:focus-within) {
  background: var(--bg-subtle);
  border-radius: 4px;
}
.modal-theme-slate .btn-priloha-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: #d4d4d8;
  font-size: 0.75rem;
  cursor: pointer;
  border-radius: 2px;
  flex-shrink: 0;
  transition: color .15s, background .15s;
}
.modal-theme-slate .btn-priloha-delete:hover {
  color: #ef4444;
  background: #fef2f2;
}

/* ── Spacer pro zarovnání řádků bez minus tlačítka ─────────────────────────── */
.modal-theme-slate .btn-spacer {
  display: inline-block;
  width: 26px;
  flex-shrink: 0;
}

/* ── Sdílený styl icon tlačítek (26px) ─────────────────────────────────────── */
.modal-theme-slate .btn-goout-id-minus,
.modal-theme-slate .btn-goout-id-plus,
.modal-theme-slate .btn-remove-napoj,
.modal-theme-slate .btn-pr-todo-minus,
.modal-theme-slate .btn-pr-todo-plus,
.modal-theme-slate .btn-promo-minus,
.modal-theme-slate .btn-promo-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #e4e4e7;
  background: #fff;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 2px;
  transition: color .15s, background .15s, border-color .15s;
}
/* Minus — červený hover */
.modal-theme-slate .btn-goout-id-minus:hover,
.modal-theme-slate .btn-remove-napoj:hover,
.modal-theme-slate .btn-pr-todo-minus:hover,
.modal-theme-slate .btn-promo-minus:hover {
  color: #ef4444;
  background: #fef2f2;
  border-color: #fca5a5;
}
/* Plus — šedý hover */
.modal-theme-slate .btn-goout-id-plus:hover,
.modal-theme-slate .btn-pr-todo-plus:hover,
.modal-theme-slate .btn-promo-plus:hover {
  color: var(--accent);
  background: var(--border-light);
  border-color: var(--text-muted);
}

/* ── Nápoje ────────────────────────────────────────────────────────────────── */
.modal-theme-slate .napoje-row {
  border: none !important;
  border-radius: 0;
  padding: 6px 0 !important;
  margin-bottom: 0 !important;
  background: transparent;
}
.modal-theme-slate #btn-add-napoj,
.modal-theme-slate #btnTiskNapoje {
  border: none;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 2px 0;
  transition: color .15s, border-bottom-color .15s;
}
.modal-theme-slate #btn-add-napoj:hover,
.modal-theme-slate #btnTiskNapoje:hover {
  background: transparent;
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

/* ── PR To-Do ──────────────────────────────────────────────────────────────── */
.modal-theme-slate .pr-todo-col-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 2px;
}
.modal-theme-slate .pr-todo-row:not(:first-child) .pr-todo-col-label {
  display: none;
}
.modal-theme-slate .pr-todo-row {
  border: none;
  padding: 4px 0;
  background: transparent;
}

/* ── Promo náklady ─────────────────────────────────────────────────────────── */
.modal-theme-slate .promo-col-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 2px;
}
.modal-theme-slate .promo-row:not(:first-child) .promo-col-label {
  display: none;
}
.modal-theme-slate .promo-row {
  padding: 3px 0;
}
.modal-theme-slate .promo-typ-locked,
.modal-theme-slate .vyuctovani-typ-locked {
  color: var(--accent);
  cursor: default;
}
.modal-theme-slate .promo-col-headers {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.modal-theme-slate .promo-total-row {
  border-top: 1px solid #e4e4e7;
  gap: 16px;
}
.modal-theme-slate .promo-total-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-hover);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.modal-theme-slate .promo-total-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  min-width: 100px;
  text-align: right;
}

/* ── GoOut ID preview ──────────────────────────────────────────────────────── */
.modal-theme-slate [data-goout-id-preview] {
  font-size: 0.78rem;
}

/* ── GoOut Sales Timeline ──────────────────────────────────────────────────── */
.modal-theme-slate .goout-stats-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.modal-theme-slate .goout-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light);
}
.modal-theme-slate .goout-stats-row:last-child {
  border-bottom: none;
}
.modal-theme-slate .goout-stats-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.modal-theme-slate .goout-stats-val {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 40px;
  text-align: right;
}

/* ── Historie tab ──────────────────────────────────────────────────────────── */
.modal-theme-slate .modal-history-wrap {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px 24px;
  background: #fff;
}

/* ── Scrollbar ─────────────────────────────────────────────────────────────── */
.modal-theme-slate .modal-body-wrapper > .modal-body::-webkit-scrollbar {
  width: 3px;
}
.modal-theme-slate .modal-body-wrapper > .modal-body::-webkit-scrollbar-track {
  background: transparent;
}
.modal-theme-slate .modal-body-wrapper > .modal-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 0;
}
.modal-theme-slate .modal-body-wrapper > .modal-body::-webkit-scrollbar-thumb:hover {
  background: #d4d4d8;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 576px) {
  .modal-theme-slate .modal-body-wrapper {
    flex-direction: column;
  }
  .modal-theme-slate .modal-sidebar {
    flex-direction: row;
    width: 100%;
    min-width: unset;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
    gap: 8px;
  }
  .modal-theme-slate .sidebar-btn.active::after {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 0;
    width: auto;
    height: 2px;
  }
  .modal-theme-slate .sidebar-separator {
    width: 1px;
    height: 24px;
    margin: 0 4px;
  }
  .modal-theme-slate .modal-body-wrapper > .modal-body {
    padding: 24px 20px;
    max-height: 64vh;
  }
}
