:root {
  --brand: #59c963;
  --brand-dark: #2f8e4d;
  --brand-deep: #1f5f36;
  --brand-soft: #eaf8ed;

  --charcoal: #303534;

  --bg: #f6f8f7;
  --card: #ffffff;

  --text: #17201d;
  --muted: #75817d;

  --border: #e2e8e5;

  --danger: #dc4c4c;
  --warning: #d99b34;
  --blue: #4f7fc7;

  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Cairo", sans-serif;
}

button,
input {
  font-family: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}


/* LOGIN */

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px;
  background:
    radial-gradient(circle at 90% 10%, rgba(89,201,99,.10), transparent 30%),
    #f4f7f5;
}

.login-shell {
  width: min(1080px, 100%);
  min-height: 640px;

  display: grid;
  grid-template-columns: 1fr 1fr;

  overflow: hidden;

  background: white;
  border: 1px solid var(--border);

  border-radius: 26px;

  box-shadow:
    0 25px 80px rgba(29, 57, 45, .10);
}

.login-brand-panel {
  position: relative;

  padding: 56px;

  color: white;

  background:
    linear-gradient(
      145deg,
      var(--brand-deep),
      var(--brand-dark)
    );

  overflow: hidden;
}

.login-logo {
  position: relative;
  z-index: 2;

  width: 235px;
  max-width: 100%;

  filter: brightness(0) invert(1);
}

.login-brand-copy {
  position: relative;
  z-index: 2;

  margin-top: 110px;
}

.brand-badge {
  display: inline-flex;

  padding: 7px 12px;

  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;

  background: rgba(255,255,255,.10);

  font-size: 11px;
  font-weight: 700;
}

.login-brand-copy h1 {
  margin: 20px 0 12px;

  font-size: 35px;
  line-height: 1.5;

  font-weight: 800;
}

.login-brand-copy p {
  max-width: 360px;

  color: rgba(255,255,255,.72);

  line-height: 1.9;
  font-size: 14px;
}

.brand-pattern {
  position: absolute;

  width: 420px;
  height: 420px;

  left: -170px;
  bottom: -190px;

  border-radius: 50%;

  border: 75px solid rgba(255,255,255,.035);
}


.login-form-panel {
  display: grid;
  place-items: center;

  padding: 60px;
}

.login-box {
  width: min(380px, 100%);
}

.mobile-logo {
  display: none;
}

.eyebrow {
  display: block;

  color: var(--brand-dark);

  font-size: 12px;
  font-weight: 800;
}

.login-box h2 {
  margin: 8px 0 5px;

  font-size: 30px;
  font-weight: 800;
}

.muted {
  color: var(--muted);
}

.login-box p {
  font-size: 13px;
}

label {
  display: block;

  margin-top: 22px;

  color: #37433f;

  font-size: 13px;
  font-weight: 700;
}

.input-wrap {
  position: relative;

  margin-top: 8px;
}

.input-wrap i {
  position: absolute;

  right: 15px;
  top: 50%;

  transform: translateY(-50%);

  color: #95a19d;

  font-size: 13px;
}

input {
  width: 100%;

  padding: 13px 42px 13px 13px;

  background: #fafcfb;

  border: 1px solid var(--border);
  border-radius: 11px;

  outline: none;

  font-size: 14px;

  transition: .15s ease;
}

input:focus {
  border-color: var(--brand);

  box-shadow: 0 0 0 3px rgba(89,201,99,.10);

  background: white;
}

.primary-button {
  width: 100%;

  margin-top: 26px;
  padding: 13px 18px;

  border: 0;
  border-radius: 11px;

  background: var(--brand-dark);

  color: white;

  font-weight: 800;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;

  transition: .15s ease;
}

.primary-button:hover {
  background: var(--brand-deep);

  transform: translateY(-1px);
}

.error {
  min-height: 22px;

  margin-top: 12px;

  color: var(--danger);

  font-size: 12px;
}


/* APP */

.app {
  min-height: 100vh;

  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
}


/* SIDEBAR */

.sidebar {
  position: sticky;

  top: 0;

  height: 100vh;

  padding: 24px 16px;

  display: flex;
  flex-direction: column;

  background:
    linear-gradient(
      180deg,
      #17472d,
      #123a25
    );

  color: white;
}

.sidebar-logo {
  padding: 10px;
  margin-bottom: 12px;

  background: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
}

.sidebar-logo img {
  display: block;
  width: 185px;
  max-width: 100%;
  height: auto;
  margin: auto;

  filter: none;
}

.sidebar-section-label {
  padding: 21px 13px 8px;

  color: rgba(255,255,255,.40);

  font-size: 10px;
  font-weight: 700;

  letter-spacing: .4px;
}

nav {
  display: grid;

  gap: 3px;
}

.nav-item {
  width: 100%;

  padding: 10px 12px;

  display: flex;
  align-items: center;
  gap: 11px;

  border: 0;
  border-radius: 9px;

  background: transparent;

  color: rgba(255,255,255,.68);

  text-align: right;

  font-size: 12px;
  font-weight: 600;

  transition: .15s ease;
}

.nav-item i {
  width: 18px;

  text-align: center;

  color: rgba(255,255,255,.48);
}

.nav-item:hover {
  color: white;

  background: rgba(255,255,255,.07);
}

