/* ==========================================================
   FBR DIGITAL INVOICING SAAS - MASTER ADMIN DESIGN SYSTEM
   Theme: Executive Soft Mint & Teal (#f3f6f5 / #176d6e)
   Typography: Manrope (Headings & Metrics) & DM Sans (Body / UI)
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Manrope:wght@500;600;700;800&display=swap');

:root {
  --admin-bg: #f3f6f5;
  --admin-card-bg: #ffffff;
  --admin-sidebar-bg: #ffffff;
  --admin-border: #dce4e1;
  --admin-border-subtle: #e6ebe9;
  --admin-teal: #247f80;
  --admin-teal-hover: #196e70;
  --admin-teal-light: #e9f4f2;
  --admin-teal-active: #176d6e;
  --admin-text-main: #1a2926;
  --admin-text-heading: #173d3a;
  --admin-text-muted: #677671;
  --admin-text-subtle: #9aa5a1;
  --admin-success: #2c9a72;
  --admin-warning: #95651b;
  --admin-danger: #a84d4d;
}

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

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--admin-text-main);
  background: var(--admin-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================
   ADMIN SHELL (SIDEBAR + MAIN CONTENT)
   ========================================================== */
.admin-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 232px minmax(0, 1fr);
  color: var(--admin-text-main);
  background: var(--admin-bg);
}

/* --- Sidebar --- */
.admin-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 28px 20px 24px;
  border-right: 1px solid var(--admin-border);
  background: var(--admin-sidebar-bg);
  z-index: 20;
}

.admin-brand {
  display: block;
  width: 150px;
  margin: 0 8px 36px;
  text-decoration: none;
}

.admin-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.admin-sidebar nav {
  display: grid;
  gap: 6px;
}

.admin-sidebar nav a {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-radius: 8px;
  color: #65736f;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all 160ms ease;
}

.admin-sidebar nav a:hover {
  color: #173e3d;
  background: #f2f6f5;
}

.admin-sidebar nav a.active {
  color: var(--admin-teal-active);
  background: var(--admin-teal-light);
}

.admin-sidebar nav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

/* Admin Profile Bottom Chip */
.admin-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid #e3e9e7;
}

.admin-user > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: var(--admin-teal);
  font-size: 11px;
  font-weight: 700;
}

.admin-user div {
  display: grid;
  gap: 2px;
}

.admin-user strong {
  font-size: 11.5px;
  color: var(--admin-text-main);
}

.admin-user small {
  color: #899591;
  font-size: 9.5px;
}

/* --- Main Area --- */
.admin-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Header */
.admin-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  min-height: 90px;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(28px, 4vw, 56px);
  border-bottom: 1px solid var(--admin-border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
}

.admin-header p {
  margin: 0 0 4px;
  color: #298486;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.admin-header h1 {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.035em;
  color: var(--admin-text-heading);
}

.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.secondary-action,
.signout-action {
  display: inline-flex;
  height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid #ced9d5;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 160ms ease;
}

.secondary-action {
  border-color: var(--admin-teal);
  color: #ffffff;
  background: var(--admin-teal);
}

.secondary-action:hover {
  background: var(--admin-teal-hover);
}

.signout-action {
  color: #3c4c47;
  background: #ffffff;
}

.signout-action:hover {
  border-color: #b7c6c1;
  background: #f8faf9;
}

/* Content Container */
.admin-content {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: 24px clamp(28px, 4vw, 56px) 60px;
  flex: 1;
}

/* Operational Status Notification */
.admin-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-height: 22px;
  margin-bottom: 14px;
  color: #65746f;
  font-size: 11px;
}

.admin-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--admin-success);
  box-shadow: 0 0 0 3px rgba(44, 154, 114, 0.16);
  display: inline-block;
}

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stats-grid article {
  display: grid;
  min-height: 125px;
  align-content: space-between;
  padding: 20px;
  border: 1px solid var(--admin-border);
  border-radius: 10px;
  background: var(--admin-card-bg);
  box-shadow: 0 2px 8px rgba(23, 55, 47, 0.025);
}

.stats-grid span {
  color: var(--admin-text-muted);
  font-size: 11.5px;
  font-weight: 600;
}

