/* ==========================================================================
   Admin Stylesheet - Tuboda.pe
   ========================================================================== */

/* ==========================================================================
   Base & Layout
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f5f5f5;
}

.admin-header {
  background: #1a1a2e;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.admin-header h1 {
  font-size: 1.25rem;
  margin-right: auto;
}

.admin-header h1 a {
  color: white;
  text-decoration: none;
}

.admin-nav {
  display: flex;
  gap: 1.5rem;
}

.admin-nav a {
  color: #ccc;
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.admin-nav a:hover,
.admin-nav a.active {
  color: white;
  border-bottom-color: white;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.admin-user span {
  color: #ccc;
}

.admin-user a {
  color: #ccc;
  text-decoration: none;
}

.admin-user a:hover {
  color: white;
}

.admin-content {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.flash {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
}

.flash.notice {
  background: #d4edda;
  color: #155724;
}

.flash.alert {
  background: #f8d7da;
  color: #721c24;
}

/* ==========================================================================
   Page Header
   ========================================================================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.page-header h2 {
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-decoration: none;
  background: white;
  color: #333;
  cursor: pointer;
  font-size: 1rem;
  display: inline-block;
}

.btn:hover {
  background: #f8f9fa;
}

.btn-primary {
  background: #1a1a2e;
  color: white;
  border-color: #1a1a2e;
}

.btn-primary:hover {
  background: #2a2a4e;
}

.btn-secondary {
  background: #6c757d;
  color: white;
  border-color: #6c757d;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-danger {
  background: #dc3545;
  color: white;
  border-color: #dc3545;
}

.btn-danger:hover {
  background: #c82333;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

/* ==========================================================================
   Badges
   ========================================================================== */
.badge {
  background: #1a1a2e;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
}

/* ==========================================================================
   Status Labels
   ========================================================================== */
.status {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.status-pending {
  background: #fff3cd;
  color: #856404;
}

.status-approved {
  background: #d4edda;
  color: #155724;
}

.status-rejected {
  background: #f8d7da;
  color: #721c24;
}

/* ==========================================================================
   Data Tables
   ========================================================================== */
.data-table,
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.data-table th,
.data-table td,
.admin-table th,
.admin-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.data-table th,
.admin-table th {
  background: #f8f9fa;
  font-weight: 600;
  color: #666;
}

.data-table tr:last-child td,
.admin-table tr:last-child td {
  border-bottom: none;
}

.data-table a,
.admin-table a {
  color: #1a1a2e;
}

.actions {
  display: flex;
  gap: 0.5rem;
}

/* ==========================================================================
   Filters
   ========================================================================== */
.filters {
  margin-bottom: 1.5rem;
}

.filter-form {
  display: flex;
  gap: 0.5rem;
}

.filter-form select {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.detail-card,
.contact-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.detail-card h3 {
  margin: 1.5rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
  font-size: 1rem;
  color: #666;
}

.detail-card h3:first-of-type {
  margin-top: 1rem;
}

.detail-row {
  display: flex;
  padding: 0.5rem 0;
}

.detail-row .label,
.detail-row strong {
  width: 150px;
  font-weight: 600;
  color: #666;
}

.detail-row span {
  flex: 1;
}

.detail-row a {
  color: #1a1a2e;
}

/* ==========================================================================
   Contact Card (specific)
   ========================================================================== */
.contact-card {
  padding: 0;
  overflow: hidden;
}

.contact-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
}

.contact-meta .date {
  color: #666;
  font-size: 0.9rem;
}

.contact-details {
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
}

.contact-details .detail-row {
  margin-bottom: 0.75rem;
}

.contact-details .detail-row:last-child {
  margin-bottom: 0;
}

.contact-details .detail-row strong {
  width: 100px;
}

.contact-message {
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
}

.contact-message h4 {
  margin: 0 0 1rem;
  color: #333;
}

.message-content {
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 4px;
  line-height: 1.6;
}

.message-preview {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #666;
}

.contact-actions {
  padding: 1.5rem;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.provider-form,
.admin-form {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.error-messages {
  background: #f8d7da;
  color: #721c24;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.error-messages h4 {
  margin: 0 0 0.5rem;
}

.error-messages ul {
  margin: 0;
  padding-left: 1.25rem;
}

.form-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #eee;
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: #666;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.form-group textarea {
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-actions {
  display: flex;
  gap: 0.5rem;
  padding-top: 1rem;
}

/* ==========================================================================
   Dashboard
   ========================================================================== */
.welcome {
  margin-bottom: 2rem;
  color: #666;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a1a2e;
}

.stat-label {
  color: #666;
}

.stat-pending .stat-number {
  color: #856404;
}

.stat-approved .stat-number {
  color: #155724;
}

.stat-contacts .stat-number {
  color: #e94560;
}

.stat-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.quick-actions {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quick-actions h3 {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: #666;
}

.quick-actions .btn {
  margin-right: 0.5rem;
}

/* ==========================================================================
   Empty States
   ========================================================================== */
.empty-state {
  text-align: center;
  padding: 2rem;
  color: #666;
}

/* ==========================================================================
   Import Page
   ========================================================================== */
.import-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.import-instructions {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
}

.import-instructions h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.import-instructions h4 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.import-instructions ul {
  margin: 0;
  padding-left: 1.5rem;
}

.import-instructions li {
  margin-bottom: 0.5rem;
}

.import-instructions .note {
  margin-top: 1.5rem;
  padding: 1rem;
  background: #fff3cd;
  border-radius: 4px;
  color: #856404;
}

.download-sample {
  margin-top: 1.5rem;
}

.btn-outline {
  background: white;
  color: #1a1a2e;
  border: 2px solid #1a1a2e;
}

.btn-outline:hover {
  background: #1a1a2e;
  color: white;
}

.import-form-container {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

.import-form label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.import-form input[type="file"] {
  width: 100%;
  padding: 0.5rem;
  border: 2px dashed #ddd;
  border-radius: 4px;
  background: #fafafa;
}

.import-form input[type="file"]:hover {
  border-color: #1a1a2e;
}

/* ==========================================================================
   Import Results
   ========================================================================== */
.results-container {
  max-width: 800px;
}

.results-summary {
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.results-summary h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.results-summary p {
  margin: 0.25rem 0;
}

.summary-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.summary-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.results-section {
  margin-bottom: 1.5rem;
}

.results-section h3 {
  margin-bottom: 1rem;
}

.error-list {
  margin: 0;
  padding-left: 1.25rem;
}

.error-list li {
  color: #721c24;
}

.actions-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eee;
}

/* ==========================================================================
   Admin Users
   ========================================================================== */
.admin-card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 1rem;
}

.admin-card.admin-card-narrow {
  max-width: 500px;
}

.detail-list {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0.5rem;
}

.detail-list dt {
  font-weight: 600;
  color: #666;
}

.detail-list dd {
  color: #333;
}

.admin-actions {
  display: flex;
  gap: 0.5rem;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-control {
  padding: 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
}

.form-control:focus {
  outline: none;
  border-color: #1a1a2e;
}

.form-errors {
  background: #f8d7da;
  color: #721c24;
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.form-errors h4 {
  margin-bottom: 0.5rem;
}

.form-errors ul {
  margin-left: 1.5rem;
}

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

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

  .form-row {
    grid-template-columns: 1fr;
  }
}