.nav-item.active {
  color: #173a27;

  background: white;

  font-weight: 800;
}

.nav-item.active i {
  color: var(--brand-dark);
}

.sidebar-footer {
  margin-top: auto;

  padding: 12px;
}

.system-pill {
  padding: 9px 11px;

  display: flex;
  align-items: center;
  gap: 8px;

  color: rgba(255,255,255,.65);

  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;

  background: rgba(255,255,255,.04);

  font-size: 10px;
}

.status-dot {
  width: 7px;
  height: 7px;

  border-radius: 50%;

  background: #76dd7d;

  box-shadow: 0 0 0 4px rgba(118,221,125,.12);
}


/* MAIN */

.main {
  min-width: 0;
}

.topbar {
  height: 76px;

  padding: 0 30px;

  position: sticky;
  top: 0;
  z-index: 20;

  display: flex;
  align-items: center;
  justify-content: space-between;

  background: rgba(255,255,255,.94);

  backdrop-filter: blur(12px);

  border-bottom: 1px solid var(--border);
}

.page-eyebrow {
  display: block;

  color: var(--muted);

  font-size: 9px;
  font-weight: 700;
}

.topbar h2 {
  margin: 2px 0 0;

  font-size: 16px;
}

.user-area {
  display: flex;
  align-items: center;

  gap: 10px;
}

.icon-button,
.logout-button {
  width: 38px;
  height: 38px;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: white;

  color: #68736f;
}

.user-card {
  padding: 5px 8px;

  display: flex;
  align-items: center;

  gap: 9px;
}

.avatar {
  width: 36px;
  height: 36px;

  display: grid;
  place-items: center;

  border-radius: 10px;

  background: var(--brand-soft);

  color: var(--brand-dark);
}

.user-card div:last-child {
  display: flex;
  flex-direction: column;
}

.user-card strong {
  font-size: 11px;
}

.user-card span {
  color: var(--muted);

  font-size: 9px;
}

#content {
  max-width: 1500px;

  margin: auto;

  padding: 28px;
}


/* DASHBOARD */

.dashboard-hero {
  padding: 24px 26px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  background:
    linear-gradient(
      130deg,
      #ffffff,
      #f1faf3
    );

  border: 1px solid #dfeae2;
  border-radius: var(--radius);
}

.hero-badge,
.page-tag {
  display: inline-flex;

  padding: 5px 9px;

  border-radius: 999px;

  background: var(--brand-soft);

  color: var(--brand-dark);

  font-size: 10px;
  font-weight: 800;
}

.dashboard-hero h1 {
  margin: 8px 0 3px;

  font-size: 23px;
}

.dashboard-hero p {
  margin: 0;

  color: var(--muted);

  font-size: 12px;
}

.hero-actions {
  display: flex;

  gap: 8px;
}

.primary-action,
.secondary-action {
  padding: 10px 14px;

  display: flex;
  align-items: center;
  gap: 7px;

  border-radius: 9px;

  font-size: 11px;
  font-weight: 700;
}

.primary-action {
  border: 0;

  background: var(--brand-dark);

  color: white;
}

.secondary-action {
  border: 1px solid var(--border);

  background: white;

  color: #56605c;
}


/* METRICS */

.cards {
  margin-top: 16px;

  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));

  gap: 12px;
}

.metric-card {
  padding: 17px;

  display: flex;
  align-items: center;

  gap: 13px;

  background: white;

  border: 1px solid var(--border);
  border-radius: 13px;

  box-shadow: 0 2px 8px rgba(35,59,49,.025);
}

.metric-icon {
  width: 40px;
  height: 40px;

  display: grid;
  place-items: center;

  border-radius: 11px;

  font-size: 15px;
}