.stats-grid strong {
  color: var(--admin-text-heading);
  font-family: 'Manrope', sans-serif;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.stats-grid small {
  color: var(--admin-text-subtle);
  font-size: 9.5px;
}

/* Tenant Businesses Panel */
.tenant-panel {
  overflow: visible;
  border: 1px solid #d7e0dd;
  border-radius: 11px;
  background: var(--admin-card-bg);
  box-shadow: 0 4px 14px rgba(23, 55, 47, 0.03);
}

.tenant-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px;
  border-bottom: 1px solid #e0e7e4;
}

.tenant-panel-header h2 {
  margin: 0 0 4px;
  font-family: 'Manrope', sans-serif;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--admin-text-heading);
}

.tenant-panel-header p {
  margin: 0;
  color: #7b8984;
  font-size: 11px;
}

.tenant-tools {
  display: flex;
  gap: 10px;
}

.search-control {
  position: relative;
  display: block;
}

.search-control svg {
  position: absolute;
  top: 50%;
  left: 12px;
  z-index: 1;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #83918c;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  transform: translateY(-50%);
}

.search-control input {
  width: 260px;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid #d7dfdc;
  border-radius: 8px;
  background: #f9fbfa;
  font-size: 11px;
  color: var(--admin-text-main);
  outline: none;
  transition: border-color 150ms ease;
}

.search-control input:focus {
  border-color: var(--admin-teal);
  background: #ffffff;
}

.tenant-tools select {
  width: 140px;
  height: 38px;
  border: 1px solid #d7dfdc;
  border-radius: 8px;
  outline: none;
  color: #394b45;
  background: #f9fbfa;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.tenant-tools select:focus {
  border-color: var(--admin-teal);
}

/* Tenant Table */
.tenant-table-wrap {
  overflow-x: auto;
  border-radius: 0 0 11px 11px;
}

.tenant-table {
  width: 100%;
  border-collapse: collapse;
}

.tenant-table th {
  padding: 14px 18px;
  color: #76847f;
  background: #fafcfb;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.tenant-table td {
  padding: 16px 18px;
  border-top: 1px solid var(--admin-border-subtle);
  color: #394b45;
  font-size: 12px;
  white-space: nowrap;
  vertical-align: middle;
}

.tenant-table tbody tr:hover {
  background: #fbfdfc;
}

.business-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.business-cell > span {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 7px;
  color: var(--admin-teal);
  background: var(--admin-teal-light);
  font-size: 10px;
  font-weight: 700;
}

.business-cell div {
  display: grid;
  gap: 2px;
}

.business-cell strong,
.expiry-date {
  color: #243631;
  font-size: 11px;
  font-weight: 600;
}

.business-cell small {
  color: #8c9894;
  font-size: 9.5px;
}

/* Status Pills */
.status-pill {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
}

.status-active {
  color: #237354;
  background: #e7f5ee;
}

.status-renewal-due {
  color: var(--admin-warning);
  background: #fff4df;
}

.status-suspended {
  color: var(--admin-danger);
  background: #fceaea;
}

/* Quick Renew Buttons */
.renew-actions {
  display: flex;
  gap: 5px;
}

.renew-actions button {
  height: 26px;
  padding: 0 8px;
  border: 1px solid #b9dcd5;
  border-radius: 5px;
  color: #257b70;
  background: #f3faf8;
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
}

.renew-actions button:hover {
  border-color: #71b7aa;
  background: #e7f5f1;
}

/* Direct Row Action Button */
.btn-manage-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--admin-teal);
  border-radius: 6px;
  background: var(--admin-teal-light);
  color: var(--admin-teal);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
  white-space: nowrap;
}

.btn-manage-row:hover {
  background: var(--admin-teal);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(36, 127, 128, 0.25);
}

.tenant-table tbody tr {
  cursor: pointer;
  transition: background 140ms ease;
}

.tenant-table tbody tr:hover {
  background: #f0f7f5;
}

.empty-state {
  height: 110px;
  color: #87948f !important;
  text-align: center;
  font-size: 12px;
}

/* Modal Dialog */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: 12px;
  padding: 26px;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.modal-content h3 {
  font-family: 'Manrope', sans-serif;
  font-size: 17px;
  margin-bottom: 6px;
  color: var(--admin-text-heading);
}

