:root {
  --primary: #2780e3;
  --primary-dark: #1f6bc0;
  --primary-soft: #d7e7fa;
  --success: #3fb618;
  --success-dark: #349a13;
  --warning: #ff7518;
  --danger: #ff0039;
  --secondary: #6c757d;
  --dark: #373a3c;
  --light: #f1f3f5;
  --border: #dee2e6;
  --bg: #f7f8fa;
  --card: #ffffff;
  --radius: 8px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --icons: "Segoe Fluent Icons", "Segoe MDL2 Assets";
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 14px/1.4 var(--font); color: var(--dark); background: var(--bg); }

.ico { font-family: var(--icons); font-style: normal; font-size: 16px; line-height: 1; display: inline-block; vertical-align: -3px; speak: never; }
.ico-xl { font-size: 32px; }

/* Μπάρα τίτλου */
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 20px; background: var(--primary); color: #fff; position: sticky; top: 0; z-index: 5; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.topbar h1 { margin: 0; font-size: 20px; font-weight: 600; }
.subtitle { font-size: 12.5px; opacity: .92; }
.titles { flex: 1; min-width: 0; }
.demo-badge { background: #ffc107; color: #3b2f00; font-weight: 700; font-size: 11px; padding: 3px 8px; border-radius: 10px; letter-spacing: .5px; }

main { max-width: 980px; margin: 0 auto; padding: 16px; }

/* Κάρτες */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px 14px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card-title { margin: 0 0 10px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.c-primary { color: var(--primary); } .c-success { color: var(--success); } .c-secondary { color: var(--secondary); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.spacer { flex: 1; }
.muted { color: var(--secondary); }

/* Κουμπιά */
.btn { font: inherit; display: inline-flex; align-items: center; gap: 7px; border: 1px solid transparent; border-radius: 6px; padding: 6px 12px; cursor: pointer; transition: background .15s, box-shadow .15s; white-space: nowrap; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: var(--success-dark); }
.btn-light { background: var(--light); color: var(--dark); border-color: #e3e6e9; }
.btn-light:hover:not(:disabled) { background: #e2e6ea; }
.btn-warning { background: var(--warning); color: #fff; }

.num { width: 80px; text-align: center; font: inherit; padding: 5px 6px; border: 1px solid var(--border); border-radius: 6px; }

.badge { display: inline-flex; align-items: center; gap: 7px; background: var(--primary); color: #fff; font-weight: 600; padding: 6px 12px; border-radius: 6px; }
.badge.idle { background: var(--secondary); }

/* Διακόπτες on/off */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.slider { width: 36px; height: 20px; border-radius: 10px; background: #ced4da; position: relative; transition: background .15s; flex: none; }
.slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .s-success { background: var(--success); }
.switch input:checked + .s-primary { background: var(--primary); }
.switch input:checked + .slider::after { transform: translateX(16px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch input:disabled + .slider { opacity: .5; }

.status-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; }
.status-row input { flex: 1; font: inherit; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: #fbfbfc; color: var(--dark); }

/* Λίστες αρχείων */
.table-wrap { position: relative; border: 1px solid var(--border); border-radius: 6px; max-height: 240px; min-height: 120px; overflow: auto; }
table.files { width: 100%; border-collapse: collapse; }
table.files th { position: sticky; top: 0; background: #fafbfc; text-align: left; font-weight: 600; font-size: 12.5px; color: var(--secondary); padding: 7px 10px; border-bottom: 1px solid var(--border); }
table.files td { padding: 6px 10px; border-bottom: 1px solid #f1f3f5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
table.files .r { text-align: right; }
table.files tbody tr { cursor: pointer; user-select: none; }
table.files tbody tr:hover { background: #f3f7fc; }
table.files tbody tr.sel { background: var(--primary-soft); }
table.files td .ico { color: var(--secondary); margin-right: 8px; }
table.files tr.empty td { color: var(--secondary); text-align: center; cursor: default; padding: 28px; }

.drop-hint { display: none; position: absolute; inset: 0; align-items: center; justify-content: center; font-weight: 600; color: var(--success); background: rgba(63,182,24,.08); border: 2px dashed var(--success); border-radius: 6px; pointer-events: none; }
.drop-target.dragover .drop-hint { display: flex; }

.hint { margin-top: 6px; font-size: 12.5px; color: var(--secondary); display: flex; align-items: center; gap: 6px; }
.hint .ico { font-size: 12px; vertical-align: 0; }
.folder-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.folder-row > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }

/* Ιστορικό */
.log { background: var(--light); border-radius: 6px; padding: 8px 10px; height: 130px; overflow: auto; font: 12.5px/1.5 Consolas, "Cascadia Mono", monospace; }
.log .t { color: var(--secondary); margin-right: 8px; }
.log .err { color: var(--danger); }
.log .ok { color: var(--success); }

/* Οθόνη σύνδεσης */
body.signed-out { background: #fff; }
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 16px; }
.login #historyCard { width: 100%; max-width: 560px; margin: 0; }
.login-card { text-align: center; max-width: 360px; width: 100%; padding: 32px 28px; border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 4px 18px rgba(0,0,0,.06); }
.login-card h1 { margin: 10px 0 6px; font-size: 20px; font-weight: 600; }
.login-card p { margin: 0 0 20px; }
.login-logo { font-size: 44px; color: var(--primary); }
.btn-lg { padding: 9px 22px; font-size: 15px; }
.login-card .error { color: var(--danger); }

.note { background: #fff8e1; border: 1px solid #ffe08a; color: #6b5200; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; }

@media (max-width: 640px) {
  main { padding: 10px; }
  .topbar { padding: 10px 12px; }
  .folder-row > span:nth-child(2) { max-width: 100%; }
}