.metric-icon.green {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.metric-icon.amber {
  color: #b57820;
  background: #fff4df;
}

.metric-icon.blue {
  color: #4672b3;
  background: #edf4ff;
}

.metric-icon.red {
  color: #c64c4c;
  background: #fff0f0;
}

.metric-card span {
  display: block;

  color: var(--muted);

  font-size: 10px;
}

.metric-card strong {
  display: block;

  margin-top: 2px;

  font-size: 18px;
}

.metric-card small {
  color: #a0aaa6;

  font-size: 9px;
}


/* PANELS */

.dashboard-grid {
  margin-top: 16px;

  display: grid;
  grid-template-columns: 2fr 1fr;

  gap: 16px;
}

.panel,
.table-card,
.placeholder-card {
  background: white;

  border: 1px solid var(--border);
  border-radius: var(--radius);

  box-shadow: 0 3px 12px rgba(27,53,42,.025);
}

.panel {
  padding: 20px;
}

.panel-header,
.table-header {
  padding-bottom: 13px;

  display: flex;
  justify-content: space-between;
  align-items: center;

  border-bottom: 1px solid #eef2f0;
}

.panel-header h3,
.table-header h3 {
  margin: 0;

  font-size: 13px;
}

.panel-header p,
.table-header p {
  margin: 3px 0 0;

  color: var(--muted);

  font-size: 9px;
}

.text-button {
  border: 0;

  background: transparent;

  color: var(--brand-dark);

  font-size: 10px;
  font-weight: 700;
}


/* WORKFLOW */

.workflow {
  padding: 28px 4px 10px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 6px;
}

.workflow-step {
  min-width: 70px;

  text-align: center;
}

.workflow-number {
  width: 36px;
  height: 36px;

  margin: 0 auto 7px;

  display: grid;
  place-items: center;

  border-radius: 50%;

  background: var(--brand-soft);

  color: var(--brand-dark);

  font-size: 11px;
  font-weight: 800;
}

.workflow-step strong {
  display: block;

  font-size: 10px;
}

.workflow-step span {
  color: var(--muted);

  font-size: 8px;
}

.workflow-arrow {
  color: #d0d9d5;

  font-size: 8px;
}


/* SERVICES */

.service-list {
  padding-top: 8px;
}

.service-row {
  padding: 12px 2px;

  display: flex;
  justify-content: space-between;

  border-bottom: 1px solid #f0f3f2;

  font-size: 10px;
}

.service-row span:first-child {
  display: flex;
  gap: 8px;

  color: #4f5a56;
}

.badge {
  padding: 4px 8px;

  border-radius: 999px;

  font-size: 8px;
  font-weight: 800;
}

.badge.success {
  color: #247d41;

  background: #eaf7ed;
}


/* PAGES */

.page-header {
  margin-bottom: 15px;
}

.page-header h1 {
  margin: 7px 0 2px;

  font-size: 21px;
}

.page-header p {
  margin: 0;

  color: var(--muted);

  font-size: 11px;
}


/* TABLE */

.table-card {
  overflow: hidden;
}

.table-header {
  padding: 17px 20px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;

  border-collapse: collapse;
}

thead {
  background: #f8faf9;
}

th,
td {
  padding: 13px 15px;

  text-align: right;

  border-bottom: 1px solid #eef2f0;

  white-space: nowrap;
}

th {
  color: #7c8783;

  font-size: 9px;
  font-weight: 800;
}

td {
  color: #394440;

  font-size: 10px;
}

tbody tr:hover {
  background: #fbfcfb;
}


/* PLACEHOLDER */

.placeholder-card {
  min-height: 400px;

  display: grid;
  place-items: center;

  align-content: center;

  padding: 50px;

  text-align: center;
}

.placeholder-icon {
  width: 60px;
  height: 60px;

  margin-bottom: 14px;

  display: grid;
  place-items: center;

  border-radius: 16px;

  background: var(--brand-soft);

  color: var(--brand-dark);

  font-size: 22px;
}

.placeholder-card h1 {
  margin: 0;

  font-size: 20px;
}

.placeholder-card p {
  max-width: 400px;

  color: var(--muted);

  font-size: 11px;
}


/* MOBILE */

@media (max-width: 1000px) {

  .app {
    grid-template-columns: 82px minmax(0,1fr);
  }

  .sidebar-logo {
    padding: 6px;
  }

  .sidebar-logo img {
    width: 52px;
    height: auto;
    object-fit: contain;
  }

  .nav-item span,
  .sidebar-section-label,
  .system-pill {
    display: none;
  }

  .nav-item {
    justify-content: center;
  }

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

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

  .workflow {
    overflow-x: auto;
  }

}


@media (max-width: 700px) {

  .login-page {
    padding: 14px;
  }

  .login-shell {
    display: block;

    min-height: auto;

    border-radius: 20px;
  }

  .login-brand-panel {
    display: none;
  }

  .login-form-panel {
    padding: 35px 25px;
  }

  .mobile-logo {
    display: block;

    margin-bottom: 30px;
  }

  .mobile-logo img {
    width: 190px;
  }

  .app {
    display: block;
  }

  .sidebar {
    position: fixed;

    bottom: 0;
    top: auto;

    width: 100%;
    height: 66px;

    z-index: 50;

    padding: 7px;

    display: block;
  }

  .sidebar-logo,
  .sidebar-section-label,
  .sidebar-footer {
    display: none;
  }

  nav {
    height: 100%;

    display: flex;

    overflow-x: auto;
  }

  .nav-item {
    min-width: 62px;
  }

  .topbar {
    padding: 0 15px;
  }

  .page-eyebrow {
    display: none;
  }

  .user-card {
    display: none;
  }

  #content {
    padding: 16px 13px 86px;
  }

  .dashboard-hero {
    display: block;
  }

  .hero-actions {
    margin-top: 18px;
  }

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

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

}

/* =========================
   CRM
========================= */

.crm-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.crm-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0,1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.crm-stat {
  text-align: right;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  color: var(--muted);
}

.crm-stat span {
  display: block;
  font-size: 9px;
}

.crm-stat strong {
  display: block;
  margin-top: 4px;
  font-size: 19px;
  color: var(--text);
}

.crm-stat.active {
  border-color: #bde6c5;
  background: var(--brand-soft);
}

.crm-stat.active strong,
.crm-stat.active span {
  color: var(--brand-dark);
}

.crm-table-header {
  gap: 20px;
}

.crm-search {
  position: relative;
  width: 260px;
}

.crm-search i {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #99a39f;
  font-size: 11px;
}

.crm-search input {
  margin: 0;
  padding: 9px 34px 9px 10px;
  font-size: 11px;
}

.crm-table td:first-child {
  font-weight: 800;
  color: #25302c;
}

.crm-link {
  color: var(--brand-dark);
  font-weight: 800;
  cursor: pointer;
}

