/* DCL Customer Portal — branded styles
 * Only applied to portal pages (loaded via web_include_css).
 * Uses class prefix .dcl-portal-* to avoid clashing with any other CSS.
 */

.dcl-portal {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #2d3748;
}

.dcl-portal-header {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: white;
  padding: 24px 0;
  margin-bottom: 24px;
}
.dcl-portal-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
}
.dcl-portal-header .subtitle {
  font-size: 14px;
  opacity: 0.9;
  margin-top: 4px;
}

.dcl-portal-nav {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 24px;
}
.dcl-portal-nav .nav-link {
  color: #4a5568;
  font-weight: 500;
  padding: 14px 18px;
  border-bottom: 3px solid transparent;
}
.dcl-portal-nav .nav-link:hover {
  color: #059669;
  text-decoration: none;
}
.dcl-portal-nav .nav-link.active {
  color: #059669;
  border-bottom-color: #059669;
}

.dcl-stat-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
  transition: box-shadow 0.15s ease;
}
.dcl-stat-card:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}
.dcl-stat-card .stat-value {
  font-size: 36px;
  font-weight: 700;
  color: #059669;
  line-height: 1;
}
.dcl-stat-card .stat-label {
  font-size: 13px;
  color: #718096;
  margin-top: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Status pills */
.dcl-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dcl-status.active            { background: #dcfce7; color: #153524; }
.dcl-status.under-maintenance { background: #fef3c7; color: #92400e; }
.dcl-status.awaiting-parts    { background: #fed7aa; color: #9a3412; }
.dcl-status.faulty            { background: #fecaca; color: #991b1b; }
.dcl-status.inactive          { background: #e5e7eb; color: #4b5563; }
.dcl-status.retired           { background: #cbd5e1; color: #334155; }

/* Issue status */
.dcl-issue-status.open        { background: #dbeafe; color: #1e40af; }
.dcl-issue-status.replied     { background: #e0e7ff; color: #4338ca; }
.dcl-issue-status.in-progress { background: #fef3c7; color: #92400e; }
.dcl-issue-status.on-hold     { background: #f3e8ff; color: #6b21a8; }
.dcl-issue-status.hold        { background: #f3e8ff; color: #6b21a8; }
.dcl-issue-status.resolved    { background: #dcfce7; color: #153524; }
.dcl-issue-status.closed      { background: #e5e7eb; color: #4b5563; }

/* Priority */
.dcl-priority {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.dcl-priority.low    { background: #f3f4f6; color: #4b5563; }
.dcl-priority.medium { background: #dbeafe; color: #1e40af; }
.dcl-priority.high   { background: #fed7aa; color: #9a3412; }
.dcl-priority.urgent { background: #fecaca; color: #991b1b; }

/* Tables */
.dcl-portal table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}
.dcl-portal table th {
  background: #f8fafc;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4a5568;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.dcl-portal table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  font-size: 14px;
}
.dcl-portal table tr:hover {
  background: #fafbfc;
}
.dcl-portal table tr:last-child td {
  border-bottom: none;
}

/* Cards */
.dcl-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}
.dcl-card-header {
  font-size: 16px;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}

/* Buttons */
.dcl-btn-primary {
  background: #059669;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.dcl-btn-primary:hover {
  background: #047857;
  color: white;
  text-decoration: none;
}
.dcl-btn-secondary {
  background: white;
  color: #059669;
  border: 1px solid #059669;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.dcl-btn-secondary:hover {
  background: #f0fdf4;
  color: #047857;
  text-decoration: none;
}

/* Conversation thread */
.dcl-conversation {
  background: #f8fafc;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
}
.dcl-message {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.dcl-message-meta {
  font-size: 12px;
  color: #718096;
  margin-bottom: 8px;
}
.dcl-message-sender {
  font-weight: 600;
  color: #2d3748;
}

/* Filter bar */
.dcl-filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.dcl-filter-bar select,
.dcl-filter-bar input[type=text] {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
}

/* Empty states */
.dcl-empty {
  text-align: center;
  padding: 48px 24px;
  color: #718096;
}
.dcl-empty .empty-icon {
  font-size: 48px;
  opacity: 0.4;
  margin-bottom: 12px;
}

/* Brand logo */
.dcl-portal-brand img {
  height: 36px;
}

/* Responsive */
@media (max-width: 768px) {
  .dcl-portal-header h1 {
    font-size: 22px;
  }
  .dcl-stat-card .stat-value {
    font-size: 28px;
  }
  .dcl-portal table {
    font-size: 13px;
  }
  .dcl-portal table th,
  .dcl-portal table td {
    padding: 8px 10px;
  }
}
