/* SmartTemp Admin Panel - Styles */

/* === Reset & Base === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-primary: #29b6f6;
  --color-primary-dark: #0288d1;
  --color-primary-light: #e1f5fe;
  --color-danger: #e53935;
  --color-danger-light: #ffebee;
  --color-success: #43a047;
  --color-success-light: #e8f5e9;
  --color-whatsapp: #25d366;
  --color-whatsapp-dark: #128c7e;
  --color-bg: #f5f7fa;
  --color-surface: #ffffff;
  --color-text: #212121;
  --color-text-secondary: #616161;
  --color-border: #e0e0e0;
  --color-error: #d32f2f;
  --radius: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --transition: 0.2s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
}

/* === Header === */
.header {
  background: var(--color-primary);
  color: #fff;
  padding: 1rem 2rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header__brand {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}

.header__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header__subtitle {
  font-size: 0.875rem;
  opacity: 0.85;
}

/* === Main Layout === */
.main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* === Panel === */
.panel {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-primary-light);
}

.panel__actions {
  margin-top: auto;
  padding-top: 1rem;
}

/* === Search Bar === */
.search-bar {
  position: relative;
}

.search-bar__input {
  width: 100%;
  padding: 0.625rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: border-color var(--transition);
}

.search-bar__input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(41, 182, 246, 0.15);
}

/* === Table === */
.table-container {
  overflow-x: auto;
  flex: 1;
}

.client-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.client-table th {
  text-align: left;
  padding: 0.75rem 0.5rem;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 600;
  white-space: nowrap;
}

.client-table td {
  padding: 0.625rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.client-table tbody tr:hover {
  background: var(--color-primary-light);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), opacity var(--transition);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: var(--color-primary-dark);
}

.btn--secondary {
  background: var(--color-border);
  color: var(--color-text);
}

.btn--secondary:hover:not(:disabled) {
  background: #bdbdbd;
}

.btn--danger {
  background: var(--color-danger);
  color: #fff;
}

.btn--danger:hover:not(:disabled) {
  background: #c62828;
}

.btn--whatsapp {
  background: var(--color-whatsapp);
  color: #fff;
}

.btn--whatsapp:hover:not(:disabled) {
  background: var(--color-whatsapp-dark);
}

.btn--wide {
  width: 100%;
}

.btn--small {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

/* === Form Groups === */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.form-group__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.form-group__input,
.form-group__select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: border-color var(--transition);
}

.form-group__input:focus,
.form-group__select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(41, 182, 246, 0.15);
}

.form-group__input--error {
  border-color: var(--color-error);
}

.form-group__error {
  font-size: 0.75rem;
  color: var(--color-error);
}

/* === Radio Group === */
.radio-group {
  display: flex;
  gap: 1.5rem;
}

.radio-group__option {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  cursor: pointer;
}

/* === Price Preview === */
.price-preview {
  background: var(--color-primary-light);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 0.5rem;
}

.price-preview__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  margin-bottom: 0.75rem;
}

.price-preview__content {
  font-size: 0.875rem;
}

.price-preview__placeholder {
  color: var(--color-text-secondary);
  font-style: italic;
}

.price-preview__row {
  display: flex;
  justify-content: space-between;
  padding: 0.375rem 0;
  border-bottom: 1px solid rgba(41, 182, 246, 0.2);
}

.price-preview__row--total {
  font-weight: 700;
  border-bottom: none;
  border-top: 2px solid var(--color-primary);
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

/* === Proposal History === */
.proposal-history {
  margin-top: 1rem;
}

.proposal-history__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 0.5rem;
}

.proposal-history__list {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
}

.proposal-history__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: background var(--transition);
}

.proposal-history__item:hover {
  background: var(--color-primary-light);
}

/* === Share Panel === */
.share-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.share-panel__title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 0.75rem;
}

.share-panel__actions {
  display: flex;
  gap: 0.75rem;
}

.share-panel__confirmation {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-success);
  font-weight: 500;
}

.share-panel__error {
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--color-error);
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  padding: 1.5rem;
  animation: modal-enter 0.2s ease;
}

.modal--small {
  max-width: 380px;
}

@keyframes modal-enter {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.modal__title {
  font-size: 1.125rem;
  font-weight: 600;
}

.modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--color-text-secondary);
  line-height: 1;
  padding: 0.25rem;
}

.modal__close:hover {
  color: var(--color-text);
}

.modal__message {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.25rem;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* === Empty State === */
.empty-message {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  padding: 2rem 1rem;
  font-style: italic;
}

/* === Responsive === */
@media (max-width: 1024px) {
  .main {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
}

@media (max-width: 600px) {
  .header {
    padding: 0.75rem 1rem;
  }

  .header__brand {
    flex-direction: column;
    gap: 0.25rem;
  }

  .header__title {
    font-size: 1.25rem;
  }

  .panel {
    padding: 1rem;
  }

  .radio-group {
    flex-direction: column;
    gap: 0.5rem;
  }

  .share-panel__actions {
    flex-direction: column;
  }

  .modal {
    max-width: 100%;
  }

  .client-table th:nth-child(3),
  .client-table td:nth-child(3) {
    display: none;
  }
}
