/* Gizaseeds control panel - styled after Odoo.sh */

:root {
  --plum:        #4a3446;
  --plum-dark:   #3b2a38;
  --plum-light:  #5d4359;
  --accent:      #714b67;
  --green:       #28a745;
  --red:         #dc3545;
  --amber:       #d9822b;
  --ink:         #2b2b2b;
  --muted:       #7a7a7a;
  --line:        #dfdcdd;
  --line-soft:   #eceaeb;
  --bg:          #f6f6f6;
  --card:        #ffffff;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

/* The drawer and the modal set display:flex, which would otherwise beat the
   UA rule behind the `hidden` attribute and leave them permanently visible. */
[hidden] { display: none !important; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--ink);
  font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
}

a { color: var(--accent); text-decoration: none; cursor: pointer; }
code { font-family: var(--mono); font-size: 12px;
       background: #f0eef0; padding: 1px 4px; border-radius: 2px; }

/* ---------------------------------------------------------------- login */

.login-body {
  display: flex; align-items: center; justify-content: center;
  background: var(--plum);
}
.login-card {
  background: #fff; width: 340px; padding: 34px 30px 26px;
  border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
.login-brand { font-size: 22px; font-weight: 600; color: var(--plum); }
.login-brand span { color: var(--accent); font-weight: 300; }
.login-sub { color: var(--muted); margin-bottom: 22px; font-size: 12px;
             letter-spacing: .06em; text-transform: uppercase; }
.login-card label { display: block; font-weight: 600; margin-bottom: 5px; }
.login-card input {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line);
  border-radius: 3px; font-size: 14px; margin-bottom: 16px;
}
.login-card input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.login-card button {
  width: 100%; padding: 10px; background: var(--accent); color: #fff;
  border: 0; border-radius: 3px; font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.login-card button:hover { background: var(--plum); }
.login-error {
  background: #fdecea; color: #a4232c; border: 1px solid #f5c2c0;
  padding: 8px 10px; border-radius: 3px; margin-bottom: 16px;
}
.login-foot { margin-top: 16px; text-align: center; color: #aaa;
              font-size: 11px; }

/* --------------------------------------------------------------- topbar */

.topbar {
  height: 44px; background: var(--plum); color: #e9e2e7;
  display: flex; align-items: stretch; padding: 0 14px;
  position: sticky; top: 0; z-index: 40;
}
.brand {
  display: flex; align-items: center; font-size: 15px; font-weight: 600;
  color: #fff; padding-right: 18px; white-space: nowrap;
}
.brand span { font-weight: 300; opacity: .8; }
.topnav { display: flex; align-items: stretch; }
.topnav a {
  display: flex; align-items: center; padding: 0 14px; color: #d8ccd4;
  font-size: 13px;
}
.topnav a:hover { background: var(--plum-light); color: #fff; }
.topnav a.active { background: var(--plum-light); color: #fff; }
.topright {
  margin-left: auto; display: flex; align-items: center; gap: 14px;
  font-size: 12px; color: #cfc0c9; white-space: nowrap;
}
.project { opacity: .85; }
.user { color: #fff; font-weight: 600; }
.linkbtn { background: none; border: 0; color: #cfc0c9; cursor: pointer;
           font-size: 12px; padding: 0; }
.linkbtn:hover { color: #fff; text-decoration: underline; }
.jobpill {
  background: var(--amber); color: #fff; border-radius: 10px;
  padding: 2px 9px; font-size: 11px; font-weight: 600; cursor: pointer;
}

/* --------------------------------------------------------------- layout */

.layout { display: flex; min-height: calc(100vh - 44px); }

.sidebar {
  width: 210px; flex: none; background: #fff; border-right: 1px solid var(--line);
  padding: 10px 0; display: flex; flex-direction: column;
}
.filter {
  margin: 0 10px 10px; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 3px; font-size: 12px;
}
.sgroup { margin-bottom: 6px; }
.sgroup-title {
  padding: 8px 14px 4px; font-size: 12px; font-weight: 700; color: #555;
}
.sitem {
  display: flex; align-items: center; gap: 8px; padding: 6px 14px;
  cursor: pointer; border-left: 3px solid transparent; font-size: 13px;
}
.sitem:hover { background: #f5f2f4; }
.sitem.active {
  background: #f0eaee; border-left-color: var(--accent); font-weight: 600;
}
.sitem .name { flex: 1; overflow: hidden; text-overflow: ellipsis;
               white-space: nowrap; }
.sitem .ver { color: var(--muted); font-size: 11px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #ccc;
       flex: none; }
.dot.up   { background: var(--green); }
.dot.down { background: var(--red); }
.dot.warn { background: var(--amber); }

.sidefoot { margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--line-soft); }
.sidefoot-title { font-size: 11px; font-weight: 700; color: #555;
                  text-transform: uppercase; letter-spacing: .05em;
                  margin-bottom: 6px; }
.sidestats { font-size: 11px; color: var(--muted); line-height: 1.7; }
.sidestats b { color: var(--ink); font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.pagehead {
  background: #fff; padding: 14px 22px 12px; display: flex;
  align-items: flex-start; gap: 20px;
}
.pagehead h1 { margin: 0; font-size: 20px; font-weight: 400; }
.subtitle { color: var(--muted); font-size: 12px; margin-top: 3px; }
.subtitle a { color: var(--accent); }
.headactions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap;
               justify-content: flex-end; }

.tabs {
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; padding: 0 14px; overflow-x: auto;
}
.tabs a {
  padding: 10px 14px; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  color: #6b6b6b; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tabs a:hover { color: var(--ink); }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); }

.panelwrap { padding: 18px 22px 60px; flex: 1; }
.tabpane { display: none; }
.tabpane.active { display: block; }

/* ------------------------------------------------------------- controls */

.btn {
  background: #fff; border: 1px solid var(--line); border-radius: 3px;
  padding: 5px 12px; font-size: 12px; cursor: pointer; color: var(--ink);
  white-space: nowrap;
}
.btn:hover { background: #f4f1f3; border-color: #c9c3c7; }
.btn.primary { background: var(--accent); border-color: var(--accent);
               color: #fff; }
.btn.primary:hover { background: var(--plum); border-color: var(--plum); }
.btn.green { background: var(--green); border-color: var(--green); color: #fff; }
.btn.green:hover { filter: brightness(.92); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger:hover { filter: brightness(.92); }
.btn.small { padding: 3px 9px; font-size: 11px; }
.btn.big { padding: 8px 22px; font-size: 13px; margin-top: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.inp {
  border: 1px solid var(--line); border-radius: 3px; padding: 5px 8px;
  font-size: 12px; background: #fff; color: var(--ink);
}
.inp.wide { width: 100%; max-width: 460px; display: block; }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px;
           flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 12px; }
.inline { display: inline-flex; align-items: center; gap: 5px;
          font-size: 12px; color: #555; }
.chip {
  background: #f0eaee; color: var(--accent); border-radius: 3px;
  padding: 1px 7px; font-weight: 600; font-family: var(--mono);
  font-size: 12px;
}
.empty { color: var(--muted); padding: 30px 0; text-align: center; }
.note {
  margin-top: 16px; background: #fbf9fa; border: 1px solid var(--line-soft);
  border-left: 3px solid var(--accent); padding: 10px 12px; font-size: 12px;
  color: #555; border-radius: 2px; max-width: 860px;
}

/* ------------------------------------------------------------- timeline */

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px;
  width: 1px; background: var(--line);
}
.tl-date {
  font-size: 12px; color: #555; font-weight: 600; margin: 18px 0 8px -22px;
  padding-left: 22px;
}
.tl-date:first-child { margin-top: 0; }
.tl-item { position: relative; margin-bottom: 10px; }
.tl-item::before {
  content: ""; position: absolute; left: -21px; top: 14px; width: 9px;
  height: 9px; border-radius: 50%; background: #fff;
  border: 2px solid var(--accent);
}
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 3px;
  padding: 10px 12px;
}
.card-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  font-size: 12px;
}
.card-head .who { font-weight: 600; }
.card-head .when { color: var(--muted); }
.card-head .right { margin-left: auto; display: flex; gap: 8px;
                    align-items: center; }
.commit {
  display: flex; gap: 10px; padding: 5px 9px; border: 1px solid var(--line-soft);
  border-bottom: 0; font-size: 12px; align-items: baseline;
}
.commit:last-child { border-bottom: 1px solid var(--line-soft); }
.commit .subj { flex: 1; overflow: hidden; text-overflow: ellipsis;
                white-space: nowrap; }
/* Code-check findings are explanations, not one-line subjects - let them wrap. */
.commit.wrap { align-items: flex-start; }
.commit.wrap .subj { white-space: normal; overflow: visible; line-height: 1.7; }
.commit .sha { font-family: var(--mono); color: var(--muted); font-size: 11px; }
.badge {
  font-size: 11px; padding: 1px 8px; border-radius: 2px; font-weight: 600;
}
.badge.ok   { background: #e6f4ea; color: #1e7e34; }
.badge.bad  { background: #fdecea; color: #a4232c; }
.badge.warn { background: #fdf3e6; color: #a05a13; }
.badge.grey { background: #eee; color: #666; }

/* ---------------------------------------------------------------- table */

.table { width: 100%; border-collapse: collapse; background: #fff;
         border: 1px solid var(--line); }
.table th {
  text-align: left; font-size: 11px; text-transform: uppercase;
  letter-spacing: .05em; color: #666; padding: 8px 10px;
  border-bottom: 1px solid var(--line); background: #faf9fa;
}
.table td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft);
            font-size: 12px; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fbfafb; }
.table .right, .table th.right { text-align: right; }
.table .fname { font-family: var(--mono); font-size: 11.5px; }
.rowactions { display: inline-flex; gap: 5px; }

/* -------------------------------------------------------------- console */

.console {
  background: #1e1b1e; color: #ddd; font-family: var(--mono); font-size: 11.5px;
  line-height: 1.55; padding: 12px 14px; border-radius: 3px; margin: 0;
  overflow: auto; max-height: 62vh; white-space: pre-wrap; word-break: break-word;
}
.console.tall { max-height: none; height: calc(100% - 38px); border-radius: 0; }
.console .e { color: #ff8b80; }
.console .w { color: #f0c674; }
.console .g { color: #9fd68a; }

/* ---------------------------------------------------------------- merge */

.mergegrid { display: grid; grid-template-columns: 380px 1fr; gap: 22px;
             align-items: start; }
.mergeform, .formcard {
  background: #fff; border: 1px solid var(--line); border-radius: 3px;
  padding: 16px 18px;
}
.mergeform h3, .formcard h3 { margin: 0 0 14px; font-size: 15px;
                              font-weight: 600; }
.mergeform label, .formcard label {
  display: block; font-size: 12px; font-weight: 600; color: #555;
  margin: 10px 0 4px;
}
.checks { margin-top: 14px; }
.checks label {
  display: flex; align-items: flex-start; gap: 7px; font-weight: 400;
  color: #444; margin: 7px 0;
}
.checks input { margin-top: 2px; }
.danger-label { color: var(--red) !important; }
.mergepreview {
  background: #fff; border: 1px solid var(--line); border-radius: 3px;
  padding: 14px 16px; min-height: 220px;
}
.preview-head { display: flex; align-items: center; gap: 10px;
                margin-bottom: 12px; flex-wrap: wrap; }
.diffline { font-family: var(--mono); font-size: 11.5px; padding: 2px 0;
            color: #555; }
.diffline .add { color: #1e7e34; }
.diffline .del { color: #a4232c; }
.filerow { font-family: var(--mono); font-size: 11.5px; padding: 2px 0; }
.filerow .st { display: inline-block; width: 16px; font-weight: 700; }
.filerow .st.A { color: #1e7e34; }
.filerow .st.M { color: #a05a13; }
.filerow .st.D { color: #a4232c; }
.scroll240 { max-height: 240px; overflow: auto; }
h4.sec { margin: 16px 0 6px; font-size: 12px; text-transform: uppercase;
         letter-spacing: .05em; color: #666; }

/* -------------------------------------------------------------- monitor */

.mongrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr));
           gap: 14px; margin-bottom: 20px; }
.moncard { background: #fff; border: 1px solid var(--line); border-radius: 3px;
           padding: 14px 16px; }
.moncard .lbl { font-size: 11px; text-transform: uppercase; color: #666;
                letter-spacing: .05em; }
.moncard .val { font-size: 24px; font-weight: 300; margin: 6px 0 4px; }
.bar { height: 6px; background: #eee; border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); }
.bar i.warn { background: var(--amber); }
.bar i.bad  { background: var(--red); }

/* --------------------------------------------------------------- drawer */

.drawer {
  position: fixed; right: 0; bottom: 0; top: 44px; width: 62vw; min-width: 520px;
  background: #262226; border-left: 1px solid #000; z-index: 50;
  display: flex; flex-direction: column; box-shadow: -6px 0 24px rgba(0,0,0,.3);
}
.drawer-head {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--plum-dark); color: #eee; font-size: 12px; flex: none;
}
.drawer-head .spacer { margin-left: auto; }
.drawer-state { font-size: 11px; padding: 1px 8px; border-radius: 2px;
                background: #4a4a4a; }
.drawer-state.running { background: var(--amber); }
.drawer-state.done { background: var(--green); }
.drawer-state.failed { background: var(--red); }

/* ---------------------------------------------------------------- modal */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 60;
  display: flex; align-items: center; justify-content: center;
}
.modal { background: #fff; border-radius: 4px; width: 480px; max-width: 92vw;
         box-shadow: 0 12px 44px rgba(0,0,0,.35); }
.modal-head { padding: 14px 18px; font-size: 15px; font-weight: 600;
              border-bottom: 1px solid var(--line); }
.modal-body { padding: 16px 18px; font-size: 13px; line-height: 1.6; }
.modal-body .inp { margin-top: 8px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line);
              display: flex; gap: 8px; justify-content: flex-end; }

/* --------------------------------------------------------------- toasts */

.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 70;
          display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #333; color: #fff; padding: 9px 14px; border-radius: 3px;
  font-size: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.25); max-width: 380px;
}
.toast.ok  { background: #1e7e34; }
.toast.bad { background: #a4232c; }

/* ----------------------------------------------------------------- jobs */

.jobrow {
  display: flex; align-items: center; gap: 12px; background: #fff;
  border: 1px solid var(--line); border-radius: 3px; padding: 9px 12px;
  margin-bottom: 6px; font-size: 12px; cursor: pointer;
}
.jobrow:hover { background: #fbfafb; }
.jobrow .t { flex: 1; font-weight: 600; }
.jobrow .m { color: var(--muted); }

@media (max-width: 1000px) {
  .mergegrid { grid-template-columns: 1fr; }
  .drawer { width: 100vw; min-width: 0; }
  .project { display: none; }
}