.crm-link:hover {
  text-decoration: underline;
}

.crm-select {
  min-width: 115px;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafcfb;
  font-family: inherit;
  font-size: 9px;
  color: #414b47;
}

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

.status-badge {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 800;
}

.status-new {
  background: #edf4ff;
  color: #4672b3;
}

.status-contacted,
.status-appointment,
.status-quotation {
  background: #fff4df;
  color: #a96e1d;
}

.status-follow_up {
  background: #f5edff;
  color: #7652a8;
}

.status-won {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.status-lost {
  background: #fff0f0;
  color: #b84242;
}


/* MODAL */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;

  display: grid;
  place-items: center;

  padding: 24px;

  background: rgba(16, 29, 23, .45);
  backdrop-filter: blur(4px);
}

.modal-card {
  width: min(650px, 100%);
  max-height: 90vh;
  overflow-y: auto;

  padding: 23px;

  background: white;

  border-radius: 18px;

  box-shadow: 0 25px 70px rgba(18, 47, 34, .20);
}

.modal-wide {
  width: min(1000px, 100%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  padding-bottom: 15px;
  margin-bottom: 18px;

  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 6px 0 0;
  font-size: 18px;
}

.modal-close {
  width: 34px;
  height: 34px;

  border: 1px solid var(--border);
  border-radius: 9px;

  background: white;
  color: #777;
}

.modal-form label,
.detail-panel label {
  margin-top: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

textarea,
select {
  width: 100%;
  margin-top: 7px;
  padding: 10px 11px;

  border: 1px solid var(--border);
  border-radius: 9px;

  background: #fafcfb;

  font-family: inherit;
  font-size: 11px;

  outline: none;
}

textarea:focus,
select:focus {
  border-color: var(--brand);
}

.modal-form > label {
  margin-top: 15px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;

  margin-top: 20px;
}


/* DETAILS */

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.detail-panel {
  padding: 17px;

  background: #fafcfb;

  border: 1px solid var(--border);
  border-radius: 13px;
}

.detail-panel h3 {
  margin: 0 0 15px;
  font-size: 12px;
}

.detail-row {
  display: flex;
  justify-content: space-between;

  padding: 8px 0;

  border-bottom: 1px solid #edf1ef;

  font-size: 10px;
}

.detail-row span {
  color: var(--muted);
}

.detail-panel label {
  display: block;
  margin-top: 14px;
}

.full-button {
  width: 100%;
  justify-content: center;
  margin-top: 16px;
  border: 0;
}

.activity-list {
  max-height: 330px;
  overflow-y: auto;
}

.activity-item {
  padding: 11px 0;
  border-bottom: 1px solid #edf1ef;
}

.activity-item strong {
  display: block;
  font-size: 10px;
}

.activity-item p {
  margin: 4px 0;
  font-size: 10px;
  line-height: 1.7;
}

.activity-item small {
  color: var(--muted);
  font-size: 8px;
}

.activity-form {
  margin-top: 15px;
}

.activity-form button {
  margin-top: 8px;
  border: 0;
}


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

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


@media (max-width: 700px) {
  .crm-header {
    display: block;
  }

  .crm-header button {
    margin-top: 12px;
  }

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

  .crm-table-header {
    display: block;
  }

  .crm-search {
    margin-top: 12px;
    width: 100%;
  }

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

  .modal-overlay {
    padding: 10px;
  }
}

/* =========================
   SIDEBAR SYSTEM STATUS FIX
========================= */

.sidebar {
  overflow: hidden;
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 4px 0;
}

.system-pill {
  width: 100%;

  padding: 10px 12px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  border-radius: 10px;

  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);

  color: rgba(255,255,255,.80);

  font-size: 10px;
  font-weight: 700;

  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;

  flex: 0 0 7px;

  border-radius: 999px;

  background: #65d56f;

  box-shadow:
    0 0 0 4px rgba(101,213,111,.14),
    0 0 12px rgba(101,213,111,.35);
}

/* Never show desktop footer status in mobile bottom-nav mode */
@media (max-width: 700px) {
  .sidebar-footer {
    display: none !important;
  }
}

/* =========================
   LIVE SYSTEM STATUS
========================= */

.top-system-status {
  height: 36px;
  padding: 0 12px;

  display: flex;
  align-items: center;
  gap: 8px;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: #ffffff;

  color: #60706a;

  font-size: 9px;
  font-weight: 700;

  white-space: nowrap;
}

.top-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;

  border-radius: 50%;

  background: #a7b0ad;
}

.top-system-status.online {
  color: #267b40;
  background: #f0faf2;
  border-color: #d3edd8;
}

.top-system-status.online .top-status-dot {
  background: #54c867;

  box-shadow: 0 0 0 4px rgba(84,200,103,.12);
}

.top-system-status.offline {
  color: #b44242;
  background: #fff4f4;
  border-color: #f1d7d7;
}

.top-system-status.offline .top-status-dot {
  background: #dc5656;
}

@media (max-width: 700px) {
  .top-system-status {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  #system-status-text {
    display: none;
  }
}

/* =========================
   STAFF MANAGEMENT
========================= */

.staff-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 15px;
}

.staff-toolbar-copy h2 {
  margin: 0;
  font-size: 17px;
  color: var(--text);
}

