/* TNA Admin · brand: cream / navy / hands accents */

:root {
  --bg: #f7f2e9;
  --surface: #ffffff;
  --elevated: #ede6d9;
  --ink: #2e3a5c;
  --subtle: #79809b;
  --accent: #ed7d4d;
  --red: #e85c68;
  --mint: #7cc5af;
  --yellow: #f5c752;
  --blue: #2c4a9f;
  --stroke: rgba(46, 58, 92, 0.1);
  --radius: 16px;
  --sidebar-bg: #2e3a5c;
}

* { box-sizing: border-box; margin: 0; }

body {
  font-family: -apple-system, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

.hidden { display: none !important; }
.muted { color: var(--subtle); font-size: 13px; }
.error { color: var(--red); font-size: 13px; margin-top: 10px; }

/* Login */
.login {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  padding: 36px;
  width: 360px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 20px 60px rgba(46, 58, 92, 0.12);
}
.brand { text-align: center; margin-bottom: 8px; }
.brand h1 { font-size: 26px; letter-spacing: 0.5px; margin-top: 10px; }
.brand-badge {
  display: inline-block;
  background: var(--ink); color: #fff;
  font-weight: 800; letter-spacing: 1px;
  padding: 6px 12px; border-radius: 10px;
}

input, select {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  background: var(--bg);
  color: var(--ink);
  outline: none;
}
input:focus, select:focus { border-color: var(--accent); }

.btn-primary {
  background: linear-gradient(135deg, #f09b7c, #ed7d4d, #e85c68);
  color: #fff; border: none;
  padding: 13px; border-radius: 12px;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost {
  background: none; border: 1px solid var(--stroke);
  color: var(--subtle); border-radius: 10px;
  padding: 8px 12px; cursor: pointer; font-size: 13px;
}
.btn-small {
  background: var(--ink); color: #fff; border: none;
  padding: 6px 12px; border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.btn-small.warn { background: var(--red); }
.btn-small:disabled { opacity: 0.4; cursor: default; }

/* Shell */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 230px;
  background: var(--sidebar-bg);
  color: #fff;
  padding: 22px 14px;
  display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: 0; height: 100vh;
}
.brand-row { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.sidebar .brand-badge { background: #fff; color: var(--ink); }
.brand-name { font-weight: 800; letter-spacing: 0.5px; }
nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  background: none; border: none; color: rgba(255,255,255,0.75);
  text-align: left; padding: 11px 12px; border-radius: 12px;
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,0.08); }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-label { font-size: 10px; font-weight: 800; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1.4px; padding: 14px 12px 4px; }
.ceo-tag { font-size: 12px; font-weight: 700; color: var(--accent); background: rgba(237,125,77,0.14); padding: 3px 10px; border-radius: 99px; vertical-align: middle; margin-left: 6px; }

/* ===== Anya's mood cabinet ===== */
.anya-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--surface); border: 1px solid var(--stroke);
  border-radius: 20px; padding: 14px 20px; margin-bottom: 22px; flex-wrap: wrap;
}
.anya-greeting { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.anya-hi { font-size: 22px; font-weight: 800; color: var(--ink); letter-spacing: 0.2px; }
.anya-mascots { display: inline-flex; gap: 4px; }
.anya-mascots .mascot { font-size: 22px; display: inline-block; animation: mascot-bounce 1.8s ease-in-out infinite; }
.anya-mascots .mascot:nth-child(2) { animation-delay: .15s; }
.anya-mascots .mascot:nth-child(3) { animation-delay: .3s; }
.anya-mascots .mascot:nth-child(4) { animation-delay: .45s; }
.anya-mascots .mascot:nth-child(5) { animation-delay: .6s; }
@keyframes mascot-bounce { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-8deg); } }

.anya-themes { display: flex; align-items: center; gap: 6px; }
.anya-themes-label { font-size: 12px; color: var(--subtle); margin-right: 4px; }
.anya-theme-btn {
  font-size: 20px; line-height: 1; background: var(--bg); border: 1px solid var(--stroke);
  border-radius: 12px; padding: 8px 10px; cursor: pointer; transition: transform .12s, box-shadow .12s;
}
.anya-theme-btn:hover { transform: scale(1.12); }
.anya-theme-btn.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
  transform: scale(1.12);
}

