/* ==========================================================================
   SIMON STONE ART - CLIENT CMS / ADMIN DASHBOARD STYLESHEET
   Clean, modern, luxury studio dashboard
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Montserrat:wght@400;500;600&display=swap');

:root {
  --admin-bg: #f8fafc;
  --admin-card-bg: #ffffff;
  --admin-text-main: #0f172a;
  --admin-text-muted: #64748b;
  --admin-border: #e2e8f0;
  --admin-primary: #0f172a;
  --admin-primary-hover: #1e293b;
  --admin-accent: #3b82f6;
  --admin-danger: #ef4444;
  --admin-success: #10b981;
  --admin-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --admin-heading: 'Montserrat', sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.1);
}

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

body.admin-body {
  background-color: var(--admin-bg);
  color: var(--admin-text-main);
  font-family: var(--admin-font);
  font-size: 0.95rem;
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   LOGIN SCREEN
   ========================================================================== */

.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.login-card {
  background: var(--admin-card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--admin-border);
  width: 100%;
  max-width: 420px;
  padding: 2.8rem 2.5rem;
  text-align: center;
}

.login-logo {
  font-family: var(--admin-heading);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--admin-text-muted);
  margin-bottom: 2rem;
}

.login-form .form-group {
  text-align: left;
  margin-bottom: 1.3rem;
}

.login-form .form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--admin-text-muted);
  margin-bottom: 0.4rem;
}

.login-form .form-control {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-border);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.login-form .form-control:focus {
  border-color: var(--admin-primary);
}

.btn-login {
  width: 100%;
  padding: 0.9rem;
  background: var(--admin-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: 1rem;
  transition: background 0.2s;
}

.btn-login:hover {
  background: var(--admin-primary-hover);
}

.login-hint {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--admin-text-muted);
}

/* ==========================================================================
   ADMIN LAYOUT (SIDEBAR + CONTENT)
   ========================================================================== */

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

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background: #ffffff;
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 1.8rem 1.5rem;
  border-bottom: 1px solid var(--admin-border);
}

.sidebar-brand {
  font-family: var(--admin-heading);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--admin-text-main);
  display: block;
}

.sidebar-sub {
  font-size: 0.75rem;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.sidebar-nav {
  padding: 1.5rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
}

.nav-tab-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--admin-text-muted);
  border: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.2s ease;
}

.nav-tab-btn:hover {
  color: var(--admin-text-main);
  background: #f1f5f9;
}

.nav-tab-btn.active {
  color: #ffffff;
  background: var(--admin-primary);
}

.nav-tab-badge {
  margin-left: auto;
  font-size: 0.75rem;
  background: #ef4444;
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
}

.sidebar-footer {
  padding: 1.2rem 1.5rem;
  border-top: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-sidebar-link {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-sidebar-link:hover {
  color: var(--admin-text-main);
}

/* Main Area */
.admin-main {
  flex: 1;
  margin-left: 260px;
  padding: 2.5rem 3rem;
  max-width: 1400px;
}

/* Header bar */
.admin-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
}

.admin-page-title {
  font-family: var(--admin-heading);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-primary {
  padding: 0.65rem 1.2rem;
  background: var(--admin-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--admin-primary-hover);
}

.btn-secondary {
  padding: 0.65rem 1.2rem;
  background: #ffffff;
  color: var(--admin-text-main);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* ==========================================================================
   STAT CARDS (DASHBOARD)
   ========================================================================== */

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

.stat-card {
  background: var(--admin-card-bg);
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--admin-text-muted);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--admin-text-main);
}

/* ==========================================================================
   ARTWORKS MANAGER
   ========================================================================== */

.artworks-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.select-filter,
.search-input {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 0.85rem;
  outline: none;
}

.search-input {
  width: 280px;
}

.admin-artworks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.admin-art-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.admin-art-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.admin-art-thumb-wrap {
  width: 100%;
  height: 200px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.admin-art-thumb {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.admin-art-info {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.admin-art-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  line-height: 1.3;
  color: var(--admin-text-main);
}

.admin-art-meta {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
  margin-bottom: 0.8rem;
  flex: 1;
}

.admin-art-actions {
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid #f1f5f9;
  padding-top: 0.75rem;
}

.btn-card-action {
  flex: 1;
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-border);
  background: #fff;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.btn-card-action:hover {
  background: #f8fafc;
}

.btn-card-action.delete {
  color: var(--admin-danger);
  border-color: #fecaca;
}

.btn-card-action.delete:hover {
  background: #fee2e2;
}

/* ==========================================================================
   PANEL CONTENT SECTIONS & FORMS
   ========================================================================== */

.admin-tab-content {
  display: none;
}

.admin-tab-content.active {
  display: block;
}

.admin-form-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 2.2rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
}

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

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.2rem;
}