.staff-toolbar-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.staff-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 5px 9px;

  border-radius: 999px;

  background: #eef8f0;
  color: var(--brand-dark);

  font-size: 8px;
  font-weight: 800;
}

.staff-avatar {
  width: 32px;
  height: 32px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-left: 8px;

  border-radius: 9px;

  background: var(--brand-soft);
  color: var(--brand-dark);

  font-weight: 900;
}

.staff-name-cell {
  display: flex;
  align-items: center;
}

.staff-empty {
  padding: 35px !important;
  text-align: center;
  color: var(--muted);
}

.password-wrapper {
  position: relative;
}

.password-wrapper input {
  padding-left: 40px;
}

.password-toggle {
  position: absolute;
  left: 8px;
  bottom: 7px;

  width: 30px;
  height: 30px;

  display: grid;
  place-items: center;

  border: 0;
  background: transparent;

  color: #87918d;
}

.staff-password-note {
  margin-top: 6px;
  font-size: 8px;
  color: var(--muted);
}

@media (max-width: 700px) {
  .staff-toolbar {
    display: block;
  }

  .staff-toolbar .primary-action {
    margin-top: 12px;
    width: 100%;
    justify-content: center;
  }
}




/* CRM ROW ACTIONS */

.crm-row-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.danger-button {
  color: #c94a4a;
}

.danger-button:hover {
  background: #fff0f0;
  border-color: #f0caca;
  color: #a92f2f;
}


/* =========================================================
   CRM SERVER FILTERS + PAGINATION
========================================================= */

.crm-server-filters {
  display: grid;
  grid-template-columns:
    minmax(130px, 1fr)
    minmax(130px, 1fr)
    minmax(160px, 1fr)
    minmax(130px, 1fr)
    auto;

  align-items: end;

  gap: 10px;

  margin-bottom: 14px;

  padding: 13px;

  background: #ffffff;

  border: 1px solid var(--border);
  border-radius: 13px;
}


.crm-filter-field label {
  display: block;

  margin-bottom: 5px;

  color: var(--muted);

  font-size: 8px;
  font-weight: 700;
}


.crm-filter-field select,
.crm-filter-field input {
  width: 100%;

  height: 36px;

  margin: 0;

  padding: 0 10px;

  border: 1px solid var(--border);
  border-radius: 9px;

  background: #fafcfb;

  font-family: inherit;
  font-size: 10px;
}


.crm-filter-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}


.crm-filter-actions button {
  height: 36px;
  white-space: nowrap;
}


#crm-archive-toggle.active {
  background: #fff4e5;
  color: #94631d;
  border-color: #f0d5ad;
}


.crm-archive-count {
  min-width: 19px;
  height: 19px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0 5px;

  border-radius: 999px;

  background: rgba(0, 0, 0, .06);

  font-size: 8px;
}


.crm-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;

  gap: 15px;

  margin-top: 12px;

  padding: 11px 14px;

  background: #fff;

  border: 1px solid var(--border);
  border-radius: 12px;

  color: var(--muted);

  font-size: 9px;
}


.crm-pagination-info {
  text-align: right;
}


.crm-pagination-buttons {
  display: flex;
  align-items: center;
  justify-content: center;

  gap: 9px;
}


.crm-page-button {
  min-width: 78px;
  justify-content: center;
}


.crm-page-button:disabled {
  opacity: .4;
  cursor: not-allowed;
}


.crm-page-label {
  min-width: 60px;

  text-align: center;

  color: var(--text);

  font-weight: 800;
}


.crm-page-size {
  display: flex;
  align-items: center;
  justify-content: flex-end;

  gap: 7px;
}


.crm-page-size select {
  width: 65px;

  margin: 0;

  padding: 6px 8px;

  font-size: 9px;
}


@media (max-width: 1150px) {

  .crm-server-filters {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }

  .crm-filter-actions {
    grid-column: 1 / -1;
  }
}


@media (max-width: 700px) {

  .crm-server-filters {
    grid-template-columns: 1fr;
  }

  .crm-filter-actions {
    grid-column: auto;

    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .crm-pagination {
    grid-template-columns: 1fr;

    text-align: center;
  }

  .crm-pagination-info,
  .crm-page-size {
    justify-content: center;
    text-align: center;
  }
}



/* STAFF EDITING */

.staff-inactive-row {
  opacity: .55;
  background: #fafafa;
}

.staff-inactive-label {
  margin-top: 3px;

  color: #a04b4b;

  font-size: 8px;
  font-weight: 700;
}



/* =========================================================
   LOGIN AKABER LOGO - ORIGINAL COLORS
========================================================= */

#login-view img[src*="akaber-logo"] {
  display: block !important;

  width: min(300px, 82%) !important;
  height: auto !important;

  margin: 0 auto !important;
  padding: 14px 18px !important;

  object-fit: contain !important;

  filter: none !important;
  opacity: 1 !important;

  background: #ffffff !important;

  border-radius: 16px !important;

  box-shadow:
    0 10px 30px rgba(0, 0, 0, .08) !important;
}



/* =========================================================
   CALENDAR
========================================================= */

.calendar-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;

  margin-bottom: 14px;

  padding: 10px 12px;

  background: #fff;

  border: 1px solid var(--border);
  border-radius: 12px;
}