/* Аня & Слава — pastel */
body[data-anya-theme="anya-slava"] {
  --bg: #fdeff6; --surface: #ffffff; --elevated: #f6e3ee;
  --ink: #5b3a5f; --subtle: #b47fa8; --accent: #f48fb8;
  --mint: #86d9b8; --blue: #9d8bd6; --yellow: #f6c86b;
  --stroke: rgba(180,120,160,0.18); --sidebar-bg: #7a5c86;
}
/* Аня радостная — sunny */
body[data-anya-theme="happy"] {
  --bg: #fff7e0; --surface: #ffffff; --elevated: #fbeecb;
  --ink: #6e4e1a; --subtle: #c19a3e; --accent: #ff9e2c;
  --mint: #7fd04a; --blue: #ff7a4a; --yellow: #ffcf3e;
  --stroke: rgba(200,150,50,0.2); --sidebar-bg: #d6822e;
}
/* Аня грустит — muted blue */
body[data-anya-theme="sad"] {
  --bg: #edf1f7; --surface: #ffffff; --elevated: #e0e6f0;
  --ink: #3f4d66; --subtle: #8794ad; --accent: #6f8ac9;
  --mint: #9db8c9; --blue: #5570b5; --yellow: #b7c3d6;
  --stroke: rgba(80,100,140,0.14); --sidebar-bg: #46566f;
}
/* Аня злится — fiery */
body[data-anya-theme="angry"] {
  --bg: #fff0ed; --surface: #ffffff; --elevated: #ffe0da;
  --ink: #5a2626; --subtle: #c07a72; --accent: #ff4d3d;
  --red: #ff3b2f; --mint: #ff9a3a; --blue: #ff7a4a; --yellow: #ffa53a;
  --stroke: rgba(255,110,90,0.2); --sidebar-bg: #5a1e1e;
}

/* Themed primary button when a mood theme is active */
body[data-anya-theme] .btn-primary { background: var(--accent); }
.sidebar-footer { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding: 0 8px; }
.sidebar-footer .muted { color: rgba(255,255,255,0.5); word-break: break-all; }

main { flex: 1; padding: 28px 32px; max-width: 1100px; }
h2 { font-size: 26px; margin-bottom: 18px; letter-spacing: 0.3px; }
h3 { font-size: 15px; margin-bottom: 12px; color: var(--subtle); text-transform: uppercase; letter-spacing: 0.6px; }

/* Cards & panels */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--stroke);
  border-radius: var(--radius); padding: 18px;
}
.card .value { font-size: 30px; font-weight: 800; }
.card .label { font-size: 13px; color: var(--subtle); margin-top: 2px; }
.card .value.accent { color: var(--accent); }
.card .value.mint { color: var(--mint); }
.card .value.blue { color: var(--blue); }
.card .value.red { color: var(--red); }