.modal-content p {
  color: #788782;
  font-size: 11px;
  margin-bottom: 18px;
}

.modal-content input {
  width: 100%;
  height: 44px;
  border: 1px solid #d7dfdc;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 12px;
  outline: none;
  margin-bottom: 18px;
}

.modal-content input:focus {
  border-color: var(--admin-teal);
}

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

.plan-modal-content {
  max-width: 520px;
}

.modal-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}

.modal-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--admin-text-heading);
}

.modal-form-grid label input {
  margin-bottom: 0;
}

.field-hint {
  font-size: 10px;
  color: #788782;
  font-weight: 400;
  margin-top: 2px;
}

.usage-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: #2b3935;
}

.usage-badge small {
  color: #7b8a85;
  font-weight: 400;
}

.sub-window-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11.5px;
}

.sub-window-cell small {
  color: #788782;
  font-size: 10.5px;
}

/* ==========================================================
   SLIDE-OVER TENANT MANAGEMENT DRAWER
   ========================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 34, 30, 0.42);
  backdrop-filter: blur(3px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.tenant-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  max-width: 94vw;
  background: #ffffff;
  box-shadow: -12px 0 40px rgba(15, 34, 30, 0.16);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tenant-drawer.active {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid #e1e8e5;
  background: #fafcfb;
}

.drawer-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.drawer-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--admin-teal-light);
  color: var(--admin-teal);
  font-weight: 800;
  font-size: 14px;
}

.drawer-titles {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.drawer-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.drawer-title-row h3 {
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--admin-text-heading);
}

.drawer-titles p {
  font-size: 11px;
  color: var(--admin-text-muted);
}

.role-pill {
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  background: #f0f3f2;
  color: #4b5a55;
}

.drawer-close-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid #d8e0dd;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  color: #6a7974;
  transition: all 140ms ease;
}

.drawer-close-btn:hover {
  background: #f1f5f3;
  color: #1a2a26;
}

.drawer-close-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: #f7faf8;
}

.drawer-card {
  background: #ffffff;
  border: 1px solid #dfe6e3;
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(15, 34, 30, 0.03);
}

.drawer-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f0;
}

.drawer-card-header h4 {
  font-family: 'Manrope', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--admin-text-heading);
}

.drawer-card-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--admin-teal);
  background: var(--admin-teal-light);
  padding: 3px 8px;
  border-radius: 6px;
}

.drawer-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.drawer-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.drawer-field span {
  font-size: 11px;
  font-weight: 600;
  color: #495a55;
}

.drawer-field input {
  height: 38px;
  padding: 0 10px;
  border: 1px solid #d5dedb;
  border-radius: 7px;
  font-size: 11.5px;
  outline: none;
  color: #20312d;
  background: #ffffff;
  transition: border-color 140ms ease;
}

.drawer-field input:focus {
  border-color: var(--admin-teal);
}

.drawer-quota-card {
  background: #fbfdfc;
  border: 1px solid #e3ebe8;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
}

.quota-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #4a5c57;
  margin-bottom: 8px;
}

.quota-meta strong {
  color: #173d3a;
  font-family: 'Manrope', sans-serif;
  font-size: 12px;
}

.quota-progress-track {
  width: 100%;
  height: 6px;
  background: #e5ece9;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.quota-progress-fill {
  height: 100%;
  background: var(--admin-teal);
  border-radius: 3px;
  transition: width 300ms ease;
}

.inline-limit-input {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.inline-limit-input span {
  font-size: 10.5px;
}

.inline-limit-input input {
  width: 100px;
  height: 32px;
  text-align: right;
  font-weight: 600;
}

.drawer-quick-renew {
  margin: 16px 0;
  padding: 12px;
  background: #f3f7f5;
  border-radius: 8px;
}

.drawer-quick-renew span {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: #556661;
  margin-bottom: 8px;
}

.renew-btn-group {
  display: flex;
  gap: 8px;
}

.renew-btn-group button {
  flex: 1;
  height: 32px;
  border: 1px solid #cbd8d3;
  border-radius: 6px;
  background: #ffffff;
  color: #274b45;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
}

.renew-btn-group button:hover {
  background: var(--admin-teal-light);
  border-color: var(--admin-teal);
  color: var(--admin-teal);
}

.drawer-primary-btn {
  width: 100%;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--admin-teal);
  color: #ffffff;
  font-family: 'Manrope', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 150ms ease;
}

.drawer-primary-btn:hover {
  background: var(--admin-teal-hover);
}

.drawer-input-with-action {
  display: flex;
  gap: 8px;
}

.drawer-input-with-action input {
  flex: 1;
}

.drawer-secondary-btn {
  padding: 0 16px;
  height: 38px;
  border: 1px solid #d5dedb;
  border-radius: 7px;
  background: #ffffff;
  color: #29403b;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 140ms ease;
}

.drawer-secondary-btn:hover {
  background: #f1f6f4;
  border-color: #bdccc7;
}

.drawer-access-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.access-action-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}

.access-action-item:not(:last-child) {
  border-bottom: 1px solid #edf2f0;
}

.access-action-item strong {
  display: block;
  font-size: 12px;
  color: #273934;
  margin-bottom: 2px;
}

.access-action-item p {
  font-size: 10.5px;
  color: #7b8a85;
}

.drawer-outline-btn {
  padding: 7px 12px;
  border: 1px solid #ccd7d3;
  border-radius: 6px;
  background: #ffffff;
  font-size: 11px;
  font-weight: 600;
  color: #3b504b;
  cursor: pointer;
  white-space: nowrap;
  transition: all 140ms ease;
}

.drawer-outline-btn:hover {
  border-color: var(--admin-teal);
  color: var(--admin-teal);
  background: var(--admin-teal-light);
}

.drawer-danger-btn {
  padding: 7px 12px;
  border: 1px solid #f0cfcf;
  border-radius: 6px;
  background: #fdf5f5;
  font-size: 11px;
  font-weight: 600;
  color: #b91c1c;
  cursor: pointer;
  white-space: nowrap;
  transition: all 140ms ease;
}

.drawer-danger-btn:hover {
  background: #b91c1c;
  color: #ffffff;
  border-color: #b91c1c;
}

.drawer-danger-btn.btn-restore {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.drawer-danger-btn.btn-restore:hover {
  background: #15803d;
  color: #ffffff;
  border-color: #15803d;
}

.drawer-details-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.drawer-details-list dt {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #7d8c87;
  margin-bottom: 3px;
}

.drawer-details-list dd {
  font-size: 12px;
  font-weight: 600;
  color: #243530;
  font-family: 'DM Sans', sans-serif;
}

/* ==========================================================
   SUBSCRIPTIONS & PRICING PLANS STYLING
   ========================================================== */
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-toolbar h2 {
  font-family: 'Manrope', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: var(--admin-text-heading);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.section-toolbar p {
  color: #72827d;
  font-size: 12px;
}

/* Admin Interactive Pricing Calculator Card */
.admin-calc-card {
  background: linear-gradient(135deg, #ffffff 0%, #f4faf8 100%);
  border: 1px solid #cce0db;
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 28px;
  box-shadow: 0 4px 16px rgba(18, 108, 81, 0.04);
}

.admin-calc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e1eee9;
}

.admin-calc-header h3 {
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--admin-text-heading);
  margin-bottom: 3px;
}

