@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,500;0,600;0,700;1,500&family=Public+Sans:wght@400;500;600;700&display=swap');

/* V Accounting — μεταλλική παλέτα (μαύρο/άσπρο/ασημί), σκιάσεις για σύγχρονη εμφάνιση — §13 */
:root {
  --black: #1c1c1e;
  --charcoal: #2c2c2e;
  --silver: #b8bcc4;
  --silver-light: #e8eaec;
  --white: #ffffff;
  --border: #d8dadd;
  --text: #1c1c1e;
  --text-dim: #6b6b70;
  --red: #b3423a;
  --green: #3f7a52;
  --shadow: 0 2px 10px rgba(0,0,0,.12), 0 1px 2px rgba(0,0,0,.08);
  --font-heading: 'Lora', Georgia, 'Times New Roman', serif;
  --font-body: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: linear-gradient(180deg, var(--silver-light), #f2f3f4);
  color: var(--text);
}
h1, h2, .page-header h1, .section-title { font-family: var(--font-heading); }
.hidden { display: none !important; }

/* ---------- login (ίδια γραφικά με την προηγούμενη εφαρμογή) ---------- */
@keyframes loginReveal {
  0% { opacity: 0; transform: translateY(16px) scale(.97); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes loginBoxIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes metalAssemble {
  0% { opacity: 0; transform: translate(var(--tx),var(--ty)) rotate(var(--rot)) scale(var(--sc,.3)); filter: blur(5px); }
  40% { opacity: 1; filter: blur(1.5px); }
  72% { transform: translate(calc(var(--tx) * -0.05),calc(var(--ty) * -0.05)) rotate(calc(var(--rot) * -0.06)) scale(1.07); filter: blur(0); }
  100% { opacity: 1; transform: translate(0,0) rotate(0deg) scale(1); filter: blur(0); }
}
@keyframes metalShine {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 0% 100%; }
}
@keyframes shardFly {
  0% { opacity: 0; transform: translate(var(--tx),var(--ty)) rotate(var(--rot)) scale(1.3); }
  25% { opacity: .9; }
  70% { opacity: .35; }
  100% { opacity: 0; transform: translate(0,0) rotate(calc(var(--rot) * .15)) scale(.25); }
}
@keyframes addressFadeIn {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}
.metal-shard {
  position: absolute; width: 7px; height: 7px; pointer-events: none; z-index: 1;
  background: linear-gradient(135deg,#9a9a9a,#0a0a0a 60%);
  clip-path: polygon(50% 0%,100% 100%,0% 100%);
  opacity: 0; animation: shardFly 2.1s cubic-bezier(.16,1,.3,1) both;
}
.login-address {
  position: relative; z-index: 1; margin-top: 18px; font-family: var(--font-body); font-size: 12.5px;
  color: var(--text-dim); line-height: 1.7; opacity: 0; animation: addressFadeIn .7s ease-out 3.4s both;
}
.login-screen {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background:
    repeating-linear-gradient(115deg, rgba(255,255,255,.045) 0px, rgba(255,255,255,.045) 1px, transparent 1px, transparent 4px),
    radial-gradient(ellipse at 30% 0%, #52565c 0%, #24262a 45%, #0a0b0c 100%);
  padding: 32px 16px;
}
.login-stack { display: flex; flex-direction: column; align-items: center; gap: 22px; width: 100%; max-width: 620px; }
.login-hero {
  position: relative; overflow: hidden; width: 100%; background: var(--white); border-radius: 16px;
  padding: 52px 40px; box-shadow: 0 24px 60px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.15);
  border: 1px solid #dde1e4; text-align: center;
  animation: loginReveal .7s cubic-bezier(.22,.8,.32,1) both;
}
.metal-title-row {
  font-family: var(--font-heading); font-weight: 800; font-size: clamp(32px,5.6vw,54px);
  letter-spacing: .005em; white-space: nowrap; display: flex; justify-content: center; align-items: baseline;
}
.metal-sub {
  font-family: var(--font-body); font-weight: 700; font-size: clamp(12px,1.6vw,15px);
  letter-spacing: .42em; margin-top: 10px; display: flex; justify-content: center; padding-left: .42em;
}
.metal-letter {
  display: inline-block; white-space: pre;
  background: linear-gradient(180deg,#565656 0%,#0a0a0a 20%,#2b2b2b 42%,#000 68%,#454545 100%);
  background-size: 100% 260%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 1px 0 rgba(255,255,255,.35), 0 2px 1px rgba(0,0,0,.5), 0 5px 10px rgba(0,0,0,.35);
  position: relative; z-index: 2;
  animation-name: metalAssemble, metalShine;
  animation-duration: 1.7s, 7s;
  animation-timing-function: cubic-bezier(.16,1,.3,1), linear;
  animation-iteration-count: 1, infinite;
  animation-fill-mode: both, none;
}
.metal-title-row .metal-letter:first-child { font-size: 1.3em; margin-right: .09em; }
.login-box {
  background: var(--white); padding: 32px 32px; border-radius: 12px; box-shadow: 0 4px 24px rgba(20,31,46,.12);
  border: 1px solid var(--border); width: 340px; max-width: 100%; text-align: center;
  animation: loginBoxIn .6s cubic-bezier(.22,.8,.32,1) .35s both;
}
.login-sub { color: var(--text-dim); margin: 0 0 20px; font-size: 13px; }
.login-box form { text-align: left; }
.login-box label { display: block; font-size: 12px; color: var(--text-dim); margin: 10px 0 4px; }
.login-box input { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.error-msg { color: var(--red); font-size: 12.5px; min-height: 16px; margin-top: 8px; }
@media (max-width: 480px) {
  .login-screen { padding: 20px 12px; }
  .login-hero { padding: 32px 20px; }
  .login-box { padding: 24px 20px; }
}

/* ---------- buttons ---------- */
.btn {
  border: 1px solid var(--border); background: var(--white); color: var(--text);
  padding: 8px 14px; border-radius: 8px; font-size: 13.5px; cursor: pointer;
  transition: box-shadow .15s;
}
.btn:hover { box-shadow: var(--shadow); }
.btn-primary {
  background: linear-gradient(180deg, #3a3a3d, var(--black)); color: var(--white); border-color: var(--black);
}
.btn-ghost { background: transparent; }
.btn-block { width: 100%; margin-top: 18px; }

/* ---------- app shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: linear-gradient(180deg, var(--charcoal), var(--black));
  color: var(--silver-light); display: flex; flex-direction: column; box-shadow: var(--shadow);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0;
}
.brand { padding: 20px 18px; font-weight: 700; letter-spacing: 2px; font-size: 15px; cursor: pointer; user-select: none; }
.brand:hover { color: var(--white); }
.brand:focus-visible { outline: 2px solid var(--silver); outline-offset: 2px; }
.nav { flex: 1; padding: 6px 0; }
.nav-item {
  padding: 11px 18px; cursor: pointer; font-size: 13.5px; color: var(--silver);
  border-left: 3px solid transparent;
}
.nav-item:hover { background: rgba(255,255,255,.06); }
.nav-item.active { background: rgba(255,255,255,.1); color: var(--white); border-left-color: var(--silver); }
.sidebar-footer { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.1); }
.user-badge { font-size: 13px; margin-bottom: 10px; }
.user-badge b { display: block; }
.user-badge span { color: var(--silver); font-size: 11.5px; }
.main { flex: 1; padding: 26px 30px; }
.view-root h1 { margin-top: 0; }
.placeholder-card {
  background: var(--white); border-radius: 12px; padding: 40px; text-align: center;
  color: var(--text-dim); box-shadow: var(--shadow); border: 1px solid var(--border);
}
.mobile-nav-toggle { display: none; }

/* ---------- toast ---------- */
.toast-root { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 999; }
.toast { padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); font-size: 13px; color: var(--white); }
.toast-success { background: var(--green); }
.toast-error { background: var(--red); }

/* ---------- Φάση 2: entities, pipeline, modal ---------- */
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toolbar { display: flex; gap: 8px; }
.btn-danger { background: var(--red); color: var(--white); border-color: var(--red); }
.back-link { display: inline-block; margin-bottom: 10px; color: var(--text-dim); cursor: pointer; font-size: 13px; }
.section-title { font-weight: 700; margin: 22px 0 10px; font-size: 15px; }
.card {
  background: var(--white); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.search-input {
  width: 100%; max-width: 340px; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; margin-bottom: 14px; font-size: 13.5px;
}
.data-table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.data-table th { background: var(--silver-light); font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-dim); }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover { background: var(--silver-light); }
.empty-row { color: var(--text-dim); text-align: center; padding: 20px; }
.task-card { background: var(--white); border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.task-card.clickable { cursor: pointer; }
.task-card-header { margin-bottom: 6px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; background: var(--silver-light); font-size: 11px; color: var(--text-dim); }

/* pipeline */
.pipeline { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.step-chip { flex: 1 1 220px; border-radius: 10px; padding: 10px 12px; border: 1px solid var(--border); background: var(--silver-light); }
.step-chip.step-active { background: #fdf1ea; border-color: #e8b98f; }
.step-chip.step-done { background: #eaf5ee; border-color: #a9d3b6; }
.step-chip.step-skipped { background: var(--silver-light); opacity: .7; }
.step-chip.step-locked { opacity: .55; }
.step-name { font-weight: 700; font-size: 13.5px; margin-bottom: 4px; }
.step-meta { font-size: 12px; color: var(--text-dim); margin-bottom: 2px; }
.step-meta.timer { color: var(--red); font-weight: 600; }
.step-actions { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal { background: var(--white); border-radius: 12px; width: 420px; max-width: 92vw; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; font-size: 16px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-dim); }
.modal-body { padding: 16px 18px; }
.modal-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 4px; }
.form-row input, .form-row select, .form-row textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; font-family: inherit; }

/* ---------- Φάση 6: reports ---------- */
.amount-positive { color: #1a7f37; font-weight: 600; }
.amount-negative { color: #c22626; font-weight: 600; }

/* ---------- Φάση 3: dashboard, ημερολόγιο, επικοινωνίες, mail, chat, σημειώσεις ---------- */
.muted { color: var(--text-dim); font-size: 12.5px; }
.hint { color: var(--text-dim); font-size: 12.5px; margin: 0 0 12px; }
.link { color: var(--charcoal); text-decoration: underline; cursor: pointer; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-inline { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.form-grid-inline .form-row { margin-bottom: 0; min-width: 160px; }
.comm-item { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.comm-item:last-child { border-bottom: none; }

/* two-week widget */
.two-week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.two-week-day { border: 1px solid var(--border); border-radius: 8px; padding: 6px; min-height: 70px; position: relative; font-size: 11.5px; }
.two-week-date { font-weight: 700; margin-bottom: 4px; }
.two-week-item { background: var(--silver-light); border-radius: 4px; padding: 2px 4px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.two-week-add { position: absolute; bottom: 4px; right: 4px; padding: 0 6px; line-height: 1.6; font-size: 11px; }

/* full calendar */
.cal-grid-header { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-bottom: 6px; font-weight: 700; font-size: 12px; color: var(--text-dim); text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-cell { background: var(--white); border: 1px solid var(--border); border-radius: 8px; min-height: 90px; padding: 6px; font-size: 11.5px; }
.cal-cell.cal-empty { background: transparent; border: none; }
.cal-daynum { font-weight: 700; margin-bottom: 4px; }
.cal-item { background: var(--silver-light); border-radius: 4px; padding: 2px 4px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* chat / notes widgets */
.chat-messages { max-height: 220px; overflow-y: auto; margin-bottom: 10px; }
.chat-msg { padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.chat-msg:last-child { border-bottom: none; }
.chat-input-row { display: flex; gap: 6px; align-items: center; }
.chat-input-row input[type="text"] { flex: 1; padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; }
.cl-remove { background: none; border: none; color: var(--text-dim); cursor: pointer; float: right; }

@media (max-width: 768px) {
  .grid-2 { grid-template-columns: 1fr; }
  .two-week-grid { grid-template-columns: repeat(2, 1fr); }
  .cal-grid, .cal-grid-header { grid-template-columns: repeat(7, minmax(36px, 1fr)); font-size: 10px; overflow-x: auto; }
}

/* ---------- responsive (mobile PWA) ---------- */
@media (max-width: 768px) {
  .mobile-nav-toggle {
    display: block; position: fixed; top: 12px; left: 12px; z-index: 60;
    background: var(--black); color: var(--white); border: none; border-radius: 8px;
    width: 38px; height: 38px; font-size: 18px;
  }
  .sidebar {
    position: fixed; left: -240px; top: 0; bottom: 0; z-index: 55; transition: left .2s; width: 220px;
  }
  .sidebar.open { left: 0; }
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 50;
  }
  .sidebar-overlay.visible { display: block; }
  .main { padding: 60px 16px 20px; }
}
