/* ============================================
   Harmoni Trekking Sentul — Admin Dashboard
   ============================================ */

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

:root {
    --green-500: #24704a;
    --green-400: #37865e;
    --green-100: #e7f2eb;
    --red:     #dc4c4c;
    --red-bg:  #fef2f2;
    --earth-900: #14281e;
    --earth-800: #1e3b2c;
    --earth-100: #eef3f0;
    --cream:   #f4f6f5;
    --white:   #ffffff;
    --text:    #213029;
    --text-dim:#6b7871;
    --border:  #dce4df;
    --red:     #dc4c4c;
    --red-bg:  #fef2f2;
    --amber:   #d97706;
    --amber-bg:#fef3c7;
    --purple:  #7c3aed;
    --purple-bg:#ede9fe;
    --radius:  8px;
    --shadow:  0 5px 18px rgba(18,40,29,.05);
    --font:    'Inter', system-ui, sans-serif;
    --font-display: 'Playfair Display', Georgia, serif;
    --transition: .2s ease;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--cream);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; }
input, textarea, select { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    min-height: 40px; padding: 8px 16px; border-radius: 6px;
    font-size: .85rem; font-weight: 600;
    transition: var(--transition); white-space: nowrap;
}
.btn-primary { background: var(--earth-800); color: var(--cream); }
.btn-primary:hover { background: var(--earth-900); }
.btn-outline { background: transparent; color: var(--text-dim); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--earth-800); color: var(--earth-800); }
.btn-sm { min-height: 34px; padding: 5px 12px; font-size: .78rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-danger { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #b91c1c; }
.btn-icon {
    width: 34px; height: 34px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1rem; background: transparent; transition: var(--transition);
}
.btn-icon.edit { color: var(--green-500); }
.btn-icon.edit:hover { background: var(--green-100); }
.btn-icon.delete { color: var(--red); }
.btn-icon.delete:hover { background: var(--red-bg); }
.btn-icon.detail { color: #0ea5e9; }
.btn-icon.detail:hover { background: #e0f2fe; }

/* ===== LOGIN ===== */
.login-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: linear-gradient(135deg, #10271d 0%, #173d2b 55%, #2d6b4a 100%);
    display: flex; align-items: center; justify-content: center;
}
.login-overlay.hidden { display: none; }
.login-card {
    background: var(--white); border-radius: 8px;
    padding: 40px; width: 400px; max-width: 90vw;
    box-shadow: 0 24px 80px rgba(0,0,0,.3);
    text-align: center;
}
.login-brand {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-bottom: 24px; color: var(--earth-900);
}
.admin-logo-art { display: block; overflow: hidden; background: transparent url('../img/logo/logoHarmoni-removebg-preview.png') 50% 47% / 125% auto no-repeat; }
.login-brand .admin-logo-art { width: 280px; height: 95px; }
.login-card h2 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 4px; }
.login-card > p { font-size: .85rem; color: var(--text-dim); margin-bottom: 24px; }
.input-group {
    display: flex; align-items: center; gap: 10px;
    background: var(--cream); border-radius: 6px;
    padding: 0 16px; border: 1.5px solid var(--border);
    margin-bottom: 16px; transition: var(--transition);
}
.input-group:focus-within { border-color: var(--green-500); }
.input-group i { color: var(--text-dim); font-size: 1.1rem; }
.input-group input {
    flex: 1; padding: 12px 0; border: none; background: none;
    outline: none; font-size: .92rem; color: var(--text);
}
.login-hint { margin-top: 16px; font-size: .78rem; color: var(--text-dim); }
.login-hint code { background: var(--green-100); padding: 2px 8px; border-radius: 4px; color: var(--green-500); font-size: .82rem; }

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

/* Sidebar */
.admin-sidebar {
    width: 260px; background: #10271d; color: var(--white);
    border-right: 0;
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0;
    z-index: 100; transition: transform .3s ease;
}
.sidebar-brand {
    display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
    padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-brand .admin-logo-art { width: 210px; height: 71px; flex: 0 0 71px; border-radius: 5px; background-color: rgba(255,255,255,.94); }
.sidebar-brand .sidebar-panel-label { padding-left: 3px; color: rgba(255,255,255,.56); font-size: .68rem; font-weight: 600; }

.sidebar-nav { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 2px; }
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 8px;
    font-size: .85rem; font-weight: 500; color: rgba(255,255,255,.62);
    transition: var(--transition); background: none; width: 100%;
}
.sidebar-link:hover { background: rgba(255,255,255,.08); color: var(--white); }
.sidebar-link.active { background: rgba(138,199,159,.16); color: #b7e0c5; font-weight: 600; }
.sidebar-link i { font-size: 1.15rem; width: 22px; }

.sidebar-footer { padding: 12px; border-top: 1px solid rgba(255,255,255,.1); display: flex; flex-direction: column; gap: 2px; }

/* Main */
.admin-main {
    flex: 1; margin-left: 260px;
    display: flex; flex-direction: column;
    min-height: 100vh;
}
.admin-topbar {
    background: var(--white); border-bottom: 1px solid var(--border);
    padding: 14px 28px; display: flex; align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 50;
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-left h2 { font-family: var(--font-display); font-size: 1.3rem; color: var(--earth-900); }
.menu-toggle { display: none; background: none; font-size: 1.4rem; color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-time { font-size: .82rem; color: var(--text-dim); font-weight: 500; }

.admin-content { flex: 1; padding: 28px; }

/* Pages */
.page { display: none; }
.page.active { display: block; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card {
    background: var(--white); border-radius: var(--radius);
    padding: 20px 24px; display: flex; align-items: center; gap: 16px;
    box-shadow: var(--shadow); border: 1px solid var(--border);
}
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    background: var(--green-100); color: var(--green-500);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; flex-shrink: 0;
}
.stat-num { display: block; font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; color: var(--earth-900); }
.stat-label { font-size: .78rem; color: var(--text-dim); }

/* Cards */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-header h3 { font-family: var(--font-display); font-size: 1.1rem; color: var(--earth-900); }
.card-header-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-body { padding: 20px; }
.page-actions { display: flex; justify-content: flex-end; margin-bottom: 16px; }

.dashboard-hero-preview {
    min-height: 220px; border-radius: var(--radius); overflow: hidden;
    position: relative; background: #625d54 center/cover no-repeat;
    display: flex; align-items: flex-end;
}
.dashboard-hero-preview-overlay { position: absolute; inset: 0; background: rgba(26,24,20,.38); }
.dashboard-hero-preview-meta {
    position: relative; z-index: 1; color: var(--white);
    padding: 20px; display: flex; flex-direction: column; gap: 4px;
}
.dashboard-hero-preview-meta span {
    font-size: .75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; opacity: .82;
}
.dashboard-hero-preview-meta strong { font-family: var(--font-display); font-size: 1.35rem; }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; font-size: .75rem; font-weight: 600;
    color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em;
    padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: .85rem; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fdfcf8; }

.table-img { width: 52px; height: 40px; object-fit: cover; border-radius: 6px; }

.badge {
    display: inline-block; padding: 3px 10px; border-radius: 100px;
    font-size: .72rem; font-weight: 600;
}
.badge-green { background: var(--green-100); color: var(--green-500); }
.badge-amber { background: var(--amber-bg); color: var(--amber); }
.badge-purple { background: var(--purple-bg); color: var(--purple); }

.tag-preview {
    display: flex; flex-wrap: wrap; gap: 4px; max-width: 200px;
}
.tag-preview span {
    padding: 1px 8px; border-radius: 100px;
    font-size: .7rem; background: var(--green-100); color: var(--green-500);
    white-space: nowrap;
}
.tag-preview span.exclude-tag { background: var(--red-bg); color: var(--red); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row { display: flex; gap: 14px; }
.form-group { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.form-group.flex-2 { flex: 2; }
.form-group label {
    font-size: .82rem; font-weight: 600; color: var(--text);
    display: flex; align-items: center; gap: 4px;
}
.form-group small { font-size: .72rem; color: var(--text-dim); }
.form-group input, .form-group textarea, .form-group select {
    padding: 10px 14px; border-radius: 8px; border: 1.5px solid var(--border);
    background: var(--cream); font-size: .85rem; color: var(--text);
    outline: none; transition: var(--transition);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
    border-color: var(--green-400); background: var(--white);
}
.form-group textarea { resize: vertical; }

/* Tag Input */
.tag-input {
    border: 1.5px solid var(--border); border-radius: 8px;
    background: var(--cream); padding: 8px; min-height: 44px;
    transition: var(--transition);
}
.tag-input:focus-within { border-color: var(--green-400); background: var(--white); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.tag-item {
    display: flex; align-items: center; gap: 4px;
    padding: 2px 10px; border-radius: 100px;
    font-size: .78rem; font-weight: 500;
    background: var(--green-100); color: var(--green-500);
}
.tag-item.exclude-tag-item { background: var(--red-bg); color: var(--red); }
.tag-item button {
    background: none; font-size: .9rem; color: inherit;
    display: flex; align-items: center; opacity: .6; transition: var(--transition);
}
.tag-item button:hover { opacity: 1; }
.tag-add-input {
    border: none; background: none; outline: none;
    font-size: .82rem; color: var(--text); width: 100%;
    padding: 2px 0;
}
.tag-add-input::placeholder { color: var(--text-dim); }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; z-index: 5000;
    background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity .25s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
    background: var(--white); border-radius: 8px;
    width: 700px; max-width: 95vw; max-height: 85vh;
    overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.modal-sm { width: 460px; }
.modal-tour { width: 900px; }
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; background: var(--white); z-index: 1;
}
.modal-header h3 { font-family: var(--font-display); font-size: 1.2rem; color: var(--earth-900); }
.modal-close {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--cream); font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition); color: var(--text);
}
.modal-close:hover { background: var(--border); }
.modal-body { padding: 24px; }

/* Toast */
.toast {
    position: fixed; bottom: 28px; right: 28px; z-index: 9999;
    background: var(--earth-900); color: var(--white);
    padding: 12px 20px; border-radius: 6px;
    font-size: .85rem; font-weight: 500;
    box-shadow: 0 8px 30px rgba(0,0,0,.2);
    opacity: 0; transform: translateY(10px);
    transition: all .3s ease; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* Existing Images Preview */
.existing-images { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.existing-img {
    position: relative; width: 80px; height: 60px; border-radius: 8px; overflow: hidden;
    border: 2px solid var(--border);
}
.existing-img img { width: 100%; height: 100%; object-fit: cover; }
.existing-img-remove {
    position: absolute; top: 2px; right: 2px;
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(220,76,76,.9); color: #fff;
    font-size: .8rem; display: flex; align-items: center; justify-content: center;
    border: none; cursor: pointer; line-height: 1;
}

/* Detail Gallery (in simple modal) */
.detail-gallery {
    display: flex; gap: 8px; overflow-x: auto;
    margin-bottom: 16px; padding-bottom: 8px;
}
.detail-gallery img {
    width: 120px; height: 80px; object-fit: cover; border-radius: 8px;
    cursor: pointer; border: 2px solid transparent; transition: var(--transition);
    flex-shrink: 0;
}
.detail-gallery img.active, .detail-gallery img:hover { border-color: var(--green-500); }

/* File input styling */
input[type="file"] {
    padding: 8px; font-size: .82rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .menu-toggle { display: block; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .stats-grid { grid-template-columns: 1fr; }
    .form-row { flex-direction: column; }
    .admin-content { padding: 16px; }
    .topbar-right .btn span { display: none; }
}