.calendar-toolbar strong {
  min-width: 150px;

  text-align: center;

  font-size: 12px;
  color: var(--text);
}


.calendar-layout {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr)
    280px;

  gap: 14px;
}


.calendar-main-card,
.calendar-side-card {
  background: #fff;

  border: 1px solid var(--border);
  border-radius: 14px;
}


.calendar-main-card {
  overflow: hidden;
}


.calendar-grid {
  display: grid;
  grid-template-columns:
    repeat(7, minmax(0, 1fr));
}


.calendar-weekday {
  padding: 11px 8px;

  background: #f8faf9;

  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);

  text-align: center;

  color: var(--muted);

  font-size: 9px;
  font-weight: 800;
}


.calendar-day {
  min-height: 115px;

  padding: 8px;

  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);

  background: #fff;
}


.calendar-day-empty {
  background: #fafbfa;
}


.calendar-day-today {
  background: #f4fbf5;
}


.calendar-day-number {
  width: 25px;
  height: 25px;

  display: grid;
  place-items: center;

  margin-bottom: 7px;

  border-radius: 8px;

  color: var(--text);

  font-size: 10px;
  font-weight: 800;
}


.calendar-day-today
.calendar-day-number {
  background: var(--brand);
  color: #fff;
}


.calendar-day-events {
  display: grid;
  gap: 4px;
}


.calendar-event-chip {
  width: 100%;

  padding: 5px 6px;

  border: 0;
  border-radius: 7px;

  background: var(--brand-soft);
  color: var(--brand-dark);

  text-align: right;

  font-family: inherit;
  font-size: 8px;
  font-weight: 700;

  overflow: hidden;
}


.calendar-event-chip span {
  display: block;

  margin-bottom: 2px;

  color: #718078;

  font-size: 7px;
}


.calendar-side-card {
  padding: 14px;
}


.calendar-side-title {
  padding-bottom: 11px;
  margin-bottom: 7px;

  border-bottom: 1px solid var(--border);
}


.calendar-side-title h3 {
  margin: 4px 0 0;

  font-size: 14px;
}


.calendar-upcoming-item {
  width: 100%;

  display: grid;
  grid-template-columns: 65px 1fr;

  gap: 10px;

  padding: 10px 0;

  border: 0;
  border-bottom: 1px solid #edf1ef;

  background: transparent;

  text-align: right;

  font-family: inherit;
}


.calendar-upcoming-time {
  padding: 7px;

  border-radius: 9px;

  background: #f4f8f5;

  color: var(--muted);

  text-align: center;

  font-size: 8px;
}


.calendar-upcoming-time strong {
  display: block;

  margin-top: 2px;

  color: var(--brand-dark);

  font-size: 9px;
}


.calendar-upcoming-item > div:last-child strong {
  display: block;

  margin-bottom: 4px;

  color: var(--text);

  font-size: 10px;
}


.calendar-upcoming-item > div:last-child span {
  color: var(--muted);

  font-size: 8px;
}


.calendar-empty {
  padding: 25px 5px;

  text-align: center;

  color: var(--muted);

  font-size: 9px;
}


@media (max-width: 1000px) {

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .calendar-day {
    min-height: 95px;
  }
}


@media (max-width: 700px) {

  .calendar-main-card {
    overflow-x: auto;
  }

  .calendar-grid {
    min-width: 760px;
  }

  .calendar-layout {
    display: block;
  }

  .calendar-side-card {
    margin-top: 12px;
  }
}



/* =========================================================
   CALENDAR SEARCHABLE CUSTOMER PICKER
========================================================= */

.calendar-customer-search {
  position: relative;
}


.calendar-customer-search input {
  width: 100%;
}


.calendar-lead-results {
  position: absolute;

  top: calc(100% + 6px);
  right: 0;
  left: 0;

  z-index: 150;

  max-height: 310px;
  overflow-y: auto;

  background: #ffffff;

  border: 1px solid var(--border);
  border-radius: 11px;

  box-shadow:
    0 18px 50px rgba(24, 48, 36, .16);
}


.calendar-lead-result {
  width: 100%;

  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 12px;

  padding: 10px 12px;

  border: 0;
  border-bottom: 1px solid #edf1ef;

  background: #ffffff;

  text-align: right;

  font-family: inherit;

  cursor: pointer;
}


.calendar-lead-result:last-child {
  border-bottom: 0;
}


.calendar-lead-result:hover {
  background: #f3faf4;
}


.calendar-lead-result strong {
  display: block;

  margin-bottom: 3px;

  color: var(--text);

  font-size: 10px;
}


.calendar-lead-result span {
  color: var(--muted);

  font-size: 9px;
}


.calendar-lead-result-meta {
  text-align: left;
}


.calendar-lead-result-meta small {
  display: block;

  margin-top: 3px;

  color: var(--brand-dark);

  font-size: 8px;
}


.calendar-lead-result-loading,
.calendar-lead-result-empty {
  padding: 18px;

  text-align: center;

  color: var(--muted);

  font-size: 9px;
}



/* =========================================================
   CALENDAR EVENT TYPE COLORS
========================================================= */

/* Sales consultation */
.calendar-type-sales_consultation {
  --event-color: #2f944d;
  --event-bg: #eaf8ee;
  --event-border: #bde8c8;
}


