/* Customer Billing Tracker - Dashboard Styles */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f7fa;
  color: #1a1a2e;
  line-height: 1.5;
}

header {
  background: #232f3e;
  color: #fff;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 {
  font-size: 1.25rem;
  font-weight: 600;
}

header .sign-in-link {
  color: #ff9900;
  text-decoration: none;
  font-size: 0.875rem;
}

header .sign-in-link:hover {
  text-decoration: underline;
}

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

/* Customer list panel */
.customer-list-panel {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.customer-list-panel h2 {
  padding: 1rem;
  font-size: 1rem;
  border-bottom: 1px solid #e8ecf0;
  background: #fafbfc;
}

.customer-list {
  list-style: none;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

.customer-list li {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f2f5;
  transition: background 0.15s;
}

.customer-list li:hover {
  background: #f0f4ff;
}

.customer-list li.active {
  background: #e6f0ff;
  border-left: 3px solid #0073bb;
}

.customer-list li .customer-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.customer-list li .customer-id {
  font-size: 0.75rem;
  color: #687078;
  margin-top: 2px;
}

/* Detail panel */
.detail-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.detail-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.25rem;
}

.detail-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: #16191f;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  color: #687078;
  text-align: center;
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.empty-state .hint {
  font-size: 0.85rem;
  color: #9ba7b4;
}

/* Refresh button */
.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: #0073bb;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}

.refresh-btn:hover {
  background: #005a94;
}

.refresh-btn:disabled {
  background: #b0bec5;
  cursor: not-allowed;
}

.refresh-btn .spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

.refresh-btn.loading .spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Trend table */
.trend-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.trend-table th,
.trend-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #f0f2f5;
}

.trend-table th {
  background: #fafbfc;
  font-weight: 600;
  color: #545b64;
}

.trend-table .positive {
  color: #d13212;
}

.trend-table .negative {
  color: #1d8102;
}

/* Service breakdown */
.service-list {
  list-style: none;
}

.service-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid #f5f7fa;
  font-size: 0.85rem;
}

.service-list .bar-container {
  flex: 1;
  margin: 0 1rem;
  height: 6px;
  background: #e8ecf0;
  border-radius: 3px;
  overflow: hidden;
}

.service-list .bar {
  height: 100%;
  background: #0073bb;
  border-radius: 3px;
}

/* Commitment reminders */
.commitment-list {
  list-style: none;
}

.commitment-list li {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f5f7fa;
  font-size: 0.85rem;
}

.commitment-list .expiry-warning {
  color: #d13212;
  font-weight: 500;
}

/* Status messages */
.status-msg {
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.status-msg.success {
  background: #e6f9ed;
  color: #1d8102;
}

.status-msg.error {
  background: #fde8e8;
  color: #d13212;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
  }
}
