/* Eczacı paneli — /panel */

:root {
  --primary: #007566;
  --primary-dark: #134e4a;
  --accent: #d97706;
  --nav-hover-bg: #edf8f4;
  --bg: #f4faf7;
  --card: #fff;
  --border: #d9e8e2;
  --text: #102824;
  --muted: #62746f;
}

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

body.panel-app {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(230, 246, 240, 0.9), rgba(244, 250, 247, 0) 260px),
    var(--bg);
}

.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type=color] { width: 48px; height: 40px; padding: 2px; border-radius: 8px; cursor: pointer; }
.color-row input[type=text] { flex: 1; margin-bottom: 0; }
.preview-link { font-size: 0.88rem; color: var(--primary); }
.preview-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #dceee8;
  margin-bottom: 16px;
}
.preview-shell iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.device-list { display: flex; flex-direction: column; gap: 10px; }
.device-item {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  background: #fff;
}
.device-item.device-online { border-left: 3px solid #16a34a; }
.device-item h3 { font-size: 0.95rem; margin-bottom: 4px; }
.device-specs {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px; margin-top: 10px; font-size: 0.8rem;
}
.device-specs dt { color: var(--muted); font-weight: 600; }
.device-specs dd { color: var(--text); }
.device-meta { font-size: 0.82rem; color: var(--muted); line-height: 1.45; }
@media (max-width: 640px) { .device-specs { grid-template-columns: 1fr; } }
.device-badge {
  font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  white-space: nowrap;
}
.device-badge.online { background: #dcfce7; color: #166534; }
.device-badge.offline { background: #fee2e2; color: #991b1b; }
.device-actions {
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .device-actions { flex-direction: row; align-items: center; flex-wrap: wrap; }
}
.setup-guide {
  background: linear-gradient(145deg, #eefaf5 0%, #ffffff 100%);
  border-color: #b9ded2;
}
.setup-guide h2 { display: flex; align-items: center; gap: 8px; }
.setup-steps {
  list-style: none; counter-reset: tstep; margin: 0; padding: 0;
}
.setup-steps li {
  counter-increment: tstep;
  position: relative;
  padding: 12px 0 12px 40px;
  border-bottom: 1px dashed #c5e8e0;
  font-size: 0.9rem; line-height: 1.5;
}
.setup-steps li:last-child { border-bottom: none; padding-bottom: 0; }
.setup-steps li::before {
  content: counter(tstep);
  position: absolute; left: 0; top: 12px;
  width: 26px; height: 26px; line-height: 26px; text-align: center;
  background: var(--primary); color: #fff; border-radius: 50%;
  font-size: 0.78rem; font-weight: 800;
}
.setup-steps code {
  background: #fff; padding: 2px 7px; border-radius: 5px;
  border: 1px solid var(--border); font-size: 0.88em; word-break: break-all;
}
.setup-steps strong { color: var(--primary-dark); }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; font-size: 0.9rem; }
.profile-grid dt { color: var(--muted); font-weight: 600; }
@media (max-width: 640px) { .profile-grid { grid-template-columns: 1fr; } }
.list-item {
  border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px;
  margin-bottom: 10px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  background: #fff;
}
.list-item h3 { font-size: 0.95rem; margin-bottom: 4px; }
.list-item-inline {
  align-items: center;
}
.list-item-main {
  flex: 1;
  min-width: 0;
}
.list-meta { font-size: 0.82rem; color: var(--muted); }
.token-box {
  background: #eefaf5; border: 1px solid #a7d8c5; border-radius: 8px;
  padding: 12px 14px; margin-top: 12px; font-size: 0.88rem;
}
.token-box code { font-family: ui-monospace, monospace; word-break: break-all; }
.token-display {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: #0f4f49;
  color: #fff;
  padding: 14px 18px;
  border-radius: 8px;
  margin-top: 8px;
  text-align: center;
  user-select: all;
  -webkit-user-select: all;
  word-break: break-all;
}

.panel-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.panel-brand .brand { margin-bottom: 0; }

.panel-main .card {
  padding: 24px;
}
.panel-main .card h2 {
  font-size: 1.1rem;
  margin-bottom: 18px;
}

.panel-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--muted);
}
.panel-loading::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: panel-spin 0.7s linear infinite;
}
@keyframes panel-spin { to { transform: rotate(360deg); } }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}
.panel-header-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.panel-avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.panel-header-text { min-width: 0; }
.panel-header-text strong {
  display: block;
  font-size: 0.98rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.panel-header-text span {
  font-size: 0.78rem;
  color: var(--muted);
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 560px) {
  .stat-row { grid-template-columns: 1fr; }
}
.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.stat-card[role="button"] { cursor: pointer; }
.stat-card[role="button"]:focus {
  outline: 2px solid #99f6e4;
  outline-offset: 2px;
}
.stat-card:hover {
  border-color: #c5e8e0;
  box-shadow: 0 4px 16px rgba(15, 118, 110, 0.08);
}
.stat-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 8px;
}
.stat-card-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.3;
}
.stat-card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.4;
}
.stat-card--ok { border-left: 3px solid #22c55e; }
.stat-card--warn { border-left: 3px solid #f59e0b; }
.stat-card--err { border-left: 3px solid #ef4444; }

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-head h2 {
  margin-bottom: 0 !important;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-head-icon {
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0.9;
}
.card-head-actions { flex-shrink: 0; }

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #eefaf5;
  border: 1px solid #b9ded2;
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.quick-link:hover { background: #ddf3eb; }

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.preview-toolbar a {
  font-size: 0.88rem;
  color: var(--primary);
  font-weight: 600;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 20px;
}
@media (max-width: 640px) {
  .check-grid { grid-template-columns: 1fr; }
}
.check-grid .check {
  margin-bottom: 0;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background 0.12s;
}
.check-grid .check:hover { background: #f8fafc; }

.sticky-actions {
  position: sticky;
  bottom: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
}
.sticky-hint {
  font-size: 0.8rem;
  color: var(--muted);
}

.empty-state {
  text-align: center;
  padding: 28px 20px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #f8fafc;
  margin-bottom: 16px;
}
.empty-state-icon { font-size: 1.8rem; margin-bottom: 8px; opacity: 0.7; }
.empty-state p {
  font-size: 0.88rem;
  color: var(--muted);
  max-width: 320px;
  margin: 0 auto;
}

.form-compact .section-title { margin-top: 24px; }
.form-compact .section-title:first-of-type { margin-top: 8px; }

.device-item {
  transition: border-color 0.15s, box-shadow 0.15s;
}
.device-item:hover {
  border-color: #a7f3d0;
  box-shadow: 0 2px 10px rgba(15, 118, 110, 0.06);
}
.device-item.device-online { border-left: 3px solid #22c55e; }
.device-row {
  align-items: center;
}
.device-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #eefaf5;
  color: var(--primary-dark);
  font-weight: 800;
}
.device-row-main { min-width: 0; }
.device-row-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 3px;
}
.device-row-title h3 { margin-bottom: 0; }

.pair-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-top: 14px;
}
.pair-row input { flex: 1; margin-bottom: 0 !important; }
@media (max-width: 480px) {
  .pair-row { flex-direction: column; }
}

.logo-drop {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #fafafa;
  margin-bottom: 12px;
}
.logo-drop img {
  max-height: 72px;
  max-width: 200px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 4px;
}
.camp-thumb {
  max-height: 48px;
  max-width: 80px;
  border-radius: 6px;
  margin-right: 10px;
  object-fit: contain;
}
.camp-upload-btn { cursor: pointer; margin: 0; }
.duty-headline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.duty-headline-title { font-size: 1rem; }
.flex-1 { flex: 1; }

.msg-toast {
  animation: panel-fade-in 0.25s ease;
}
@keyframes panel-fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.door-preview {
  border-radius: 8px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #0f4f49;
  color: #fff;
  overflow: hidden;
}
.door-preview-shell {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.door-preview-card {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 24px;
  box-sizing: border-box;
  border-width: 4px;
  border-style: solid;
  border-color: #fbbf24;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 14px 36px rgba(0,0,0,0.2);
  overflow: hidden;
}
.door-preview-title {
  flex: 0 0 auto;
  max-width: 100%;
  color: #fbbf24;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.door-preview-text {
  max-width: 100%;
  min-height: 0;
  font-weight: 900;
  line-height: 1.12;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.door-preview.blink .door-preview-card {
  animation: panel-door-pulse 1.15s ease-in-out infinite;
}
@keyframes panel-door-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.62; }
}
.duty-read-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fff;
}
.duty-read-card strong {
  display: block;
  color: var(--primary-dark);
  margin-bottom: 4px;
}
.duty-read-card .device-meta { margin-top: 2px; }
.door-message-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.door-message-list .device-item {
  min-height: 0;
  align-items: center;
}
.door-active-card {
  border-color: #a7d8c5;
  background: #f0fdf4;
  margin-bottom: 14px;
}
.door-active-card .card-head { margin-bottom: 10px; }
.device-item-active {
  border-color: #a7d8c5;
  background: #fff;
}
.door-preview-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.door-preview-modal {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 16 / 9;
  min-height: 0;
  border-radius: 8px;
}
.door-preview-img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}
.door-modal { max-width: 720px; }
.door-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.door-modal-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.door-modal-col label,
.door-modal-col .check { margin-bottom: 2px; }
.door-modal-col .check { margin-top: 4px; }
.door-style-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
  align-items: start;
}
.door-style-row label { margin-bottom: 4px; }
.door-style-row input[type="range"] { margin-top: 6px; }
@media (max-width: 640px) {
  .door-modal-grid { grid-template-columns: 1fr; }
  .door-style-row { grid-template-columns: 1fr 1fr; }
}
.content-modal { max-width: 560px; }
.modal-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.modal-title-row h3 { margin-bottom: 0; }
.link-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.link-button:hover { text-decoration: underline; }
.btn-danger-soft {
  color: #991b1b;
  border-color: #fecaca;
  background: #fff5f5;
}
.support-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}
.support-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}
.support-table th,
.support-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.support-table th {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}
.support-table td {
  font-size: 0.88rem;
}
.support-last-message {
  display: block;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.support-modal {
  max-width: 760px;
}
.support-modal-head {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.support-modal-thread {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  margin-bottom: 14px;
}
.support-modal-thread .support-thread {
  margin: 0;
}
.support-empty {
  color: var(--muted);
  padding: 18px !important;
  text-align: center;
}
input:disabled,
textarea:disabled,
select:disabled {
  background: #f1f5f9;
  color: #94a3b8;
}

@media (max-width: 560px) {
  .panel-main .card { padding: 16px; }
  .panel-header { align-items: flex-start; }
  .panel-header .btn { width: auto; }
  .list-item,
  .device-item {
    flex-direction: column;
    align-items: stretch;
  }
  .device-badge { align-self: flex-start; }
  .sticky-actions {
    position: static;
    box-shadow: none;
  }
}
