/* admin/css/admin.css - Modern Admin Dashboard */
:root {
  --primary: #146b52;
  --primary-hover: #0d4d3c;
  --primary-light: #e8f5f0;
  --accent: #f8c652;
  --accent-hover: #e5b33d;
  --danger: #e63946;
  --danger-light: #fde8ea;
  --success: #2a9d8f;
  --success-light: #e6f6f4;
  --warning: #e76f51;
  --warning-light: #fdf0ec;
  --bg: #f4f7f6;
  --surface: #ffffff;
  --border: #e2e8e5;
  --text-main: #192d27;
  --text-muted: #627b73;
  --sidebar-bg: #0f3e30;
  --sidebar-text: #d9efe5;
  --sidebar-active: #1a5643;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 12px rgba(15, 62, 48, 0.08);
  --shadow-lg: 0 10px 25px rgba(15, 62, 48, 0.12);
  --font: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

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

a {
  color: var(--primary);
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: 0.95rem;
}

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

/* Sidebar */
.admin-sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: transform 0.3s ease;
  z-index: 100;
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: var(--accent);
  color: #192d27;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-weight: 700;
}

.brand-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: #9dbbb1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  padding: 20px 12px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-category {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #7fa498;
  padding: 12px 12px 6px;
  font-weight: 700;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--sidebar-text);
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.92rem;
  transition: all 0.2s;
}

.sidebar-link:hover {
  background-color: rgba(255,255,255,0.08);
  color: #fff;
}

.sidebar-link.active {
  background-color: var(--sidebar-active);
  color: #fff;
  font-weight: 600;
  border-left: 3px solid var(--accent);
}

.sidebar-link .badge-count {
  margin-left: auto;
  background: var(--accent);
  color: #192d27;
  padding: 2px 7px;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 20px;
}

.sidebar-footer {
  padding: 16px 14px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* Main Content Area */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}

.admin-header {
  height: 70px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-btn-mobile {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-main);
  cursor: pointer;
}

.page-heading h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-body {
  padding: 30px;
  flex: 1;
}

/* UI Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body {
  padding: 24px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 26px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.stat-icon.green { background: #e8f5f0; color: #146b52; }
.stat-icon.yellow { background: #fdf5e0; color: #b78711; }
.stat-icon.blue { background: #e6f0fa; color: #1d72b8; }
.stat-icon.purple { background: #f2ebfb; color: #7232af; }

.stat-content .stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-content .stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-accent {
  background: var(--accent);
  color: #192d27;
}
.btn-accent:hover {
  background: var(--accent-hover);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  background: #f0f4f2;
  border-color: #ccd7d2;
}

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover {
  background: #218377;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #c92a37;
}

.btn-whatsapp {
  background: #25d366;
  color: #fff;
}
.btn-whatsapp:hover {
  background: #1eb857;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-label .required {
  color: var(--danger);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 107, 82, 0.15);
}

textarea.form-control {
  min-height: 90px;
  resize: vertical;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.form-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.92rem;
}

.table th {
  background: #f8faf9;
  padding: 12px 16px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

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

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-primary { background: var(--primary-light); color: var(--primary); }

/* Alerts */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
}

.alert-success { background: var(--success-light); color: #166258; border: 1px solid #bce6df; }
.alert-danger { background: var(--danger-light); color: #9f1823; border: 1px solid #f9bec4; }
.alert-info { background: var(--primary-light); color: var(--primary-hover); border: 1px solid #c2e5d8; }

/* Tabs */
.tabs-nav {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-btn {
  padding: 11px 18px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

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

/* Gallery Grid in Admin */
.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.admin-gallery-item {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.admin-gallery-thumb {
  height: 140px;
  position: relative;
  background: #e9eceb;
}

.admin-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-gallery-caption {
  padding: 12px;
  flex: 1;
  font-size: 0.85rem;
}

.admin-gallery-actions {
  padding: 8px 12px;
  background: #f8faf9;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Login Page Styling */
.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0d382c 0%, #165b46 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 38px 32px;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
}

.login-header .logo-badge {
  width: 56px;
  height: 56px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
}

.login-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
}

.login-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Responsive */
@media (max-width: 900px) {
  .admin-sidebar {
    position: fixed;
    left: -260px;
  }
  .admin-sidebar.open {
    transform: translateX(260px);
  }
  .menu-btn-mobile {
    display: block;
  }
  .admin-header {
    padding: 0 16px;
  }
  .admin-body {
    padding: 18px 16px;
  }
}
