.dashboard-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  min-height: calc(100vh - 60px);
}

.dashboard-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  height: fit-content;
  position: sticky;
  top: 80px;
}

.user-info {
  text-align: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}

.user-avatar {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-link {
  padding: 1rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-link:hover {
  background: rgba(34, 197, 94, 0.1);
  border-color: var(--green);
  color: var(--green);
}

.sidebar-link.active {
  background: rgba(34, 197, 94, 0.1);
  border-color: var(--green);
  color: var(--green);
  font-weight: 600;
}

.dashboard-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  min-height: 600px;
  overflow-y: auto;
}

.dashboard-view {
  display: none;
}

.dashboard-view.active {
  display: block;
  animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.view-header h1 {
  margin: 0;
  color: var(--text);
  font-size: 2rem;
}

/* Orders Grid */
.orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.order-card-dashboard {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.3s;
}

.order-card-dashboard:hover {
  border-color: var(--green);
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(34, 197, 94, 0.2);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.order-id {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.order-status {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.order-status.pending {
  background: rgba(239, 159, 39, 0.2);
  color: #fcd34d;
}

.order-status.processing {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.order-status.completed {
  background: rgba(34, 197, 94, 0.2);
  color: var(--green-light);
}

.order-status.review {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
}

.order-status.revision {
  background: rgba(249, 115, 22, 0.2);
  color: #fed7aa;
}

.order-status.rejected {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.order-card-body {
  margin-bottom: 1rem;
}

.order-package {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.order-date {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.order-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
}

.order-price {
  font-weight: 600;
  color: var(--green);
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  display: block;
}

.empty-state h2 {
  color: var(--text);
  margin: 1rem 0;
  font-size: 1.5rem;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Settings */
.settings-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2rem;
  margin-bottom: 2rem;
}

.settings-card h2 {
  margin-bottom: 1.5rem;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.3s;
}

.modal-close:hover {
  color: var(--green);
}

/* Order Detail Modal */
.order-detail-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.order-detail-header h2 {
  margin-bottom: 0.5rem;
}

.order-detail-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.order-detail-section {
  margin-bottom: 2rem;
}

.order-detail-section h3 {
  margin-bottom: 1rem;
  color: var(--green);
}

.order-detail-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.order-detail-item:last-child {
  border-bottom: none;
}

.order-detail-label {
  color: var(--text-muted);
}

.order-detail-value {
  font-weight: 600;
}

.download-links {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
}

.download-links a {
  flex: 1;
  padding: 0.75rem;
  background: var(--green);
  color: var(--bg-primary);
  text-decoration: none;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  transition: background 0.3s;
}

.download-links a:hover {
  background: var(--green-dark);
}

.revision-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 6px;
}

.revision-form textarea {
  width: 100%;
  margin-bottom: 1rem;
}

/* Invoices */
.invoices-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.invoice-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: all 0.3s;
}

.invoice-card:hover {
  border-color: var(--green);
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.15);
  transform: translateY(-4px);
}

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.invoice-order-id {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.invoice-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.invoice-status {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: rgba(34, 197, 94, 0.2);
  color: var(--green-light);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.invoice-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.invoice-info strong {
  color: var(--text);
}

.invoice-files {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.file-button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--green);
  color: var(--bg-primary);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s;
  font-size: 0.9rem;
}

.file-button:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
}

.file-button-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.file-button-secondary:hover {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.1);
}

.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid #ef4444;
  color: #fca5a5;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  display: none;
}

.error.show {
  display: block;
}
/* ============================================
   MOBILE-FIRST CLIENT PORTAL RESPONSIVE CSS
   ============================================ */

@media (max-width: 1024px) {
  .dashboard-container {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 1rem;
    padding-bottom: 90px; /* space for bottom nav */
  }

  .dashboard-sidebar {
    position: static !important;
    top: auto !important;
    border-radius: 16px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
  }
}

@media (max-width: 768px) {
  /* ---- Layout ---- */
  .dashboard-container {
    padding: 0.75rem;
    padding-bottom: 90px;
    gap: 0;
  }

  /* ---- Sidebar → Horizontal pill tabs ---- */
  .dashboard-sidebar {
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
  }

  .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    padding-bottom: 0.875rem;
    margin-bottom: 0.875rem;
    border-bottom: 1px solid var(--border);
  }

  .user-avatar {
    font-size: 2.25rem;
    margin: 0;
    width: 50px;
    height: 50px;
    background: rgba(34,197,94,0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .user-info-text { flex: 1; min-width: 0; }
  .user-info-text > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .sidebar-menu {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    gap: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .sidebar-menu::-webkit-scrollbar { display: none; }

  .sidebar-link {
    flex-shrink: 0;
    padding: 0.55rem 1.1rem;
    font-size: 0.82rem;
    border-radius: 20px;
    white-space: nowrap;
    gap: 0.4rem;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
  }

  .sidebar-link.active {
    background: var(--green);
    color: var(--bg-primary);
    border-color: var(--green);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(34,197,94,0.4);
  }

  /* ---- Content Area ---- */
  .dashboard-content {
    padding: 1.25rem;
    border-radius: 16px;
    min-height: auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
  }

  .view-header {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
  }

  .view-header h1 {
    font-size: 1.35rem;
    margin: 0;
    flex: 1;
  }

  .view-header .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  /* ---- Order Cards ---- */
  .orders-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .order-card-dashboard {
    padding: 1.1rem;
    border-radius: 12px;
    border-left: 3px solid var(--border);
    transition: border-color 0.2s;
  }

  .order-card-dashboard:hover {
    border-left-color: var(--green);
  }

  .order-card-header {
    margin-bottom: 0.75rem;
  }

  .order-id { font-size: 0.78rem; }

  .order-package {
    font-size: 0.95rem;
  }

  .order-price {
    font-size: 1.1rem;
    font-weight: 700;
  }

  /* ---- Invoice Cards ---- */
  .invoices-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .invoice-card {
    padding: 1.1rem;
    border-radius: 12px;
  }

  .file-button {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
    justify-content: center;
  }

  /* ---- Settings ---- */
  .settings-card {
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1rem;
  }

  .settings-card h2 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
  }

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

  /* ---- Modals ---- */
  .modal-content {
    width: 95vw;
    max-width: 95vw;
    margin: 1rem auto;
    padding: 1.25rem;
    border-radius: 16px;
    max-height: 88vh;
  }

  .modal-close {
    top: 0.75rem;
    right: 0.75rem;
    font-size: 1.5rem;
  }

  /* ---- Order detail meta ---- */
  .order-detail-meta { grid-template-columns: 1fr; gap: 0.5rem; }
  .download-links { flex-direction: column; gap: 0.75rem; }
  .download-links a { text-align: center; }

  /* ---- Empty state ---- */
  .empty-state {
    padding: 2rem 1rem;
  }

  .empty-state h2 { font-size: 1.25rem; }

  /* ---- iframe for new order ---- */
  iframe {
    height: 600px !important;
    border-radius: 12px !important;
  }
}

@media (max-width: 480px) {
  .dashboard-container {
    padding: 0.5rem;
    padding-bottom: 85px;
  }

  .dashboard-sidebar { border-radius: 12px; padding: 0.875rem; }
  .dashboard-content { padding: 1rem; border-radius: 12px; }

  .user-info { flex-direction: row; }
  .user-avatar { font-size: 1.75rem; width: 42px; height: 42px; }

  .sidebar-link { padding: 0.45rem 0.85rem; font-size: 0.78rem; }

  .view-header h1 { font-size: 1.2rem; }

  .order-card-dashboard { padding: 0.875rem; }
  .order-id { font-size: 0.72rem; }
  .order-package { font-size: 0.88rem; }

  .settings-card { padding: 1rem; }
  .modal-content { padding: 1rem; max-height: 92vh; }

  .invoice-order-id { font-size: 1rem; }
  .file-button { font-size: 0.82rem; padding: 0.65rem 0.875rem; }
}

/* ============================================
   MOBILE BOTTOM NAVIGATION BAR
   ============================================ */
.dash-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.25);
  height: 65px;
  padding: 0 0.5rem;
  justify-content: space-around;
  align-items: center;
}

.dash-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.6rem;
  font-weight: 500;
  transition: all 0.2s ease;
  flex: 1;
  max-width: 70px;
}

.dash-nav-item.active {
  color: var(--green);
}

.dash-nav-item.active .dash-nav-icon {
  transform: translateY(-2px);
  filter: drop-shadow(0 2px 6px rgba(34,197,94,0.5));
}

.dash-nav-center {
  background: var(--green);
  color: var(--bg-primary) !important;
  border-radius: 14px;
  padding: 8px 12px;
  margin: 0 4px;
  box-shadow: 0 4px 16px rgba(34,197,94,0.45);
}

.dash-nav-center:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(34,197,94,0.6);
}

.dash-nav-icon {
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 0.2s;
}

.dash-nav-label {
  font-size: 0.58rem;
  line-height: 1;
}

@media (max-width: 768px) {
  .dash-bottom-nav { display: flex; }
  .dashboard-container { padding-bottom: 80px !important; }
  /* hide top navbar logout on mobile since bottom nav has it */
  .navbar .nav-links li:last-child { display: none; }
}