.admin-calc-header p {
  font-size: 11.5px;
  color: #657771;
}

.calc-result-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.calc-result-pill span {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  color: #6c7e78;
}

.calc-result-pill strong {
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--admin-teal);
}

.admin-calc-controls {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
}

.admin-calc-controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-calc-controls label span {
  font-size: 11px;
  font-weight: 600;
  color: #384d46;
}

.admin-calc-controls select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid #cbdad5;
  border-radius: 8px;
  background: #ffffff;
  font-size: 12px;
  font-weight: 600;
  color: #1a2f2a;
  min-width: 260px;
  outline: none;
}

.calc-counter {
  display: flex;
  align-items: center;
}

.calc-counter button {
  width: 38px;
  height: 40px;
  border: 1px solid #cbdad5;
  background: #f7faf8;
  color: #274b45;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 120ms ease;
}

.calc-counter button:first-child {
  border-radius: 8px 0 0 8px;
}

.calc-counter button:last-child {
  border-radius: 0 8px 8px 0;
}

.calc-counter button:hover {
  background: var(--admin-teal-light);
  color: var(--admin-teal);
}

.calc-counter input {
  width: 60px;
  height: 40px;
  border-top: 1px solid #cbdad5;
  border-bottom: 1px solid #cbdad5;
  border-left: 0;
  border-right: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #173d3a;
  outline: none;
}

