:root {
  --navy: #121a33;
  --navy2: #1b274b;
  --blue: #2f6fed;
  --bg: #f4f7fb;
  --text: #182033;
  --muted: #6b7280;
  --line: #e2e8f0;
  --white: #fff;
  --red: #d92d20;
  --amber: #b54708;
  --green: #067647;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a {
  color: var(--blue);
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--navy);
  color: #fff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4c83ff, #7aa8ff);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  font-size: 11px;
  color: #aebbd4;
  margin-top: 2px;
}

.sidebar nav {
  display: grid;
  gap: 6px;
  margin-top: 42px;
}

.sidebar nav a {
  color: #c8d2e6;
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 600;
}

.sidebar nav a:hover,
.sidebar nav a.active {
  background: var(--navy2);
  color: #fff;
}

.logout {
  margin-top: auto;
  width: 100%;
  padding: 11px;
  border: 1px solid #354263;
  background: transparent;
  color: #c8d2e6;
  border-radius: 10px;
  cursor: pointer;
}

.content {
  min-width: 0;
  padding: 36px 42px 20px;
}

.mobile-header {
  display: none;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.page-heading h1 {
  font-size: 30px;
  margin: 3px 0 0;
}

.eyebrow {
  font-size: 12px;
  color: var(--blue);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.date {
  color: var(--muted);
  font-size: 14px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.metrics article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 18px rgba(25, 42, 77, 0.04);
}

.metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  display: block;
  font-size: 30px;
  margin-top: 8px;
}

.metrics .warning {
  border-color: #fed7aa;
  background: #fffaf5;
}

.two-columns {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 20px;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 18px rgba(25, 42, 77, 0.035);
  margin-bottom: 20px;
}

.panel h2 {
  font-size: 17px;
  margin: 0 0 18px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.panel-title h2 {
  margin: 0;
}

.panel-title a {
  font-size: 13px;
  font-weight: 700;
}

.empty {
  padding: 24px 8px;
  color: var(--muted);
  text-align: center;
}

.list-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.list-row:last-child {
  border: 0;
}

.list-row small,
td small,
.message-row small,
.conversation-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.time {
  font-weight: 800;
  color: var(--blue);
}

.message-row {
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
}

.message-row:last-child {
  border: 0;
}

.message-row p {
  margin: 8px 0 0;
  font-size: 13px;
  color: #40485b;
}

.badge {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2f7;
  color: #526075;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.badge.confirmata,
.badge.finalizata {
  background: #ecfdf3;
  color: var(--green);
}

.badge.in_asteptare,
.badge.noua {
  background: #fffaeb;
  color: var(--amber);
}

.badge.anulata,
.badge.alert {
  background: #fef3f2;
  color: var(--red);
}

.badge.in_lucru {
  background: #eff8ff;
  color: #175cd3;
}

.filters {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.filters input {
  flex: 1;
}

.filters input,
.filters select,
.stack-form input,
.stack-form select {
  min-height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  font: inherit;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 44px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  font-weight: 750;
  cursor: pointer;
}

.button.primary {
  background: var(--blue);
  color: #fff;
}

.button.ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.table-wrap {
  overflow: auto;
  padding: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #f8fafc;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

tbody tr:hover {
  background: #fafcff;
}

.conversation-list,
.conversation-list.single-column {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.conversation-card {
  position: relative;
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 17px;
}

.conversation-card.needs-reply {
  border-color: #fdb022;
}

.conversation-card p {
  font-size: 13px;
  line-height: 1.5;
  margin: 12px 0;
}

.conversation-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.conversation-flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.conversation-message {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-grid {
  grid-template-columns: repeat(2, 1fr);
}

dl {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 10px 16px;
  margin: 0;
}

dt {
  color: var(--muted);
  font-size: 12px;
}

dd {
  margin: 0;
  font-size: 14px;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
}

.stack-form .checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
}

.stack-form .checkbox-row input[type="checkbox"] {
  appearance: auto;
  min-height: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--blue);
}

.stack-form .checkbox-row span {
  font-size: 14px;
  font-weight: 700;
}

.flag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.flag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.flag.warranty {
  color: #175cd3;
  background: #eff8ff;
  border: 1px solid #b2ddff;
}

.flag.difficult {
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fecdca;
}

.chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 560px;
  overflow: auto;
  padding: 4px;
}

.bubble {
  max-width: 78%;
  padding: 11px 13px;
  border-radius: 14px;
  background: #eef2f7;
}

.bubble.outgoing {
  align-self: flex-end;
  background: #e7f8ed;
}

.bubble small {
  color: var(--muted);
  font-size: 10px;
}

.bubble p {
  margin: 5px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.save-toast {
  position: fixed;
  z-index: 1000;
  top: 22px;
  right: 22px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 18px;
  color: #05603a;
  background: #ecfdf3;
  border: 1px solid #abefc6;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.16);
  font-size: 14px;
  font-weight: 750;
}

footer {
  text-align: center;
  color: #94a3b8;
  font-size: 11px;
  padding: 28px 0 4px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top right, #253866, var(--navy) 55%);
}

.login-card {
  width: min(420px, calc(100% - 32px));
  background: #fff;
  border-radius: 20px;
  padding: 34px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.login-brand {
  color: var(--text);
  margin-bottom: 30px;
}

.login-card h1 {
  margin: 0 0 6px;
}

.login-card > p {
  color: var(--muted);
  margin: 0 0 22px;
}

.alert.error {
  background: #fef3f2;
  color: var(--red);
  border-radius: 10px;
  padding: 11px;
  margin-bottom: 14px;
  font-size: 13px;
}

@media (max-width: 1000px) {
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    height: auto;
    position: fixed;
    z-index: 20;
    bottom: 0;
    top: auto;
    width: 100%;
    padding: 8px;
    background: var(--navy);
  }

  .sidebar > .brand,
  .sidebar form {
    display: none;
  }

  .sidebar nav {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
  }

  .sidebar nav a {
    font-size: 11px;
    text-align: center;
    padding: 10px 4px;
  }

  .content {
    padding: 18px 14px 84px;
  }

  .mobile-header {
    display: block;
    margin-bottom: 24px;
  }

  .mobile-header .brand small {
    display: none;
  }

  .page-heading {
    align-items: flex-start;
  }

  .date {
    display: none;
  }

  .metrics {
    gap: 10px;
  }

  .metrics article {
    padding: 15px;
  }

  .metrics strong {
    font-size: 25px;
  }

  .filters {
    flex-wrap: wrap;
  }

  .filters input {
    flex-basis: 100%;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 15px;
  }

  .table-wrap {
    padding: 0;
  }

  dl {
    grid-template-columns: 120px 1fr;
  }

  .bubble {
    max-width: 92%;
  }

  .conversation-header {
    flex-direction: column;
  }

  .conversation-flags {
    justify-content: flex-start;
  }

  .save-toast {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
}
.table-flags,
.status-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.table-flags {
  margin-top: 8px;
}
.date-navigation {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
}

.date-picker-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-picker-form input[type="date"] {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.appointment-row {
  grid-template-columns: 125px 1fr auto;
}

.appointment-time {
  font-size: 13px;
  line-height: 1.25;
}

@media (max-width: 720px) {
  .date-navigation {
    align-items: stretch;
  }

  .date-navigation > *,
  .date-picker-form {
    width: 100%;
  }

  .date-picker-form input[type="date"] {
    flex: 1;
    min-width: 0;
  }

  .date-navigation .button {
    flex: 1;
  }

  .appointment-row {
    grid-template-columns: 92px 1fr;
  }

  .appointment-row > .badge {
    grid-column: 2;
    width: fit-content;
  }
}
.full-width {
  grid-column: 1 / -1;
}

.edit-service-form {
  display: block;
}

.form-hint {
  color: var(--muted);
  font-size: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.field > span {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.field-wide {
  grid-column: 1 / -1;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--text);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font: inherit;
}

.field textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.45;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid rgba(47, 111, 237, 0.2);
  border-color: var(--blue);
}

.checkbox-group {
  gap: 8px;
}

.checkbox-group .checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  cursor: pointer;
}

.checkbox-group .checkbox-row input[type="checkbox"] {
  appearance: auto;
  width: 18px;
  height: 18px;
  min-height: 0;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--blue);
}

.checkbox-group .checkbox-row span {
  font-size: 14px;
  font-weight: 700;
}

.save-service-button {
  width: 100%;
  margin-top: 18px;
}

.error-toast {
  position: fixed;
  z-index: 1000;
  top: 22px;
  right: 22px;
  max-width: min(480px, calc(100vw - 32px));
  padding: 14px 18px;
  color: #b42318;
  background: #fef3f2;
  border: 1px solid #fecdca;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.16);
  font-size: 14px;
  font-weight: 750;
}

@media (max-width: 720px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .form-hint {
    display: none;
  }

  .error-toast {
    top: 12px;
    right: 12px;
    left: 12px;
    max-width: none;
  }
}
.page-actions{display:flex;justify-content:flex-end;gap:10px;margin:-10px 0 20px}
@media(max-width:720px){.page-actions .button{width:100%}}
