/* ===== Base ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #f0f2f5;
  margin: 0;
  padding: 0;
  color: #1f2937;
}

/* ===== Buttons ===== */
.btn-primary {
  padding: 10px 18px;
  border: none;
  background-color: #0d6efd;
  color: #fff;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary:hover {
  background-color: #0b5ed7;
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ghost {
  padding: 8px 16px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
}

.btn-ghost:hover {
  background-color: #f1f5f9;
}

.btn-sm {
  padding: 5px 12px;
  border: none;
  border-radius: 14px;
  font-size: 12px;
  cursor: pointer;
}

.btn-edit {
  background-color: #e7f1ff;
  color: #0d6efd;
}

.btn-edit:hover {
  background-color: #0d6efd;
  color: #fff;
}

.btn-delete {
  background-color: #fde8e8;
  color: #dc2626;
  margin-left: 6px;
}

.btn-delete:hover {
  background-color: #dc2626;
  color: #fff;
}

/* ===== Login ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  background: #fff;
  padding: 40px 36px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 380px;
  width: 100%;
}

.login-logo {
  font-size: 48px;
  margin-bottom: 8px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 26px;
}

.login-sub {
  color: #64748b;
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 24px;
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid #dadce0;
  background: #fff;
  color: #3c4043;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

.btn-google:hover {
  background-color: #f8f9fa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.login-error {
  color: #dc2626;
  font-size: 13px;
  margin: 14px 0 0;
}

/* ===== Topbar ===== */
.topbar {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-brand {
  font-size: 18px;
  font-weight: bold;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.user-meta span:first-child {
  font-size: 14px;
  font-weight: bold;
}

.user-email {
  font-size: 12px;
  color: #64748b;
}

/* ===== Main / table ===== */
.main {
  max-width: 1000px;
  margin: 24px auto;
  padding: 0 20px;
}

.toolbar-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

#search-input {
  flex: 1;
  padding: 10px 16px;
  border-radius: 20px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.stat {
  color: #64748b;
  font-size: 13px;
  margin: 0 0 10px;
}

.table-wrap {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow-x: auto;
  padding: 6px 12px 12px;
}

.customer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 720px;
}

.customer-table th {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 2px solid #e2e8f0;
  color: #475569;
  font-size: 13px;
  white-space: nowrap;
}

.customer-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.customer-table tr:last-child td {
  border-bottom: none;
}

.customer-table tr:hover td {
  background-color: #f8fafc;
}

.td-name {
  font-weight: bold;
}

.td-address {
  max-width: 260px;
}

.th-actions,
.td-actions {
  text-align: right;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  color: #64748b;
  padding: 32px 10px;
  margin: 0;
}

/* ===== Dialog (modal) ===== */
.dialog {
  border: none;
  border-radius: 14px;
  padding: 0;
  width: min(440px, 92vw);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.dialog form {
  padding: 24px;
}

.dialog h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

.dialog label {
  display: block;
  font-size: 13px;
  color: #475569;
  margin-bottom: 12px;
  font-weight: bold;
}

.dialog .req {
  color: #dc2626;
}

.dialog input,
.dialog textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 9px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  font-weight: normal;
  resize: vertical;
}

.dialog input:focus,
.dialog textarea:focus {
  outline: 2px solid #0d6efd33;
  border-color: #0d6efd;
}

.form-error {
  color: #dc2626;
  font-size: 13px;
  margin: 0 0 10px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .toolbar-row {
    flex-direction: column;
  }

  .topbar {
    justify-content: center;
  }
}
