:root {
    --primary-color: #d4af37;
    --primary-light: #fdf8e6;
    --background-color: #f8f9fa;
    --card-bg-color: #ffffff;
    --text-color: #555;
    --heading-color: #111;
    --border-color: #dee2e6;
    --sidebar-bg: #111;
    --sidebar-text: #adb5bd;
    --sidebar-text-hover: #ffffff;
    --error-color: #e74c3c;
    --success-color: #2ecc71;
    --pending-bg: #fff8e1;
    --pending-text: #f57f17;
    --selesai-bg: #e8f5e9;
    --selesai-text: #2e7d32;
    --font-family: "Inter", sans-serif;
    --sidebar-width: 260px;
}
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}
body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    font-size: 16px;
    overflow-x: hidden;
}
body.sidebar-open {
    overflow: hidden;
}
.admin-layout {
    display: flex;
}
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 1rem;
    flex-shrink: 0;
    transition: transform 0.3s ease-in-out;
}
.sidebar-header h2 {
    color: var(--sidebar-text-hover);
    text-align: center;
    margin-bottom: 2rem;
    font-family: "Lora", serif;
}
.sidebar-nav {
    flex-grow: 1;
}
.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    text-decoration: none;
    color: var(--sidebar-text);
    transition: background-color 0.2s, color 0.2s;
}
.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text-hover);
}
.nav-link.active {
    background-color: var(--primary-color);
    color: var(--sidebar-bg);
    font-weight: 500;
}
.sidebar-footer {
    padding-top: 1rem;
    border-top: 1px solid #343a40;
}
.sidebar-footer button,
.sidebar-footer a {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    margin-top: 0.5rem;
    border-radius: 6px;
    border: none;
    background: none;
    color: var(--sidebar-text);
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-family: var(--font-family);
    text-decoration: none;
}
.sidebar-footer button:hover,
.sidebar-footer a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--sidebar-text-hover);
}
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}
.main-header {
    background-color: var(--card-bg-color);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}
.main-header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--heading-color);
}
.content-area {
    padding: 1.5rem;
    flex-grow: 1;
}
.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-right: 1rem;
    color: var(--heading-color);
}
.hamburger-btn .material-symbols-outlined {
    font-size: 2rem;
    vertical-align: middle;
}
.card {
    background-color: var(--card-bg-color);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
}
.grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}
.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}
.stat-card .icon {
    font-size: 2.5rem;
    padding: 1rem;
    border-radius: 50%;
    display: flex;
}
.stat-card .icon.pengunjung {
    background-color: #e3f2fd;
    color: #1e88e5;
}
.stat-card .icon.produk {
    background-color: #ede7f6;
    color: #5e35b1;
}
.stat-card .icon.penjualan {
    background-color: #e8f5e9;
    color: #43a047;
}
.stat-card .icon.pendapatan {
    background-color: var(--primary-light);
    color: var(--primary-color);
}
.stat-card-info h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    color: var(--text-color);
}
.stat-card-info p {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    color: var(--heading-color);
}
.chart-container {
    position: relative;
    height: 350px;
    width: 100%;
}
.table-container {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
}
th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}
th {
    background-color: #f8f9fa;
    font-weight: 600;
}
.input-group {
    margin-bottom: 1.25rem;
}
.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}
.input-group input,
.input-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}
.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}
button,
.btn-primary,
.btn-secondary {
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-primary {
    background-color: var(--primary-color);
    color: var(--heading-color);
}
.btn-primary:hover {
    background-color: #c8a230;
    transform: translateY(-2px);
}
.btn-secondary {
    background-color: #6c757d;
    color: #fff;
}
.form-buttons {
    display: flex;
    gap: 1rem;
}
.status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}
.status.pending {
    background-color: var(--pending-bg);
    color: var(--pending-text);
}
.status.selesai {
    background-color: var(--selesai-bg);
    color: var(--selesai-text);
}
.inline-edit {
    border: 1px solid transparent;
    background-color: transparent;
    border-radius: 4px;
    padding: 5px;
    width: 100%;
}
.inline-edit:focus {
    border: 1px solid var(--primary-color);
    background-color: #fff;
}
.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
}
.action-btn:hover {
    color: var(--heading-color);
}
.delete-btn:hover {
    color: var(--error-color);
}
.btn-sm {
    padding: 6px 10px;
    font-size: 0.9rem;
    margin-right: 5px;
}
.image-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  flex-wrap: nowrap;
}

.image-item img {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
}

.single-line {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background: var(--surface-2, #fafafa);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
  font-size: 0.9rem;
}

.single-line a {
  display: inline-block;
  white-space: nowrap;
  text-decoration: none;
  color: var(--link-color, #1976d2);
  user-select: text;
}

.image-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-btn {
  padding: 0.35rem 0.75rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: var(--accent-color, #1976d2);
  color: #fff;
  font-size: 0.85rem;
  transition: background 0.2s ease;
}

.copy-btn:hover {
  background: #1259a8;
}

.copy-btn:active {
  transform: translateY(1px);
}

.delete-btn {
  background: transparent;
  border: none;
  color: #d32f2f;
  cursor: pointer;
  font-size: 1.3rem;
  padding: 0.25rem;
  border-radius: 6px;
}

.delete-btn:hover {
  background: rgba(211, 47, 47, 0.08);
}

.image-preview {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  background: var(--surface-2, #f9f9f9);
  border: 1px solid #ddd;
}

.image-preview img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
}

.image-preview span {
  font-size: 0.9rem;
  color: #444;
  flex: 1;
  word-break: break-all;
}

.hidden {
  display: none !important;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 1.25rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  margin-bottom: 1.25rem;
}

.card h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: #333;
}

.upload-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.file-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-2, #f5f5f5);
  border: 2px dashed #bbb;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
  flex: 1 1 auto;
  justify-content: center;
}

.file-label:hover {
  border-color: var(--accent-color, #1976d2);
  background: #f0f8ff;
}

.file-label .material-symbols-outlined {
  font-size: 1.4rem;
  color: var(--accent-color, #1976d2);
}

.file-label span {
  font-size: 0.95rem;
  color: #555;
}

.btn-primary {
  background: var(--accent-color, #1976d2);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background 0.25s ease;
}

.btn-primary:hover {
  background: #1259a8;
}
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 1000;
        transform: translateX(calc(-1 * var(--sidebar-width)));
    }
    .sidebar.show {
        transform: translateX(0);
    }
    .hamburger-btn {
        display: block;
    }
    .overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    body.sidebar-open .overlay {
        display: block;
    }
}
@media (min-width: 768px) {
    .grid-layout {
        grid-template-columns: 400px 1fr;
    }
    .content-area {
        padding: 2rem;
    }
}

@media (max-width: 600px) {
  .image-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .image-item img {
    width: 100%;
    max-width: 240px;
    height: auto;
  }

  .single-line {
    width: 100%;
  }

  .image-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .upload-form {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-primary {
    width: 100%;
  }

  .file-label {
    width: 100%;
  }
}
