/* Hoppy Trails Admin Theme — colors from main-logo.png */
:root {
    --primary: #2d4c1e;
    --primary-dark: #1e3314;
    --primary-light: #3b5323;
    --accent: #d4920a;
    --accent-hover: #e5a024;
    --accent-light: #ffb81c;
    --cream: #f5f0e6;
    --cream-dark: #e8dfd0;
    --text-dark: #2c2416;
    --text-muted: #6b6358;
    --white: #fffdf8;
    --danger: #c0392b;
    --success: #6b8e23;
    --warning: #d4920a;
    --sidebar-width: 252px;
    --drawer-bg: #f7f6f3;
    --drawer-border: #ebe8e2;
    --drawer-text: #8a8f98;
    --drawer-text-hover: #3d4a3a;
    --radius: 10px;
    --radius-nav: 12px;
    --shadow: 0 2px 12px rgba(45, 76, 30, 0.08);
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--cream);
    color: var(--text-dark);
    line-height: 1.5;
    min-height: 100vh;
}

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    padding: 1.5rem;
}

.login-card {
    background: var(--white);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    text-align: center;
}

.login-logo {
    width: 140px;
    height: 140px;
    object-fit: contain;
    margin: 0 auto 1rem;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.login-card h1 {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.login-card .tagline {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 2rem;
}

/* Layout */
.admin-layout { display: flex; min-height: 100vh; background: var(--cream); }

/* Light drawer sidebar */
.drawer {
    width: var(--sidebar-width);
    background: var(--drawer-bg);
    border-right: 1px solid var(--drawer-border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.drawer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1.25rem 1.25rem;
}

.drawer-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
}

.drawer-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.drawer-brand-text strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
}

.drawer-brand-text span {
    font-size: 0.72rem;
    color: var(--drawer-text);
    font-weight: 500;
}

.drawer-nav {
    flex: 1;
    padding: 0.5rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 1rem;
    color: var(--drawer-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--radius-nav);
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.drawer-link .nav-svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
}

.drawer-link:hover {
    background: rgba(45, 76, 30, 0.07);
    color: var(--drawer-text-hover);
}

.drawer-link.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(45, 76, 30, 0.28);
}

.drawer-link.active .nav-svg {
    stroke: #fff;
}

.drawer-footer {
    padding: 1rem 0.85rem 1.25rem;
    border-top: 1px solid var(--drawer-border);
    margin-top: auto;
}

.drawer-user {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0 0.35rem 0.85rem;
}

.drawer-avatar,
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
}

.user-avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--cream-dark);
}

.drawer-user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
}

.drawer-user-role {
    font-size: 0.72rem;
    color: var(--drawer-text);
}

.drawer-logout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.65rem 1rem;
    border: none;
    background: transparent;
    color: var(--drawer-text);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-nav);
    cursor: pointer;
    transition: background 0.18s, color 0.18s;
    font-family: inherit;
}

.drawer-logout .nav-svg {
    width: 20px;
    height: 20px;
}

.drawer-logout:hover {
    background: rgba(192, 57, 43, 0.08);
    color: var(--danger);
}

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

.topbar {
    background: var(--white);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--cream-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow);
}

.topbar h1 {
    font-size: 1.35rem;
    color: var(--primary);
    font-weight: 600;
}

.content-area { padding: 2rem; }

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--cream-dark);
    overflow: hidden;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--cream-dark);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to right, var(--white), var(--cream));
}

.card-header h3 {
    font-size: 1rem;
    color: var(--primary);
    font-weight: 600;
}

.card-body { padding: 1.5rem; }

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--cream-dark);
    border-top: 3px solid var(--accent);
}

.stat-card.green { border-top-color: var(--primary); }
.stat-card.amber { border-top-color: var(--accent); }
.stat-card.olive { border-top-color: var(--success); }

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 0.25rem;
}

/* Tables */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

thead th {
    background: var(--primary);
    color: var(--cream);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--cream-dark);
    vertical-align: middle;
}

tbody tr:hover { background: rgba(45, 76, 30, 0.03); }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-pending { background: #fff3cd; color: #856404; }
.badge-approved { background: #d4edda; color: #155724; }
.badge-rejected { background: #f8d7da; color: #721c24; }
.badge-banned { background: #343a40; color: #fff; }
.badge-active { background: #d4edda; color: #155724; }
.badge-inactive { background: #e2e3e5; color: #383d41; }
.badge-flagged { background: #fff3cd; color: #856404; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: var(--primary-dark);
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
    background: var(--primary);
    color: var(--cream);
}
.btn-secondary:hover { background: var(--primary-light); }

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

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover { background: var(--primary); color: var(--cream); }

.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.8rem; }

.btn-group { display: flex; gap: 0.4rem; flex-wrap: wrap; }

/* Forms */
.form-group { margin-bottom: 1.25rem; }

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--cream-dark);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--white);
    color: var(--text-dark);
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(212, 146, 10, 0.15);
}

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

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

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-check input { width: 1rem; height: 1rem; accent-color: var(--accent); }

/* Alerts */
.alert {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 0.25rem;
    list-style: none;
    margin-top: 1.5rem;
    justify-content: center;
}

.pagination a, .pagination span {
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--primary);
    border: 1px solid var(--cream-dark);
}

.pagination .active span {
    background: var(--accent);
    color: var(--primary-dark);
    border-color: var(--accent);
    font-weight: 600;
}

.pagination a:hover { background: var(--cream); }

/* Filters bar */
.filters {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
    align-items: flex-end;
}

.filters .form-control { width: auto; min-width: 180px; }

/* User detail */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.detail-item { margin-bottom: 1rem; }
.detail-item .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}
.detail-item .value { font-size: 0.95rem; font-weight: 500; margin-top: 0.15rem; }

.photo-preview {
    max-width: 200px;
    border-radius: var(--radius);
    border: 2px solid var(--cream-dark);
}

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

.modal-form {
    background: var(--cream);
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-top: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.location-picker {
    margin-bottom: 1.25rem;
}

.restaurant-map {
    width: 100%;
    height: 320px;
    border-radius: var(--radius);
    border: 1px solid var(--cream-dark);
    margin-bottom: 0.5rem;
    z-index: 1;
}

.location-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.location-search-wrap {
    position: relative;
}

.location-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--cream-dark);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-height: 220px;
    overflow-y: auto;
    z-index: 1000;
}

.location-search-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    text-align: left;
    font: inherit;
    color: var(--text-dark);
    cursor: pointer;
    border-bottom: 1px solid var(--cream-dark);
}

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

.location-search-item:hover {
    background: var(--cream);
}

.location-search-empty {
    cursor: default;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .drawer { width: 100%; position: relative; }
    .main-content { margin-left: 0; }
    .admin-layout { flex-direction: column; }
    .detail-grid, .form-row, .grid-2 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
