/* EsoTech AI — workspace UI (EsoTech). No build step required. */
:root {
  --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --line: #e2e8f0; --bg: #f4f6fb; --card: #ffffff;
  --nav: #111111; --nav-2: #171717; --nav-ink: #d4d4d4;
  --primary: #0F766E; --primary-2: #0B5F58; --primary-soft: #E6F4F2; --cyan: #14B8A6;
  --ok: #059669; --ok-soft: #ecfdf5; --warn: #b45309; --warn-soft: #fffbeb; --bad: #dc2626; --bad-soft: #fef2f2; --info: #0369a1; --info-soft: #f0f9ff;
  --radius: 14px; --shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px -16px rgba(15,23,42,.25);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-2); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.55rem; } h2 { font-size: 1.15rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; }
small, .muted { color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: .86em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1rem 0; }

/* Layout */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--nav), var(--nav-2)); color: var(--nav-ink); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.1rem; margin: 2px 6px 18px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--cyan)); color: #fff; font-size: 1rem; }
.brand small { display: block; color: #a3a3a3; font-weight: 600; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.nav-group { margin: 14px 6px 6px; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: #8a8a8a; font-weight: 700; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--nav-ink); font-weight: 600; font-size: .92rem; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav a.active { background: rgba(15,118,110,.42); color: #fff; box-shadow: inset 0 0 0 1px rgba(45,212,191,.35); }
.nav .ico { width: 18px; text-align: center; opacity: .9; }
.org-switch { margin: 0 6px 10px; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.05); font-size: .85rem; }
.org-switch strong { color: #fff; display: block; }
.org-switch select { width: 100%; margin-top: 6px; background: transparent; color: var(--nav-ink); border: 1px solid rgba(255,255,255,.15); border-radius: 8px; padding: 5px; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 28px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar .credits { font-weight: 700; color: var(--ink-2); }
.content { padding: 24px 28px 60px; max-width: 1400px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin: 0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Cards & grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; min-width: 0; }
.card > h2:first-child, .card > h3:first-child { margin-bottom: .8rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.stat { padding: 16px 18px; } .stat .v { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; } .stat .l { color: var(--muted); font-size: .85rem; }
.grid > .stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat > span { display: block; color: var(--muted); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat > strong { display: block; margin-top: 6px; font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.grid.g4 { margin-bottom: 16px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-radius: 10px; border: 1px solid transparent; background: var(--primary); color: #fff !important; font-weight: 700; font-size: .9rem; cursor: pointer; text-decoration: none !important; line-height: 1.2; white-space: nowrap; }
.btn:hover { background: var(--primary-2); }
.btn.ghost { background: #fff; color: var(--ink-2) !important; border-color: var(--line); }
.btn.ghost:hover { border-color: #99D5CD; background: var(--primary-soft); }
.btn.danger { background: var(--bad); } .btn.ok { background: var(--ok); }
.btn.sm { padding: 6px 11px; font-size: .82rem; border-radius: 8px; }
.btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; font: inherit; font-weight: 600; }

/* Forms */
.field { margin-bottom: 12px; min-width: 0; }
.field label { display: block; font-weight: 600; font-size: .82rem; margin-bottom: 4px; color: var(--ink-2); }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 3px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 9px; background: #fff; font: inherit; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15,118,110,.15); }
textarea { min-height: 90px; resize: vertical; }
input[type=file] { font-size: .85rem; }
.check { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; }
.form-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.errors { background: var(--bad-soft); border: 1px solid #fecaca; color: #991b1b; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.errors ul { margin: 0; padding-left: 18px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); background: #f8fafc; }
table.t td { padding: 9px 10px; border-bottom: 1px solid #eef2f7; vertical-align: top; }
table.t tr:hover td { background: #fafbff; }
table.t td.r, table.t th.r { text-align: right; white-space: nowrap; }
table.t input, table.t select { padding: 5px 7px; font-size: .84rem; }

/* Badges & alerts */
.badge { display: inline-block; align-self: flex-start; padding: 2px 9px; border-radius: 99px; font-size: .72rem; font-weight: 700; background: #eef2f7; color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.info { background: var(--info-soft); color: var(--info); } .badge.primary { background: var(--primary-soft); color: var(--primary); }
.alert { border-radius: 12px; padding: 11px 14px; margin-bottom: 14px; border: 1px solid; }
.alert.ok { background: var(--ok-soft); border-color: #a7f3d0; color: #065f46; } .alert.bad { background: var(--bad-soft); border-color: #fecaca; color: #991b1b; }
.alert.warn { background: var(--warn-soft); border-color: #fde68a; color: #92400e; } .alert.info { background: var(--info-soft); border-color: #bae6fd; color: #075985; }
.empty { text-align: center; padding: 34px 20px; color: var(--muted); }
.list { list-style: none; padding: 0; margin: 0; } .list li { padding: 9px 0; border-bottom: 1px solid #eef2f7; } .list li:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 12px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; }
.steps { list-style: none; padding: 0; margin: 8px 0 0; font-size: .85rem; color: var(--muted); } .steps li::before { content: "▸ "; color: var(--primary); }
.spinner { width: 14px; height: 14px; border: 2px solid #99D5CD; border-top-color: var(--primary); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Chat */
.chat { display: grid; grid-template-columns: 260px 1fr; gap: 18px; height: calc(100vh - 150px); }
.chat-list { overflow-y: auto; padding: 10px; } .chat-list a { display: block; padding: 8px 10px; border-radius: 9px; color: var(--ink-2); font-weight: 500; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list a.active, .chat-list a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.chat-main { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.messages { flex: 1; overflow-y: auto; padding: 20px 24px; }
.msg { max-width: 820px; margin-bottom: 16px; }
.msg.user { margin-left: auto; } .msg.user .bubble { background: var(--primary); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg .bubble { padding: 11px 15px; border-radius: 14px 14px 14px 4px; background: #f1f5f9; }
.msg.assistant .bubble { background: #fff; border: 1px solid var(--line); }
.msg.error .bubble { background: var(--warn-soft); border-color: #fde68a; }
.bubble p:last-child { margin-bottom: 0; } .bubble table { border-collapse: collapse; margin: 8px 0; } .bubble th, .bubble td { border: 1px solid var(--line); padding: 4px 8px; font-size: .88rem; }
.bubble ul, .bubble ol { padding-left: 20px; margin: 6px 0; }
.artifacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.artifact { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 10px; border: 1px solid #99D5CD; background: var(--primary-soft); font-size: .82rem; font-weight: 600; }
.citations { margin-top: 6px; font-size: .78rem; color: var(--muted); }
.composer { border-top: 1px solid var(--line); padding: 14px 18px; background: #fbfcff; }
.composer form { display: flex; gap: 10px; align-items: flex-end; } .composer textarea { min-height: 52px; max-height: 220px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } .suggestions button { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px; cursor: pointer; font-size: .82rem; color: var(--ink-2); }
.suggestions button:hover { border-color: var(--primary); color: var(--primary); }

/* Kanban & calendar */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: #eef1f8; border-radius: 12px; padding: 10px; min-height: 120px; } .col h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); display: flex; justify-content: space-between; }
.tile { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; margin-bottom: 8px; color: var(--ink); font-size: .87rem; }
.tile:hover { border-color: #5EEAD4; text-decoration: none; }
.tile strong, .tile small { display: block; } .tile small { margin-top: 2px; }
.kanban { margin-bottom: 16px; }
.actions select, .actions input[type=search], .actions input[type=number], .actions input[type=text] { width: auto; min-width: 150px; }
.card-head .actions { flex-wrap: nowrap; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.cal .dow { background: #f8fafc; font-size: .74rem; text-transform: uppercase; color: var(--muted); padding: 6px 8px; font-weight: 700; }
.cal .day { min-height: 110px; border-top: 1px solid #eef2f7; border-left: 1px solid #eef2f7; padding: 6px; font-size: .78rem; }
.cal .day.out { background: #fafbfd; color: #b6bfcd; } .cal .day .n { font-weight: 700; color: var(--muted); }
.cal .ev { display: block; margin-top: 4px; padding: 3px 6px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.media-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; color: var(--ink); }
.media-card .thumb { aspect-ratio: 1; background: #eef1f8 center/cover no-repeat; display: grid; place-items: center; color: var(--muted); font-size: 2rem; }
.media-card .meta { padding: 8px 10px; font-size: .82rem; }
.pre { white-space: pre-wrap; background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px; max-height: 420px; overflow: auto; font-size: .85rem; }
.prose { max-width: 820px; } .prose h1, .prose h2, .prose h3 { margin-top: 1rem; }

/* Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(800px 400px at 80% 0%, rgba(6,182,212,.18), transparent 60%), radial-gradient(700px 400px at 0% 100%, rgba(15,118,110,.25), transparent 60%), var(--nav); }
.auth .card { width: min(480px, 100%); padding: 28px; }
.auth .brand { color: var(--ink); justify-content: center; margin-bottom: 18px; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; } .nav-group { width: 100%; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; } .span2 { grid-column: auto; }
  .content { padding: 18px 16px 50px; } .topbar { padding: 12px 16px; }
  .chat { grid-template-columns: 1fr; height: auto; } .chat-list { max-height: 180px; } .messages { max-height: 60vh; }
  .kv { grid-template-columns: 1fr; }
}

/* Brand logo, user avatar and profile */
.brand { text-decoration: none !important; } .brand .et-logo { color: #fff; }
.topbar-user { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-weight: 600; text-decoration: none !important; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; background: var(--primary); color: #fff; font-weight: 700; overflow: hidden; }
.avatar-lg { width: 96px; height: 96px; font-size: 32px; }
.profile-photo { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* Plans & online payment */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 8px; }
.plan-card { border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: var(--card); display: flex; flex-direction: column; gap: 8px; }
.plan-card.current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.plan-name { font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.plan-price { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; } .plan-price small { font-size: .8rem; font-weight: 600; color: var(--muted); }
.plan-features { margin: 0 0 4px; padding-left: 18px; color: var(--ink-2); font-size: .88rem; }
.plan-card .field { margin: 0; }
.pay-status { max-width: 560px; margin: 20px auto; text-align: center; padding: 30px 24px; }
.pay-icon { display: flex; justify-content: center; margin-bottom: 12px; color: #111; }
.pay-ok, .pay-bad { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 800; color: #fff; background: var(--primary); }
.pay-bad { background: var(--warn); }
.pay-facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; text-align: left; margin-top: 16px; }
.pay-facts div { background: var(--bg); border-radius: 12px; padding: 10px 12px; } .pay-facts span { display: block; color: var(--muted); font-size: .78rem; } .pay-facts strong { font-size: .95rem; }
@media (max-width: 640px) { .pay-facts { grid-template-columns: 1fr; } }