/* ========== TICKER ========== */
.ticker-wrap {
  background: var(--dark);
  height: var(--ticker-height);
  overflow: hidden;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
}
.ticker-label {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  padding: 0 12px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}
.ticker-track-wrap {
  overflow: hidden;
  flex: 1;
}
.ticker-track {
  display: flex;
  gap: 32px;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-400);
  font-size: 12px;
  font-weight: 500;
}
.ticker-item .name { color: var(--gray-200); font-weight: 700; }
.ticker-item .value { color: #fff; }
.ticker-item .chg { font-size: 11px; }
.ticker-item .up { color: #4ade80; }
.ticker-item .down { color: #f87171; }
.ticker-item .unit { color: var(--gray-600); font-size: 10px; }
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ========== HEADER ========== */
.app-header {
  position: fixed;
  top: var(--ticker-height);
  left: 0; right: 0;
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 900;
  box-shadow: var(--shadow);
}
.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: white;
}
.logo-text {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
}
.logo-text span { color: var(--secondary); }
.logo-sub { font-size: 9px; color: var(--gray-600); font-weight: 500; letter-spacing: 0.5px; }
.header-search {
  flex: 1;
  max-width: 400px;
  position: relative;
}
.header-search input {
  width: 100%;
  padding: 8px 36px 8px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-200);
  background: var(--gray-100);
  font-size: 13px;
  transition: var(--transition);
}
.header-search input:focus { border-color: var(--primary); background: #fff; }
.header-search .search-icon {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  font-size: 14px;
  pointer-events: none;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.icon-btn {
  width: 36px; height: 36px;
  background: var(--gray-100);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  color: var(--gray-700);
  transition: var(--transition);
  position: relative;
}
.icon-btn:hover { background: var(--gray-200); }
.badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
}
.hamburger-btn {
  display: none;
  width: 36px; height: 36px;
  background: none;
  align-items: center; justify-content: center;
  font-size: 20px;
  color: var(--gray-700);
}

/* ========== SIDEBAR ========== */
.sidebar {
  position: fixed;
  top: calc(var(--ticker-height) + var(--header-height));
  left: 0;
  width: var(--sidebar-width);
  bottom: 0;
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  overflow-y: auto;
  z-index: 800;
  transition: transform var(--transition);
  scrollbar-width: thin;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 4px; }

.sidebar-section { padding: 12px 8px 4px; }
.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 0 8px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--gray-100); color: var(--primary); }
.nav-item.active { background: #e8f5ee; color: var(--primary); font-weight: 600; }
.nav-item .nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
}

/* ========== MAIN CONTENT ========== */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: calc(var(--ticker-height) + var(--header-height));
  min-height: calc(100vh - var(--ticker-height) - var(--header-height));
  padding: 20px;
}

/* ========== PAGES ========== */
.page { display: none; }
.page.active { display: block; }