.panel {
  background: var(--surface); border: 1px solid var(--stroke);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px;
}
.toolbar { margin-bottom: 14px; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; color: var(--subtle); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 8px 10px; border-bottom: 1px solid var(--stroke);
}
td { padding: 11px 10px; border-bottom: 1px solid var(--stroke); vertical-align: middle; }
tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block; padding: 4px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700;
}
.badge.requested { background: rgba(245,199,82,0.2); color: #a07708; }
.badge.confirmed { background: rgba(44,74,159,0.12); color: var(--blue); }
.badge.prepaid   { background: rgba(237,125,77,0.15); color: var(--accent); }
.badge.paid      { background: rgba(124,197,175,0.2); color: #1d7a5f; }
.badge.completed { background: var(--elevated); color: var(--subtle); }
.badge.cancelled { background: rgba(232,92,104,0.15); color: var(--red); }
.badge.open      { background: rgba(124,197,175,0.2); color: #1d7a5f; }
.badge.full      { background: rgba(245,199,82,0.2); color: #a07708; }

.spots-input { width: 60px; padding: 6px 8px; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
  z-index: 100;
}
.toast.err { background: var(--red); }

/* View head (title + action) */
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.view-head h2 { margin-bottom: 0; }
.btn-primary.sm { padding: 9px 16px; font-size: 14px; border-radius: 10px; }

/* Default badge (roles etc.) */
.badge { background: var(--elevated); color: var(--subtle); }

code {
  background: var(--elevated); padding: 2px 7px; border-radius: 6px;
  font-family: "SF Mono", ui-monospace, monospace; font-size: 12px; color: var(--ink);
}

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(46, 58, 92, 0.4);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto;
}
.modal {
  background: var(--surface); border-radius: 20px;
  width: 560px; max-width: 100%;
  box-shadow: 0 30px 80px rgba(46, 58, 92, 0.3);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--stroke);
}
.modal-head h3 { margin: 0; color: var(--ink); text-transform: none; font-size: 18px; letter-spacing: 0; }
.modal-body { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-body .btn-primary { margin-top: 6px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12px; font-weight: 700; color: var(--subtle); text-transform: uppercase; letter-spacing: 0.4px; }
.field textarea {
  border: 1px solid var(--stroke); border-radius: 12px; padding: 12px 14px;
  font-size: 14px; font-family: inherit; background: var(--bg); color: var(--ink);
  outline: none; resize: vertical;
}
.field textarea:focus { border-color: var(--accent); }
.field input, .field select { width: 100%; }
.form-row { display: flex; gap: 12px; }
.form-row .field { flex: 1; }

.checks { display: flex; flex-wrap: wrap; gap: 10px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { width: auto; }

/* Roster add row */
.roster-add { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.roster-add input, .roster-add select { flex: 1; min-width: 110px; }

/* Tour cover upload */
.cover-field { display: flex; align-items: center; gap: 12px; }
.cover-preview { width: 90px; height: 60px; object-fit: cover; border-radius: 10px; border: 1px solid var(--stroke); }
.cover-preview.empty { display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--subtle); background: var(--bg); }
.tour-thumb { width: 54px; height: 36px; object-fit: cover; border-radius: 8px; border: 1px solid var(--stroke); display: block; }

/* Tour days (program editor) */
.day-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.day-row .day-title { flex: 0 0 170px; }
.day-row .day-details { flex: 1; }
#days-list { margin-bottom: 6px; }

/* Search input full width */
#customer-search { width: 320px; max-width: 100%; }

/* Achievement badge with revoke button */
.ach-badge { display: inline-flex; align-items: center; gap: 6px; }
.ach-revoke {
  background: none; border: none; color: var(--subtle);
  cursor: pointer; font-size: 12px; padding: 0; line-height: 1;
}
.ach-revoke:hover { color: var(--red); }

/* Departure group chats */
.chats-layout { display: flex; gap: 16px; align-items: flex-start; }
.chats-list-panel { flex: 0 0 280px; }
.chats-thread-panel { flex: 1; display: flex; flex-direction: column; min-height: 420px; }
.chat-item {
  display: block; width: 100%; text-align: left;
  background: var(--bg); border: 1px solid var(--stroke); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 8px; cursor: pointer; font-size: 14px; color: var(--ink);
}
.chat-item:hover { border-color: var(--accent); }
.chat-item.active { border-color: var(--accent); background: rgba(237,125,77,0.1); }
.chat-head { font-weight: 700; margin-bottom: 12px; color: var(--ink); }
.msg-list { flex: 1; max-height: 440px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.msg { max-width: 78%; background: var(--bg); border: 1px solid var(--stroke); border-radius: 12px; padding: 8px 12px; }
.msg.mine { align-self: flex-end; background: rgba(237,125,77,0.12); border-color: transparent; }
.msg-meta { font-size: 11px; color: var(--subtle); margin-bottom: 2px; }
.msg-text { font-size: 14px; color: var(--ink); white-space: pre-wrap; }
.chat-send { display: flex; gap: 8px; }
.chat-send input { flex: 1; }

/* Native color picker as a swatch */
.field input[type="color"] {
  width: 100%; height: 46px; padding: 4px;
  border: 1px solid var(--stroke); border-radius: 12px;
  background: var(--bg); cursor: pointer;
}