.calc-formula-note {
  font-size: 11.5px;
  font-weight: 600;
  color: #4b665f;
  background: #e9f4f1;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px dashed #b7d6ce;
  margin-left: auto;
}

/* Plans Grid */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.plan-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #dce4e1;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.plan-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(18, 108, 81, 0.08);
  border-color: #bad3cc;
}

.plan-card.featured-plan {
  border-color: var(--admin-teal);
  box-shadow: 0 8px 24px rgba(36, 127, 128, 0.12);
}

.plan-badge-popular {
  position: absolute;
  top: -10px;
  left: 20px;
  background: var(--admin-teal);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 10px;
  border-radius: 10px;
  text-transform: uppercase;
}

.plan-card-header {
  margin-bottom: 12px;
}

.plan-card-header h3 {
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--admin-text-heading);
  margin-bottom: 4px;
}

.plan-card-quota-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--admin-teal);
  background: var(--admin-teal-light);
  padding: 2px 8px;
  border-radius: 6px;
}

.plan-card-price {
  margin: 16px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid #edf2f0;
}

.plan-card-price .currency {
  font-size: 13px;
  font-weight: 700;
  color: #556862;
  margin-right: 2px;
}

.plan-card-price .amount {
  font-family: 'Manrope', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--admin-text-heading);
}

.plan-card-price .per-unit {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #7b8d87;
  margin-top: 2px;
}

.plan-features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}

.plan-features-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11.5px;
  color: #4b5e58;
  line-height: 1.45;
}

.plan-features-list li svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  margin-top: 2px;
  fill: none;
  stroke: var(--admin-teal);
  stroke-width: 2.5;
}

.plan-card-actions {
  display: flex;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid #edf2f0;
}

.plan-card-actions button {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid #d4dfdb;
  border-radius: 6px;
  background: #ffffff;
  color: #3b504a;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 130ms ease;
}

.plan-card-actions button:hover {
  background: #f1f7f5;
  border-color: var(--admin-teal);
  color: var(--admin-teal);
}

.plan-card-actions button.btn-del-plan:hover {
  border-color: #fca5a5;
  color: #b91c1c;
  background: #fdf5f5;
}

.modal-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.modal-field span {
  font-size: 11px;
  font-weight: 600;
  color: var(--admin-text-heading);
}

.modal-field textarea {
  border: 1px solid #d7dfdc;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 11.5px;
  outline: none;
  resize: vertical;
}

.modal-field textarea:focus {
  border-color: var(--admin-teal);
}

.modal-checkbox-row {
  display: flex;
  gap: 20px;
  margin: 12px 0 20px;
}

.modal-checkbox-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #384a44;
  cursor: pointer;
}

/* ==========================================================
   RESPONSIVE BREAKPOINTS
   ========================================================== */
@media (max-width: 1120px) {
  .admin-shell {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .admin-sidebar {
    align-items: center;
    padding-inline: 12px;
  }

  .admin-brand {
    width: 46px;
    height: 46px;
    overflow: hidden;
    margin-inline: 0;
  }

  .admin-brand img {
    width: 104px;
    max-width: none;
  }

  .admin-sidebar nav a {
    width: 44px;
    justify-content: center;
    padding: 0;
    font-size: 0;
  }

  .admin-user {
    padding-inline: 0;
  }

  .admin-user div {
    display: none;
  }

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

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

  .admin-sidebar {
    display: none;
  }

  .admin-header {
    min-height: 80px;
    padding-inline: 20px;
  }

  .admin-content {
    padding: 20px;
  }

  .tenant-panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .tenant-tools {
    width: 100%;
  }

  .search-control {
    flex: 1;
  }

  .search-control input {
    width: 100%;
  }
}

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

  .tenant-tools {
    flex-direction: column;
  }

  .tenant-tools select {
    width: 100%;
  }

  .admin-header-actions .secondary-action {
    display: none;
  }
}
