/* SuomiJobs Admin Dashboard Styles */

:root {
  --admin-sidebar-width: 240px;
  --admin-sidebar-bg: #111827;
  --admin-sidebar-text: #d1d5db;
  --admin-sidebar-active: #059669;
}

/* Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: var(--admin-sidebar-width);
  background: var(--admin-sidebar-bg);
  color: var(--admin-sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.admin-sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.admin-sidebar-header .nav-logo {
  color: #fff;
}

.admin-sidebar-header .logo-mark {
  font-size: 18px;
}

.admin-nav {
  flex: 1;
  padding: 8px 0;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--admin-sidebar-text);
  text-decoration: none;
  font-size: .9rem;
  transition: all .15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.admin-nav-item:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}

.admin-nav-item.active {
  background: rgba(5,150,105,.15);
  color: var(--admin-sidebar-active);
  border-right: 3px solid var(--admin-sidebar-active);
}

.admin-nav-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.admin-sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 8px 0;
}

.admin-user-info {
  padding: 12px 16px;
}

.admin-user-name {
  display: block;
  font-weight: 600;
  color: #fff;
  font-size: .9rem;
}

.admin-user-role {
  font-size: .75rem;
  color: var(--admin-sidebar-text);
  text-transform: capitalize;
}

/* Main content */
.admin-main {
  margin-left: var(--admin-sidebar-width);
  flex: 1;
  background: #f3f4f6;
  min-height: 100vh;
}

.admin-header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-header h1 {
  font-size: 1.3rem;
  font-weight: 700;
}

.admin-content {
  padding: 24px 32px;
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #e5e7eb;
}

.stat-card-label {
  font-size: .85rem;
  color: #6b7280;
  margin-bottom: 4px;
}

.stat-card-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: #111827;
}

.stat-card-sub {
  font-size: .8rem;
  color: #059669;
  margin-top: 4px;
}

/* Tables */
.admin-table-wrapper {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  margin-bottom: 24px;
}

.admin-table-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-table-header h2 {
  font-size: 1.05rem;
  font-weight: 600;
}

.admin-table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-search {
  padding: 8px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: .9rem;
  width: 250px;
}

.admin-filter {
  padding: 8px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: .9rem;
  background: #fff;
}

table.admin-table {
  width: 100%;
  border-collapse: collapse;
}

table.admin-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7280;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

table.admin-table td {
  padding: 12px 16px;
  font-size: .9rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
}

table.admin-table tr:hover {
  background: #f9fafb;
}

table.admin-table tr {
  cursor: pointer;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: capitalize;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
}

.pagination button {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: .9rem;
}

.pagination button:hover {
  background: #f3f4f6;
}

.pagination-info {
  font-size: .9rem;
  color: #6b7280;
}

/* Detail Panel */
.admin-detail-panel {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 24px;
  margin-bottom: 24px;
}

.admin-detail-panel h2 {
  font-size: 1.2rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.detail-field {
  margin-bottom: 12px;
}

.detail-field label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6b7280;
  margin-bottom: 2px;
}

.detail-field span {
  font-size: .95rem;
  color: #111827;
}

/* Action buttons */
.action-btn {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: .8rem;
  cursor: pointer;
  transition: all .15s;
}

.action-btn:hover {
  background: #f3f4f6;
}

.action-btn-primary {
  background: #059669;
  color: #fff;
  border-color: #059669;
}

.action-btn-primary:hover {
  background: #047857;
}

.action-btn-danger {
  color: #dc2626;
  border-color: #dc2626;
}

.action-btn-danger:hover {
  background: #fef2f2;
}

/* Notes */
.admin-notes {
  margin-top: 16px;
}

.admin-note {
  padding: 12px;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  border-radius: 0 8px 8px 0;
  margin-bottom: 8px;
  font-size: .9rem;
}

.admin-note-date {
  font-size: .75rem;
  color: #6b7280;
  margin-top: 4px;
}

.note-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.note-form textarea {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: .9rem;
  min-height: 60px;
  resize: vertical;
}

/* Activity Feed */
.activity-feed {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.activity-feed-header {
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
}

.activity-item {
  padding: 12px 20px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: .9rem;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  flex-shrink: 0;
}

.activity-icon-blue { background: #dbeafe; color: #2563eb; }
.activity-icon-green { background: #d1fae5; color: #059669; }
.activity-icon-amber { background: #fef3c7; color: #d97706; }

.activity-text {
  flex: 1;
}

.activity-text strong {
  font-weight: 600;
}

.activity-time {
  font-size: .8rem;
  color: #9ca3af;
  white-space: nowrap;
}

/* Message card */
.message-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color .15s;
}

.message-card:hover {
  border-color: #059669;
}

.message-card.unread {
  border-left: 3px solid #3b82f6;
  background: #f8fafc;
}

.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.message-sender {
  font-weight: 600;
}

.message-time {
  font-size: .8rem;
  color: #9ca3af;
}

.message-subject {
  font-weight: 500;
  margin-bottom: 4px;
}

.message-preview {
  font-size: .9rem;
  color: #6b7280;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Test data badge */
.test-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: .6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-left: 6px;
  vertical-align: middle;
}

/* Featured badge */
.featured-badge {
  background: #fef3c7;
  color: #92400e;
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

/* Modal */
.admin-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.admin-modal-overlay.open {
  display: flex;
}

.admin-modal {
  background: #fff;
  border-radius: 12px;
  width: 95%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.admin-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.admin-modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
}

.admin-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  line-height: 1;
  padding: 4px;
}

.admin-modal-close:hover {
  color: #111827;
}

.admin-modal-body {
  padding: 24px;
}

.admin-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: .9rem;
  font-family: inherit;
  box-sizing: border-box;
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

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

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Mobile hamburger */
.admin-hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  color: #374151;
  line-height: 1;
}

.admin-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 99;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-hamburger {
    display: block;
  }
  .admin-sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-sidebar-overlay.open {
    display: block;
  }
  .admin-main {
    margin-left: 0;
  }
  .admin-header {
    padding: 12px 16px;
    gap: 8px;
  }
  .admin-header h1 {
    font-size: 1.1rem;
  }
  .admin-content {
    padding: 12px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  table.admin-table th,
  table.admin-table td {
    padding: 8px 10px;
    font-size: .8rem;
    white-space: nowrap;
  }
  .admin-table-header {
    flex-direction: column;
    align-items: stretch;
  }
  .admin-table-actions {
    flex-wrap: wrap;
  }
  .admin-search {
    width: 100%;
  }
  .admin-filter {
    flex: 1;
    min-width: 0;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .admin-detail-panel {
    padding: 16px;
  }
  .note-form {
    flex-direction: column;
  }
  .pagination {
    flex-wrap: wrap;
    gap: 8px;
  }
  .activity-item {
    padding: 10px 12px;
    font-size: .85rem;
  }
  .message-header {
    flex-direction: column;
    gap: 2px;
  }
}