/* Sales follow-up */
.calendar-type-sales_follow_up {
  --event-color: #356fb4;
  --event-bg: #edf5ff;
  --event-border: #c9ddf5;
}


/* Maintenance */
.calendar-type-maintenance {
  --event-color: #b56c16;
  --event-bg: #fff5e7;
  --event-border: #efd5ad;
}


/* Installation */
.calendar-type-installation {
  --event-color: #7850ae;
  --event-bg: #f4edff;
  --event-border: #dccbf2;
}


/* Site visit */
.calendar-type-site_visit {
  --event-color: #277e92;
  --event-bg: #eaf8fb;
  --event-border: #bfe3ea;
}


/* Handover */
.calendar-type-handover {
  --event-color: #207d70;
  --event-bg: #e9f8f5;
  --event-border: #bde5dd;
}


/* Other */
.calendar-type-other {
  --event-color: #66736d;
  --event-bg: #f2f5f3;
  --event-border: #d8dfdc;
}


/* Month event chips */

.calendar-event-chip.calendar-type-sales_consultation,
.calendar-event-chip.calendar-type-sales_follow_up,
.calendar-event-chip.calendar-type-maintenance,
.calendar-event-chip.calendar-type-installation,
.calendar-event-chip.calendar-type-site_visit,
.calendar-event-chip.calendar-type-handover,
.calendar-event-chip.calendar-type-other {
  background:
    var(--event-bg);

  color:
    var(--event-color);

  border-right:
    3px solid
    var(--event-color);
}


/* Upcoming appointment list */

.calendar-upcoming-item.calendar-type-sales_consultation,
.calendar-upcoming-item.calendar-type-sales_follow_up,
.calendar-upcoming-item.calendar-type-maintenance,
.calendar-upcoming-item.calendar-type-installation,
.calendar-upcoming-item.calendar-type-site_visit,
.calendar-upcoming-item.calendar-type-handover,
.calendar-upcoming-item.calendar-type-other {
  border-right:
    3px solid
    var(--event-color);

  padding-right: 9px;
}


.calendar-upcoming-item.calendar-type-sales_consultation
.calendar-upcoming-time,
.calendar-upcoming-item.calendar-type-sales_follow_up
.calendar-upcoming-time,
.calendar-upcoming-item.calendar-type-maintenance
.calendar-upcoming-time,
.calendar-upcoming-item.calendar-type-installation
.calendar-upcoming-time,
.calendar-upcoming-item.calendar-type-site_visit
.calendar-upcoming-time,
.calendar-upcoming-item.calendar-type-handover
.calendar-upcoming-time,
.calendar-upcoming-item.calendar-type-other
.calendar-upcoming-time {
  background:
    var(--event-bg);

  color:
    var(--event-color);
}



/* =========================================================
   CALENDAR EDIT MODE
========================================================= */

#calendar-delete-button {
  margin-left: auto;
}


#calendar-delete-button.danger-button {
  color: #b43d3d;

  background: #fff5f5;

  border-color: #efcccc;
}


#calendar-delete-button.danger-button:hover {
  color: #922d2d;

  background: #ffeaea;

  border-color: #e8b7b7;
}



/* =========================================================
   CALENDAR SMART DATE / TIME
========================================================= */

#calendar-date,
#calendar-start-time {
  min-height: 44px;

  font-size: 12px;

  direction: ltr;

  text-align: center;

  background: #ffffff;

  cursor: pointer;
}


.calendar-end-display {
  min-height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;

  gap: 2px;

  margin-top: 7px;
  padding: 8px 12px;

  border: 1px solid #dce5df;
  border-radius: 9px;

  background: #f5f9f6;

  color: var(--brand-dark);

  text-align: center;
}


.calendar-end-display strong {
  font-size: 12px;
}


.calendar-end-display span {
  color: var(--muted);

  font-size: 8px;
}


.calendar-time-disabled {
  opacity: .6;
}


.calendar-time-disabled
#calendar-start-time {
  background: #f2f4f3;

  cursor: not-allowed;
}


/*
  Make native date/time controls easier to use.
*/

#calendar-date::-webkit-calendar-picker-indicator,
#calendar-start-time::-webkit-calendar-picker-indicator {
  cursor: pointer;

  opacity: .65;

  padding: 5px;
}


@media (max-width: 700px) {

  #calendar-date,
  #calendar-start-time {
    font-size: 16px;
  }

}




/* CALENDAR MULTI VIEW STYLES V1 */
/* =========================================================
   VIEW SWITCHER
========================================================= */

.calendar-view-switcher {
  margin-right: auto;

  display: inline-flex;
  align-items: center;

  padding: 3px;

  border: 1px solid var(--border);
  border-radius: 10px;

  background: #f6f8f7;
}


.calendar-view-button {
  min-width: 56px;
  height: 30px;

  padding: 0 10px;

  border: 0;
  border-radius: 7px;

  background: transparent;

  color: #6c7873;

  font-family: inherit;
  font-size: 9px;
  font-weight: 700;

  cursor: pointer;
}


.calendar-view-button.active {
  background: #ffffff;

  color: var(--brand-dark);

  box-shadow:
    0 1px 4px
    rgba(30, 60, 45, .10);
}


/* =========================================================
   TIME CALENDAR CONTAINER
========================================================= */