/* ========== CARDS ========== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-900);
}
.card-body { padding: 20px; }

/* ========== GRID ========== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

/* ========== STAT CARDS ========== */
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.green { background: #dcf5e7; color: var(--primary); }
.stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stat-icon.orange { background: #fff3e0; color: var(--secondary); }
.stat-icon.purple { background: #f3e8ff; color: #7c3aed; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.stat-label { font-size: 12px; color: var(--gray-600); margin-top: 4px; }
.stat-change { font-size: 12px; font-weight: 600; margin-top: 4px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ========== PRODUCT CARDS ========== */
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
}
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.product-card-icon {
  height: 100px;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px;
  position: relative;
}
.product-card-body { padding: 14px; }
.product-card-name {
  font-weight: 700;
  font-size: 13px;
  color: var(--gray-900);
  margin-bottom: 4px;
}
.product-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 8px;
}
.product-card-volume {
  font-weight: 700;
  color: var(--primary);
  font-size: 14px;
  margin-top: 4px;
}
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.tag-green { background: #dcf5e7; color: var(--primary); }
.tag-blue { background: #dbeafe; color: #2563eb; }
.tag-orange { background: #fff3e0; color: var(--secondary-dark); }
.tag-gray { background: var(--gray-200); color: var(--gray-700); }

/* ========== FORMS ========== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--white);
  color: var(--gray-900);
  transition: border-color var(--transition);
}
.form-control:focus { border-color: var(--primary); }
.form-control.error { border-color: var(--danger); }
select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23636366' d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; padding-right: 32px; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: 11px; color: var(--gray-600); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--danger); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: var(--secondary-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--gray-200); color: var(--gray-700); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: #e8f5ee; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--gray-700); padding: 8px 12px; }
.btn-ghost:hover { background: var(--gray-100); }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 50%; }
.btn-green-outline { background: transparent; border: 1.5px solid var(--primary); color: var(--primary); }
.btn-green-outline:hover { background: var(--primary); color: white; }

/* ========== TABLES ========== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-600);
  background: var(--gray-100);
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-100); }
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
}
.status-dot::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.status-dot.approved::before, .status-dot.confirmed::before { background: var(--success); }
.status-dot.pending::before { background: var(--warning); }
.status-dot.blocked::before, .status-dot.cancelled::before { background: var(--danger); }
.status-dot.in_transit::before { background: var(--accent); }

/* ========== MODALS ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.2s ease;
}
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1000px; }
@keyframes modal-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-close {
  width: 30px; height: 30px;
  background: var(--gray-100);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  color: var(--gray-600);
  transition: var(--transition);
}
.modal-close:hover { background: var(--gray-200); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ========== MAP ========== */
#map-container { height: 520px; border-radius: var(--radius); overflow: hidden; }
.leaflet-popup-content-wrapper { border-radius: var(--radius-sm) !important; font-family: var(--font) !important; }
.map-product-icon { display: flex; align-items: center; justify-content: center; font-size: 20px; }

/* ========== CHAT ========== */
.chat-wrap { display: grid; grid-template-columns: 280px 1fr; height: 560px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.chat-list { border-right: 1px solid var(--gray-200); background: var(--white); overflow-y: auto; }
.chat-list-header { padding: 16px; font-weight: 700; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.chat-list-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 10px;
}
.chat-list-item:hover, .chat-list-item.active { background: #e8f5ee; }
.chat-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.chat-name { font-weight: 600; font-size: 13px; }
.chat-preview { font-size: 11px; color: var(--gray-600); margin-top: 2px; }
.chat-window { display: flex; flex-direction: column; background: #f7fbf9; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.msg {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
}
.msg.me { background: var(--primary); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.other { background: var(--white); color: var(--gray-900); align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.msg-time { font-size: 10px; opacity: 0.6; margin-top: 4px; }
.chat-input-wrap {
  padding: 12px 16px;
  border-top: 1px solid var(--gray-200);
  background: var(--white);
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.chat-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--gray-200);
  font-size: 13px;
  resize: none;
  max-height: 80px;
  overflow-y: auto;
}
.chat-input:focus { border-color: var(--primary); }

/* ========== BREADCRUMB ========== */
.breadcrumb { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; }
.breadcrumb span { font-size: 13px; color: var(--gray-600); }
.breadcrumb span.active { color: var(--gray-900); font-weight: 600; }
.breadcrumb .sep { color: var(--gray-400); font-size: 10px; }

/* ========== DRILL-DOWN ========== */
.drill-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--white);
  border: 1px solid var(--gray-200);
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 8px;
}
.drill-item:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(26,122,60,0.12); }
.drill-item-left { display: flex; align-items: center; gap: 12px; }
.drill-icon { font-size: 22px; }
.drill-name { font-weight: 600; font-size: 14px; }
.drill-sub { font-size: 12px; color: var(--gray-600); margin-top: 2px; }
.drill-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.drill-volume { font-weight: 700; color: var(--primary); font-size: 15px; }
.drill-count { font-size: 12px; color: var(--gray-600); }

/* ========== CONTRACT ========== */
.contract-preview {
  font-family: 'Georgia', serif;
  font-size: 13px;
  line-height: 1.9;
  color: #222;
  max-width: 720px;
  margin: 0 auto;
  padding: 40px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
}
.contract-preview h1 { font-size: 16px; text-align: center; margin-bottom: 4px; letter-spacing: 1px; }
.contract-preview h2 { font-size: 13px; text-align: center; margin-bottom: 24px; }
.contract-preview .clause { margin-bottom: 16px; }
.contract-preview .clause-title { font-weight: 700; }
.contract-preview .signatures { margin-top: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.contract-preview .sig-line { border-top: 1px solid #000; padding-top: 6px; font-size: 11px; text-align: center; }

/* ========== PLANS ========== */
.plan-card {
  border-radius: var(--radius);
  border: 2px solid var(--gray-200);
  padding: 28px 24px;
  background: var(--white);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.plan-card:hover, .plan-card.featured { border-color: var(--primary); box-shadow: 0 4px 24px rgba(26,122,60,0.15); }
.plan-card.featured::before {
  content: 'MAIS POPULAR';
  position: absolute;
  top: 12px; right: -20px;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 32px;
  transform: rotate(45deg);
}
.plan-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.plan-price { font-size: 32px; font-weight: 800; color: var(--primary); line-height: 1; margin: 12px 0 4px; }
.plan-price sub { font-size: 14px; font-weight: 500; color: var(--gray-600); }
.plan-features { list-style: none; margin: 16px 0; }
.plan-features li { font-size: 13px; padding: 4px 0; display: flex; align-items: center; gap: 8px; color: var(--gray-700); }
.plan-features li::before { content: '✓'; color: var(--primary); font-weight: 700; }

/* ========== UPLOAD ZONE ========== */
.upload-zone {
  border: 2px dashed var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--gray-100);
}
.upload-zone:hover, .upload-zone.dragging { border-color: var(--primary); background: #e8f5ee; }
.upload-zone .upload-icon { font-size: 32px; margin-bottom: 8px; }
.upload-zone p { font-size: 13px; color: var(--gray-600); }
.upload-zone strong { color: var(--primary); }
.uploaded-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  font-size: 12px;
}
.uploaded-file .remove { color: var(--danger); cursor: pointer; margin-left: auto; }

/* ========== AUTH PAGE ========== */
.auth-page {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #0d3b20 0%, #1a7a3c 40%, #1e5f30 100%);
}
.auth-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: white;
}
.auth-right {
  width: 460px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  min-height: 100vh;
  overflow-y: auto;
}
.auth-box { width: 100%; max-width: 380px; }
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.auth-logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  color: white;
}
.auth-logo-text { font-size: 18px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.auth-logo-text span { color: var(--secondary); }
.auth-title { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.auth-sub { font-size: 14px; color: var(--gray-600); margin-bottom: 24px; }
.auth-divider { text-align: center; font-size: 12px; color: var(--gray-400); margin: 16px 0; position: relative; }
.auth-divider::before, .auth-divider::after { content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--gray-200); }
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  margin-bottom: 8px;
  color: var(--gray-800);
}
.social-btn:hover { border-color: var(--gray-400); box-shadow: var(--shadow); }
.social-btn .sicon { width: 20px; height: 20px; object-fit: contain; }
.social-btn.gov { background: #1351b4; color: #fff; border-color: #1351b4; }
.social-btn.gov:hover { background: #0d3d8c; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 20px; border-radius: var(--radius-sm); overflow: hidden; border: 1.5px solid var(--gray-200); }
.auth-tab {
  flex: 1;
  padding: 9px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  background: var(--white);
  color: var(--gray-600);
}
.auth-tab.active { background: var(--primary); color: #fff; }

/* ========== NOTIFICATIONS ========== */
.notif-panel {
  position: absolute;
  top: 44px; right: 0;
  width: 320px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  z-index: 2000;
  display: none;
}
.notif-panel.open { display: block; }
.notif-header { padding: 12px 16px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--gray-100); display: flex; justify-content: space-between; align-items: center; }
.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); font-size: 12px; display: flex; gap: 10px; cursor: pointer; transition: var(--transition); }
.notif-item:hover { background: var(--gray-100); }
.notif-item.unread { background: #e8f5ee; }
.notif-icon { font-size: 20px; flex-shrink: 0; }
.notif-text { color: var(--gray-700); }
.notif-time { color: var(--gray-400); margin-top: 2px; font-size: 11px; }

/* ========== PROFILE MENU ========== */
.user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 20px;
  transition: var(--transition);
}
.user-menu:hover { background: var(--gray-100); }
.user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 10px; color: var(--gray-600); text-transform: capitalize; }
.user-dropdown {
  position: absolute;
  top: 44px; right: 0;
  width: 200px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  z-index: 2000;
  display: none;
}
.user-dropdown.open { display: block; }
.user-dropdown-item {
  padding: 11px 16px;
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  transition: var(--transition);
  color: var(--gray-700);
}
.user-dropdown-item:hover { background: var(--gray-100); }
.user-dropdown-item.danger { color: var(--danger); }

/* ========== AD BANNER WRAP ========== */
#ad-banner-wrap {
  margin-top: calc(var(--ticker-height) + var(--header-height));
  padding: 12px 20px 0;
  position: relative;
  z-index: 50;
}

/* ========== ADVERTISEMENT BANNER ========== */
.ad-banner {
  background: linear-gradient(90deg, #1a2e1a 0%, #1a7a3c 100%);
  border-radius: var(--radius);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: white;
  margin-bottom: 16px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: opacity 0.2s;
}
.ad-banner:hover { opacity: 0.95; }
.ad-banner-text h3 { font-size: 15px; font-weight: 700; }
.ad-banner-text p { font-size: 12px; opacity: 0.8; margin-top: 2px; }
.ad-banner-icon { font-size: 40px; opacity: 0.6; }

/* ========== PAGE TITLES ========== */
.page-title { font-size: 20px; font-weight: 800; color: var(--gray-900); margin-bottom: 4px; }
.page-sub { font-size: 13px; color: var(--gray-600); margin-bottom: 20px; }

/* ========== TABS ========== */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
  gap: 0;
  overflow-x: auto;
}
.tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: var(--transition);
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ========== STEP WIZARD ========== */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
  overflow-x: auto;
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.step-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  background: var(--gray-200);
  color: var(--gray-600);
}
.step.active .step-num { background: var(--primary); color: #fff; }
.step.done .step-num { background: var(--success); color: #fff; }
.step-label { font-size: 12px; font-weight: 600; color: var(--gray-600); }
.step.active .step-label { color: var(--primary); }
.step-sep { flex: 1; height: 2px; background: var(--gray-200); min-width: 20px; }
.step.done + .step-sep { background: var(--success); }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 1500;
  }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 12px; }
  .hamburger-btn { display: flex; }
  .header-search { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .auth-right { width: 100%; min-height: 100vh; }
  .chat-wrap { grid-template-columns: 1fr; }
  .chat-list { display: none; }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1400;
    display: none;
  }
  .sidebar-overlay.open { display: block; }
}
@media (max-width: 480px) {
  .contract-preview { padding: 20px; }
  .plan-card { padding: 20px 16px; }
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ========== TOAST ========== */
.toast-container {
  position: fixed;
  bottom: 20px; right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--gray-900);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.3s ease;
  max-width: 320px;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); color: var(--dark); }
@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ========== LOADING SPINNER ========== */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
.spinner-dark { border-color: rgba(0,0,0,0.1); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-600);
}
.empty-state .empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; color: var(--gray-700); }
.empty-state p { font-size: 13px; }

/* ========== PROGRESS BAR ========== */
.progress { height: 6px; background: var(--gray-200); border-radius: 6px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 6px; transition: width 0.3s ease; }

/* PWA INSTALL PROMPT */
.pwa-install-banner {
  position: fixed;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  background: var(--dark);
  color: white;
  padding: 12px 20px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 3000;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  display: none;
}
.pwa-install-banner.visible { display: flex; }
