:root { color-scheme: light dark; }
* { box-sizing: border-box; }
body { font-family: system-ui, sans-serif; margin: 0; background: #0f1115; color: #e8e8e8; }
a { color: #7fb4ff; }

.center { display: grid; place-items: center; min-height: 100vh; }
.card { background: #1a1d24; padding: 2rem; border-radius: 12px; width: min(92vw, 360px); box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.card h1 { margin: 0 0 1.25rem; font-size: 1.4rem; }

label { display: block; font-size: .85rem; margin-bottom: .9rem; }
input { width: 100%; margin-top: .3rem; padding: .6rem; border: 1px solid #333; border-radius: 8px; background: #0f1115; color: #e8e8e8; }
button { padding: .6rem .9rem; border: 0; border-radius: 8px; background: #3b82f6; color: #fff; font-size: .95rem; cursor: pointer; }
button:hover { filter: brightness(1.1); }
button.secondary { background: #2a2d34; }
button.danger { background: #3a1d1d; color: #f87171; }
button.small { padding: .35rem .6rem; font-size: .8rem; }

.error { color: #f87171; font-size: .85rem; min-height: 1.2em; }
.ok { color: #4ade80; font-size: .85rem; min-height: 1.2em; }
.muted { color: #888; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.5rem; border-bottom: 1px solid #222; }
header h1 { font-size: 1.2rem; margin: 0; }
main { max-width: 820px; margin: 0 auto; padding: 1.5rem; }
section { background: #15181e; border: 1px solid #1f232b; border-radius: 12px; padding: 1.2rem; margin-bottom: 1.4rem; }
section h2 { margin: 0 0 1rem; font-size: 1rem; }

.bar { height: 10px; background: #0f1115; border-radius: 6px; overflow: hidden; margin: .5rem 0; }
.bar > div { height: 100%; background: #3b82f6; }

ul { list-style: none; padding: 0; margin: 0; }
li { display: flex; align-items: center; gap: .8rem; padding: .7rem .3rem; border-bottom: 1px solid #1d2026; }
li a { flex: 1; text-decoration: none; word-break: break-all; }
.size { color: #888; font-size: .85rem; white-space: nowrap; }
.file-name { flex: 1; background: none; border: 0; color: #7fb4ff; cursor: pointer; text-align: left; padding: .2rem 0; font: inherit; word-break: break-all; }
.file-name:hover { text-decoration: underline; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .55rem .5rem; border-bottom: 1px solid #1d2026; }
.pill { font-size: .72rem; padding: .12rem .5rem; border-radius: 999px; }
.pill.active { background: #14331f; color: #4ade80; }
.pill.pending { background: #332a12; color: #facc15; }
.pill.revoked { background: #3a1d1d; color: #f87171; }

/* Admin accordion cards */
.accordion { display: flex; flex-direction: column; gap: .6rem; }
.acc-card { border: 1px solid #1f232b; border-radius: 10px; background: #14171d; overflow: hidden; }
.acc-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; cursor: pointer; user-select: none; }
.acc-head:hover { background: #181c24; }
.acc-summary { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.acc-caret { color: #888; transition: transform .15s ease; }
.acc-card.open .acc-caret { transform: rotate(90deg); }
.acc-body { display: none; padding: .4rem 1rem 1rem; border-top: 1px solid #1f232b; }
.acc-card.open .acc-body { display: block; }
.acc-body .field { margin: .9rem 0; }
.acc-body .field > label { font-weight: 600; color: #cbd2dc; margin-bottom: .4rem; }
.acc-body input { width: auto; margin-top: 0; }
.acc-body textarea { margin-top: 0; padding: .6rem; border: 1px solid #333; border-radius: 8px; background: #0f1115; color: #e8e8e8; font: inherit; }

/* Message thread (account page) */
.msg { border: 1px solid #1f232b; border-radius: 8px; padding: .7rem .8rem; margin-bottom: .6rem; }
.msg-admin { background: #161b24; border-color: #243044; }
.msg-user { background: #14171d; }

/* Landing / services hub */
.hero { text-align: center; padding: 4rem 1rem 2.5rem; }
.hero h1 { font-size: 2.8rem; margin: 0 0 .5rem; letter-spacing: -.02em;
  background: linear-gradient(120deg, #7fb4ff, #a78bfa 60%, #f472b6);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { margin: 0; font-size: 1.05rem; }

.services { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.25rem; }
.service { position: relative; display: flex; flex-direction: column; gap: .85rem;
  padding: 1.6rem; text-decoration: none; color: inherit; border-radius: 18px;
  background: linear-gradient(160deg, #1b1f29, #14171d); border: 1px solid #242a36;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.service:hover { transform: translateY(-5px); border-color: #3b82f6;
  box-shadow: 0 14px 34px rgba(59,130,246,.20); }
.service-icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.7rem; background: #0f1115; border: 1px solid #242a36; }
.service h3 { margin: 0; font-size: 1.2rem; }
.service p { margin: 0; color: #9aa3b2; font-size: .9rem; line-height: 1.5; }
.service .arrow { margin-top: auto; color: #7fb4ff; font-size: .85rem; font-weight: 600; }
.service.soon { opacity: .5; pointer-events: none; }
.service.soon .arrow { color: #888; }

/* Preview / player modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.75); display: none; place-items: center; z-index: 50; padding: 1.5rem; }
.modal.open { display: grid; }
.modal-box { background: #15181e; border: 1px solid #1f232b; border-radius: 12px; width: 100%; max-width: min(94vw, 900px); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border-bottom: 1px solid #1f232b; }
.modal-head .title { font-size: .95rem; word-break: break-all; }
.modal-body { padding: 1rem; overflow: auto; }
.modal-body img, .modal-body video { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; }
.modal-body audio { width: 100%; }
.modal-body iframe { width: 100%; height: 72vh; border: 0; background: #fff; border-radius: 6px; }
.modal-body pre { white-space: pre-wrap; word-break: break-word; margin: 0; font-size: .85rem; line-height: 1.4; overflow: auto; }
.modal-foot { display: flex; align-items: center; gap: .6rem; padding: .7rem 1rem; border-top: 1px solid #1f232b; }
.modal-x { background: none; border: 0; color: #aaa; font-size: 1.5rem; line-height: 1; padding: 0 .3rem; cursor: pointer; }
.modal-x:hover { color: #fff; filter: none; }
.modal-head .title { flex: 1; text-align: center; }
.modal-nav { background: none; border: 0; color: #7fb4ff; font-size: 1.4rem; line-height: 1; padding: 0 .4rem; cursor: pointer; flex: none; }
.modal-nav:hover:not(:disabled) { color: #fff; filter: none; }
.modal-nav:disabled { color: #3a3f48; cursor: default; }
.move-list { display: flex; flex-direction: column; gap: .4rem; max-height: 50vh; overflow: auto; }

/* Breadcrumb + folder rows */
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; margin: .2rem 0 .8rem; font-size: .9rem; }
.crumb { background: none; border: 0; color: #7fb4ff; cursor: pointer; font: inherit; padding: 0; }
.crumb:hover { text-decoration: underline; filter: none; }
.crumb-current { color: #ccc; }
.crumb-sep { color: #555; }
.link { background: none; border: 0; color: #7fb4ff; cursor: pointer; font: inherit; padding: 0; }
.folder-row { display: flex; align-items: center; gap: .5rem; }
.folder-name { color: #e3c06b; }

/* Preview loading + message states */
.preview-loading { display: flex; flex-direction: column; align-items: center; gap: .9rem; padding: 2.5rem 1rem; }
.preview-msg { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 2.5rem 1rem; text-align: center; }
.spinner { width: 34px; height: 34px; border: 3px solid #2a2d34; border-top-color: #3b82f6; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* PDF preview (PDF.js → canvas) */
.pdf-controls { display: flex; align-items: center; justify-content: center; gap: .8rem; margin-bottom: .8rem; }
.pdf-canvas { display: block; margin: 0 auto; max-width: 100%; height: auto; background: #fff; border-radius: 6px; box-shadow: 0 2px 10px rgba(0,0,0,.3); }

/* Image thumbnails in the file list */
.file-thumb { width: 32px; height: 32px; object-fit: cover; border-radius: 4px; background: #0f1115; flex: none; }

/* Recycle bin badge + drawer */
.badge { display: inline-block; min-width: 1.1rem; padding: 0 .3rem; margin-left: .25rem; border-radius: 999px; background: #3b82f6; color: #fff; font-size: .72rem; text-align: center; }
.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none; z-index: 60; }
.drawer.open { display: block; }
.drawer-panel { position: absolute; top: 0; right: 0; height: 100%; width: min(92vw, 460px); background: #15181e; border-left: 1px solid #1f232b; display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(0,0,0,.5); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1rem; border-bottom: 1px solid #1f232b; }
.drawer-head .title { font-size: 1rem; }
.drawer-actions { padding: .7rem 1rem; border-bottom: 1px solid #1f232b; }
.drawer-body { padding: .6rem 1rem 1rem; overflow: auto; flex: 1; }
.bin-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .7rem .1rem; border-bottom: 1px solid #1d2026; flex-wrap: wrap; }
.bin-info { min-width: 0; flex: 1; }
.bin-name { word-break: break-all; }
.bin-meta { font-size: .78rem; margin-top: .15rem; }

/* Full-screen modal + roomier tap targets on phones */
@media (max-width: 600px) {
  main { padding: 1rem; }
  .modal { padding: 0; }
  .modal-box { max-width: 100vw; width: 100vw; height: 100%; max-height: 100%; border-radius: 0; }
  .modal-body img, .modal-body video { max-height: 80vh; }
  .drawer-panel { width: 100vw; }
  li { padding: .9rem .3rem; }
  button.small { padding: .5rem .8rem; }
}