.calendar-time-view {
  min-width: 100%;

  overflow-x: auto;

  background: #ffffff;
}


/* =========================================================
   HEADER
========================================================= */

.calendar-time-header-row {
  display: grid;

  position: sticky;
  top: 0;

  z-index: 20;

  min-width: max-content;

  background: #ffffff;

  border-bottom:
    1px solid var(--border);
}


.calendar-time-corner {
  min-width: 64px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 11px 5px;

  border-left:
    1px solid var(--border);

  background: #f7f9f8;

  color: var(--muted);

  font-size: 8px;
  font-weight: 700;
}


.calendar-time-header {
  min-width: 120px;

  padding: 11px 8px;

  border-left:
    1px solid var(--border);

  text-align: center;

  background: #ffffff;

  color: var(--text);

  font-size: 9px;
  font-weight: 800;
}


.calendar-time-header-today {
  color: var(--brand-dark);

  background: #f1faf3;
}


/* =========================================================
   ALL DAY
========================================================= */

.calendar-all-day-row {
  display: grid;

  min-width: max-content;

  border-bottom:
    1px solid var(--border);

  background: #fbfcfb;
}


.calendar-all-day-label {
  min-width: 64px;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 8px 4px;

  border-left:
    1px solid var(--border);

  color: var(--muted);

  font-size: 7px;
  font-weight: 700;

  text-align: center;
}


.calendar-all-day-cell {
  min-height: 45px;
  min-width: 120px;

  padding: 5px;

  border-left:
    1px solid var(--border);
}


.calendar-all-day-event {
  width: 100%;

  display: block;

  margin-bottom: 4px;
  padding: 6px 7px;

  border:
    1px solid
    var(--event-border);

  border-right:
    3px solid
    var(--event-color);

  border-radius: 7px;

  background:
    var(--event-bg);

  color:
    var(--event-color);

  font-family: inherit;
  font-size: 8px;
  font-weight: 800;

  text-align: right;

  cursor: pointer;
}


/* =========================================================
   HOURLY BODY
========================================================= */

.calendar-time-body {
  display: grid;

  position: relative;

  min-width: max-content;

  background: #ffffff;
}


.calendar-hour-axis {
  position: relative;

  width: 64px;

  border-left:
    1px solid var(--border);

  background: #fbfcfb;
}


.calendar-hour-label {
  position: absolute;

  right: 0;
  left: 0;

  transform:
    translateY(-50%);

  padding-left: 6px;

  color: #8a9590;

  font-size: 8px;

  text-align: center;
}


.calendar-time-column {
  position: relative;

  min-width: 120px;

  border-left:
    1px solid var(--border);

  background: #ffffff;
}


.calendar-hour-line {
  position: absolute;

  right: 0;
  left: 0;

  height: 1px;

  background: #edf0ee;

  pointer-events: none;
}


/* =========================================================
   TIMED APPOINTMENTS
========================================================= */

.calendar-timed-event {
  position: absolute;

  z-index: 5;

  right: 4px;
  left: 4px;

  overflow: hidden;

  padding: 5px 7px;

  border:
    1px solid
    var(--event-border);

  border-right:
    3px solid
    var(--event-color);

  border-radius: 8px;

  background:
    var(--event-bg);

  color:
    var(--event-color);

  font-family: inherit;

  text-align: right;

  cursor: pointer;
}


.calendar-timed-event:hover {
  filter: brightness(.98);

  box-shadow:
    0 3px 10px
    rgba(32, 55, 43, .08);
}


.calendar-timed-event strong {
  display: block;

  overflow: hidden;

  color: var(--event-color);

  font-size: 9px;
  font-weight: 900;

  white-space: nowrap;
  text-overflow: ellipsis;
}


.calendar-timed-event span {
  display: block;

  margin-top: 2px;

  color: #64736c;

  font-size: 7px;
}


.calendar-timed-event small {
  display: block;

  margin-top: 2px;

  color: var(--event-color);

  font-size: 7px;
}


/* =========================================================
   CURRENT TIME
========================================================= */

.calendar-current-time-line {
  position: absolute;

  z-index: 12;

  right: 0;
  left: 0;

  height: 2px;

  background: #e24f4f;

  pointer-events: none;
}


.calendar-current-time-line span {
  position: absolute;

  right: -4px;
  top: -3px;

  width: 8px;
  height: 8px;

  border-radius: 50%;

  background: #e24f4f;
}


/* =========================================================
   EMPTY / ERRORS
========================================================= */

.calendar-no-salespeople,
.calendar-load-error {
  padding: 45px 20px;

  color: var(--muted);

  text-align: center;

  font-size: 10px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1050px) {

  .calendar-toolbar {
    flex-wrap: wrap;
  }


  .calendar-view-switcher {
    width: 100%;

    margin: 6px 0 0;

    overflow-x: auto;
  }


  .calendar-view-button {
    flex: 1 0 auto;
  }
}


@media (max-width: 700px) {

  .calendar-time-view {
    overflow-x: auto;
  }


  .calendar-time-header,
  .calendar-time-column,
  .calendar-all-day-cell {
    min-width: 145px;
  }


  .calendar-hour-axis,
  .calendar-time-corner,
  .calendar-all-day-label {
    width: 58px;
    min-width: 58px;
  }
}