.admin-form-group {
  margin-bottom: 1.3rem;
}

.admin-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--admin-text-main);
  margin-bottom: 0.45rem;
}

.admin-input,
.admin-textarea,
.admin-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--admin-border);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  background: #fff;
  transition: border-color 0.2s;
}

.admin-input:focus,
.admin-textarea:focus,
.admin-select:focus {
  border-color: var(--admin-primary);
}

.admin-textarea {
  min-height: 120px;
}

/* Image preview box */
.image-preview-container {
  margin-top: 0.5rem;
  max-width: 250px;
  max-height: 250px;
  border: 1px dashed var(--admin-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  padding: 0.5rem;
}

.image-preview-container img {
  max-width: 100%;
  max-height: 240px;
  object-fit: contain;
}

/* CV Table */
.cv-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.cv-table th,
.cv-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--admin-border);
}

.cv-table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--admin-text-muted);
  background: #f8fafc;
}

.cv-table tr:hover td {
  background: #fdfdfd;
}

/* Inquiries List */
.inquiry-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-sm);
}

.inquiry-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.inquiry-sender {
  font-weight: 600;
  font-size: 1.05rem;
}

.inquiry-date {
  font-size: 0.8rem;
  color: var(--admin-text-muted);
}

.inquiry-subject {
  font-size: 0.9rem;
  color: var(--admin-accent);
  margin-bottom: 0.6rem;
  font-weight: 500;
}

.inquiry-msg {
  color: #334155;
  line-height: 1.6;
  white-space: pre-wrap;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  background: #f8fafc;
  border-radius: var(--radius-sm);
}

.inquiry-actions {
  display: flex;
  gap: 0.75rem;
}

/* ==========================================================================
   MODAL WINDOWS
   ========================================================================== */

.admin-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.admin-modal.active {
  display: flex;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2.2rem;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.8rem;
  border-bottom: 1px solid var(--admin-border);
  padding-bottom: 1rem;
}

.modal-title {
  font-family: var(--admin-heading);
  font-size: 1.2rem;
  font-weight: 600;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--admin-text-muted);
  cursor: pointer;
}

/* Toast Notifications */
.admin-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  background: var(--admin-primary);
  color: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  display: none;
  z-index: 10000;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Mobile responsive */
@media (max-width: 900px) {
  .admin-sidebar {
    width: 70px;
  }
  .sidebar-header .sidebar-brand,
  .sidebar-header .sidebar-sub,
  .nav-tab-btn span,
  .sidebar-footer {
    display: none;
  }
  .admin-main {
    margin-left: 70px;
    padding: 1.5rem;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   VISITOR ANALYTICS STYLES
   ========================================================================== */

.analytics-bar-item {
  margin-bottom: 1.1rem;
}

.analytics-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--admin-text-main);
  margin-bottom: 0.35rem;
}

.analytics-bar-bg {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}

.analytics-bar-fill {
  height: 100%;
  background: var(--admin-primary);
  border-radius: 4px;
  transition: width 0.5s ease-out;
}

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

.analytics-table th,
.analytics-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--admin-border);
  font-size: 0.88rem;
}

.analytics-table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--admin-text-muted);
  background: #f8fafc;
}

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

.analytics-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
}

.analytics-badge.za {
  background: #ecfdf5;
  color: #065f46;
}

.analytics-badge.direct {
  background: #eff6ff;
  color: #1e40af;
}

.analytics-badge.insta {
  background: #fdf2f8;
  color: #9d174d;
}

