/* URL-shortener panel styles on top of win95.css. Same Win95 skin as the
   MC Server panel: white/silver/black surfaces, navy selection, square bevels.
   win95.css assumes a few Bootstrap layout classes (.container, .card-body) —
   provided here so no Bootstrap dependency is needed. */

:root {
  --c-white: #fff;
  --c-black: #000;
  --c-silver: silver;
  --c-navy: #000082;
  --c-text: #212529;
  --c-text-muted: #424242;
  --c-text-soft: #555;
  --c-gray: #808080;
  --c-success: #008000;
  --c-danger: #c00000;
  --c-note-bg: #ffffe1;
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; padding-bottom: 24px; }

.container { width: 100%; max-width: 920px; margin: 0 auto; padding: 0 12px; }
.app-container { padding-top: 24px; }
.card-body { padding: 12px; }
.card { display: block; margin-bottom: 14px; }

.btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 12px 5px; font-size: 13px; border-radius: 0;
  line-height: 1.3; cursor: pointer; text-decoration: none;
}
.btn:focus { box-shadow: none; outline: 1px dotted var(--c-black); outline-offset: -4px; }
.btn:disabled { color: var(--c-gray); text-shadow: 1px 1px var(--c-white); cursor: default; }

.app-header { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.brand-row { display: flex; align-items: center; gap: 8px; }
.brand h1 { margin: 0; font-size: 20px; font-weight: bold; color: var(--c-black); white-space: nowrap; }
.brand p { margin: 4px 0 0; font-size: 13px; color: var(--c-text); }
.auth-box { align-self: flex-end; }

.status-pill {
  flex: 0 0 auto; font-size: 10px; font-weight: bold; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--c-white); background: var(--c-gray);
  border: 1px solid var(--c-black); padding: 1px 6px; line-height: 1.4;
}
.status-pill.on { background: var(--c-success); }
.status-pill.off { background: var(--c-danger); }

.ui-icon { width: 14px; height: 14px; vertical-align: -2px; }
.ui-icon.invert { filter: invert(1); }
.btn:disabled .ui-icon { opacity: 0.45; }

.banner { background: var(--c-white); border: 2px inset var(--c-white); padding: 6px 10px; margin: 0 0 10px; font-size: 13px; color: var(--c-black); }
.banner.error { color: var(--c-danger); }
.banner.ok { color: var(--c-success); }
.note { background: var(--c-note-bg); border: 1px solid var(--c-black); padding: 6px 10px; margin: 0 0 10px; font-size: 13px; color: var(--c-black); }
.note code, .setting-hint code { font-family: monospace; }
.setting-hint { margin: 8px 0 0; font-size: 12px; color: var(--c-text-muted); }

.section-window > summary.card-header { cursor: pointer; list-style: none; }
.section-window > summary::-webkit-details-marker { display: none; }

/* create-link form */
.create-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.create-row .form-95 { margin-top: 0; }
.create-row .url-input { flex: 2 1 280px; }
.create-row .slug-input, .create-row .note-input { flex: 1 1 130px; }

/* links list = classic white list view */
.list { background: var(--c-white); border: 2px inset var(--c-white); color: var(--c-black); max-height: 60vh; overflow-y: auto; }
.empty { color: var(--c-text-soft); text-align: center; padding: 24px 16px; font-size: 13px; margin: 0; }

.link-row { display: flex; gap: 10px; padding: 8px; border-bottom: 1px solid #e6e6e6; align-items: flex-start; }
.link-row:last-child { border-bottom: none; }
.link-thumb { width: 64px; height: 64px; object-fit: cover; flex: 0 0 auto; background: #d4d0c8; border: 1px solid #808080; }
.link-thumb.placeholder { display: flex; align-items: center; justify-content: center; color: #808080; font-size: 22px; }
.link-main { flex: 1 1 auto; min-width: 0; }
.link-slug { font-weight: bold; font-family: monospace; font-size: 13px; }
.link-slug a { color: var(--c-navy); text-decoration: none; }
.link-title { font-size: 13px; color: var(--c-text); margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-dest { font-size: 12px; color: var(--c-text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-meta { font-size: 12px; color: var(--c-text-soft); margin-top: 3px; font-variant-numeric: tabular-nums; }
.link-actions { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; }
.link-actions .btn { padding: 1px 8px 2px; font-size: 12px; justify-content: center; }
.link-disabled { opacity: 0.55; }

.copy-flash { color: var(--c-success); font-size: 12px; margin-left: 6px; }

/* analytics drawer */
.analytics { background: #f4f4f4; border: 2px inset var(--c-white); margin: 0 8px 8px; padding: 8px; }
.stat-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.stat { background: var(--c-white); border: 2px inset var(--c-white); padding: 3px 8px; font-size: 12px; font-variant-numeric: tabular-nums; }
.stat b { font-size: 14px; }
.clicks-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.clicks-table th, .clicks-table td { text-align: left; padding: 3px 6px; border-bottom: 1px solid #ddd; white-space: nowrap; }
.clicks-table th { color: var(--c-text-muted); font-weight: bold; }
.clicks-table td.ua { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.bot-tag { color: var(--c-danger); }

/* modal */
.modal-overlay { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0, 0, 0, 0.45); }
.modal-overlay[hidden] { display: none; }
.modal-window { width: 100%; max-width: 360px; }
.modal-window .card-body { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
.modal-window .form-95 { margin-top: 0; }
.modal-actions { display: flex; gap: 8px; }
.modal-opt { flex: 1; justify-content: center; padding: 8px 12px; }

@media (max-width: 640px) {
  .app-container { padding-top: 8px; }
  .btn { padding: 8px 12px; font-size: 14px; }
  .link-thumb { width: 48px; height: 48px; }
  .clicks-table td.ua { max-width: 120px; }
}
