/* SECAN AI app pages: /emlak/yukle, /emlak/paket, /admin */
.app-main { padding-block: 32px 72px; }
.app-main h1 { font-size: clamp(1.6rem, 5vw, 2.3rem); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; }
.panel h2 { font-size: 1.15rem; margin-bottom: .75em; }
.panel .sub { color: var(--muted); font-size: .92rem; margin: -.4em 0 1em; }
.narrow { max-width: 760px; margin-inline: auto; }
.hint { color: var(--muted); font-size: .88rem; }
.stack { display: grid; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-block { width: 100%; }
.alert { padding: 14px 16px; border-radius: 12px; font-size: .96rem; margin-bottom: 16px; background: #FBE9E3; color: #7A2E1D; }
.alert.ok { background: #E3F2E8; color: #17733F; }
.alert.info { background: #EEF1F7; color: #2F3A55; }
.alert.warn { background: #FFF3D6; color: #6B4E00; }
.alert[hidden] { display: none; }
.linklike { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font: inherit; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* style picker */
.style-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.style-opt { position: relative; display: block; cursor: pointer; }
.style-opt input { position: absolute; opacity: 0; inset: 0; }
.style-opt .card { border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; transition: border-color .15s, box-shadow .15s; }
.style-opt img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; height: auto; }
.style-opt .t { padding: 8px 10px 10px; font-weight: 700; font-size: .95rem; }
.style-opt .t small { display: block; font-weight: 400; color: var(--muted); font-size: .78rem; }
.style-opt input:checked + .card { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(200,85,61,.18); }
.style-opt input:focus-visible + .card { outline: 3px solid var(--brand); outline-offset: 2px; }

/* file picker + thumbs */
.drop { border: 2px dashed var(--line); border-radius: 14px; padding: 22px 16px; text-align: center; background: #fff; }
.drop p { margin: 0 0 12px; color: var(--ink-2); }
.drop .row { justify-content: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 16px; }
.thumbs:empty { display: none; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: #EEECE7; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .rm { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(27,31,42,.78); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.thumb .badge { position: absolute; left: 4px; bottom: 4px; background: rgba(27,31,42,.78); color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.thumb.err { border-color: #D9695A; }
.thumb .errmsg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 6px; font-size: .68rem; color: #7A2E1D; background: #FBE9E3; }
.thumb .state { position: absolute; left: 4px; bottom: 4px; right: 4px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.7); overflow: hidden; }
.thumb .state i { display: block; height: 100%; width: var(--p, 0%); background: var(--brand); transition: width .2s; }
.thumb .done { position: absolute; left: 4px; bottom: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--wa); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; }

.priceline { font-weight: 700; font-size: 1.05rem; padding: 12px 14px; background: #FBE9E3; border-radius: 12px; margin-top: 16px; }
.priceline small { display: block; font-weight: 400; color: var(--ink-2); font-size: .85rem; }
.consent { display: grid; gap: 10px; font-size: .92rem; color: var(--ink-2); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--brand); }
textarea, .field { width: 100%; font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
textarea { min-height: 84px; resize: vertical; }
.counter { text-align: right; font-size: .8rem; color: var(--muted); }

/* waiting */
.waiting { text-align: center; padding: 36px 16px; }
.waiting .pulse { width: 84px; height: 84px; margin: 0 auto 20px; border-radius: 24px; background: linear-gradient(135deg, var(--brand), #E89B5A); animation: pulse 1.6s ease-in-out infinite; position: relative; }
.waiting .pulse::after { content: "✦"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 34px; }
@keyframes pulse { 0%, 100% { transform: scale(.92) rotate(-4deg); } 50% { transform: scale(1.06) rotate(4deg); } }
.waiting h2 { margin-bottom: .3em; }
.waiting p { color: var(--ink-2); }
.dots::after { content: ""; animation: dots 1.5s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
@media (prefers-reduced-motion: reduce) { .waiting .pulse, .spinner, .dots::after { animation: none; } }

.upload-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: .88rem; color: var(--ink-2); }
.upload-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 10px 0 6px; }
.upload-bar i { display: block; height: 100%; width: var(--p, 0%); background: var(--brand); transition: width .25s; }

/* before/after extras */
.ba-virtual { position: absolute; right: 12px; bottom: 12px; padding: 5px 12px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; font-size: .72rem; font-weight: 600; pointer-events: none; }
.summary { display: grid; gap: 4px; padding: 16px; border-radius: 12px; background: #F3F0EA; margin-bottom: 14px; }
.summary .big { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.actions { display: grid; gap: 10px; margin-top: 16px; }
@media (min-width: 560px) { .actions.cols { grid-template-columns: 1fr 1fr; } }

/* package gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.gcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.gcard img { aspect-ratio: 3 / 2; width: 100%; object-fit: cover; }
.gcard .gc { padding: 10px 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .9rem; }
.progress { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; margin: 12px 0 6px; }
.progress i { display: block; height: 100%; background: var(--brand); width: var(--p, 0%); transition: width .4s; }

/* admin (desktop-first) */
.admin-bar { display: flex; align-items: center; gap: 16px; }
.admin-bar .grow { flex: 1; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; cursor: pointer; font: inherit; font-size: .9rem; color: var(--ink-2); }
.tab[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.admin-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; align-items: start; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; background: #fff; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #F3F0EA; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover, .tbl tbody tr.sel { background: #FBF3EF; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #EEECE7; color: var(--ink-2); }
.pill.paid, .pill.review { background: #FFF3D6; color: #6B4E00; }
.pill.delivered, .pill.free_done, .pill.done { background: #E3F2E8; color: #17733F; }
.pill.support, .pill.failed { background: #FBE9E3; color: #7A2E1D; }
.pill.queued, .pill.running { background: #EEF1F7; color: #2F3A55; }
.aimg { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: #fff; margin-bottom: 16px; }
.aimg .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.aimg .pair figure { margin: 0; }
.aimg .pair img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; cursor: zoom-in; background: #eee; }
.aimg figcaption { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
.hist { font-size: .82rem; color: var(--ink-2); margin: 10px 0 0; padding-left: 1.1em; }
.regen { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.regen .field { width: auto; padding: 8px 10px; }
.regen input.field { flex: 1; min-width: 160px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: grid; place-items: center; z-index: 100; padding: 16px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.login-box { max-width: 380px; margin: 12vh auto; }

@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .style-pick { grid-template-columns: repeat(2, 1fr); }
  .panel { padding: 16px; }
  .aimg .pair { grid-template-columns: 1fr; }
}
.admin-grid > * { min-width: 0; }
@media (min-width: 901px) { .admin-grid > section:first-child { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; } }
