:root {
    --bg: #f4f6f9;
    --card-bg: #ffffff;
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --danger: #e11d48;
    --danger-dark: #be123c;
    --success: #16a34a;
    --text: #1f2430;
    --muted: #6b7280;
    --border: #e5e7eb;
    --radius: 12px;
    --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

/* ---------- Auth pages (login/register/install) ---------- */
/* .auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    padding: 20px;
}

.auth-card {
    background: var(--card-bg);
    width: 100%;
    max-width: 400px;
    padding: 36px 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.auth-card h1 {
    margin: 0 0 6px;
    font-size: 24px;
}

.auth-card p.subtitle {
    color: var(--muted);
    margin: 0 0 24px;
    font-size: 14px;
}

.auth-card label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin: 14px 0 6px;
    color: var(--muted);
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
}

.auth-card input:focus { border-color: var(--primary); } */
body.auth-page{
    margin:0;
    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
    font-family:'Segoe UI',sans-serif;

    background:
    linear-gradient(rgba(139, 233, 81, 0.35),rgba(223, 191, 136, 0.35)),
    url("assets/images/travel-bg.jpg") center/cover no-repeat;

    position:relative;
}

.auth-card{
    width:430px;
    max-width:95%;
    background:rgba(255,255,255,.96);
    backdrop-filter:blur(18px);
    border-radius:20px;
    padding:40px;
    box-shadow:0 25px 60px rgba(0,0,0,.25);
}

.auth-card h1{
    margin:0;
    color:#0F172A;
    text-align:center;
    font-size:32px;
    font-weight:700;
}

.subtitle{
    text-align:center;
    color:#64748B;
    margin-bottom:30px;
}

.role-switch{
    display:flex;
    background:#E2F8F8;
    border-radius:15px;
    padding:5px;
    margin-bottom:25px;
}

.role-switch input{
    display:none;
}

.role-switch label{
    flex:1;
    text-align:center;
    padding:13px;
    border-radius:12px;
    cursor:pointer;
    font-weight:600;
    transition:.35s;
    color:#0F172A;
}

.role-switch label:hover{
    background:#D5F3F3;
}

.role-switch input:checked+label{
    background:linear-gradient(135deg,#0EA5E9,#14B8A6);
    color:#fff;
    box-shadow:0 10px 25px rgba(20,184,166,.35);
}

label{
    display:block;
    margin:15px 0 8px;
    font-weight:600;
    color:#334155;
}

input{
    width:100%;
    padding:14px 16px;
    border-radius:12px;
    border:1px solid #CBD5E1;
    outline:none;
    transition:.3s;
    font-size:15px;
    box-sizing:border-box;
}

input:focus{
    border-color:#14B8A6;
    box-shadow:0 0 0 4px rgba(20,184,166,.18);
}

.btn{
    width:100%;
    margin-top:25px;
    border:none;
    border-radius:14px;
    padding:15px;
    background:linear-gradient(135deg,#0EA5E9,#14B8A6);
    color:#fff;
    font-size:16px;
    font-weight:700;
    cursor:pointer;
    transition:.35s;
}

.btn:hover{
    transform:translateY(-2px);
    box-shadow:0 15px 30px rgba(20,184,166,.35);
}

.alert{
    border-radius:12px;
    padding:12px 15px;
    margin-bottom:18px;
}

.alert-success{
    background:#DCFCE7;
    color:#166534;
}

.alert-error{
    background:#FEE2E2;
    color:#991B1B;
}

.auth-footer{
    margin-top:25px;
    text-align:center;
    color:#64748B;
}

.auth-footer a{
    color:#0EA5E9;
    text-decoration:none;
    font-weight:700;
}

.auth-footer a:hover{
    color:#14B8A6;
}

@media(max-width:500px){

.auth-card{
    padding:28px;
}

.auth-card h1{
    font-size:26px;
}

}
.btn {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    text-align: center;
    transition: background .15s;
}
.btn:hover { background: var(--primary-dark); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-dark); }
.btn-sm { padding: 6px 12px; font-size: 13px; margin-top: 0; }
.btn-secondary { background: #6b7280; }
.btn-secondary:hover { background: #4b5563; }
.btn-block { display: block; width: 100%; }

.auth-footer {
    margin-top: 18px;
    font-size: 13px;
    text-align: center;
    color: var(--muted);
}

.alert {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 10px;
}
.alert-error { background: #fee2e2; color: #b91c1c; }
.alert-success { background: #dcfce7; color: #166534; }

/* ---------- App shell (dashboards) ---------- */
.topbar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar .brand {
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.topbar .brand .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--primary);
    display: inline-block;
}

.topbar .user-info {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: var(--muted);
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.badge-admin { background: #ede9fe; color: #6d28d9; }
.badge-user { background: #e0f2fe; color: #0369a1; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-blocked { background: #fee2e2; color: #b91c1c; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-header h2 { margin: 0; font-size: 20px; }
.page-header p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 24px;
}

/* Upload form */
.upload-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.upload-form .full { grid-column: 1 / -1; }
.upload-form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
    display: block;
}
.upload-form input[type="text"],
.upload-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}
.upload-form textarea { resize: vertical; min-height: 70px; }

.file-drop {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.file-drop.dragover { border-color: var(--primary); background: #eef2ff; }
.file-drop img { max-height: 120px; margin-top: 10px; border-radius: 8px; }

@media (max-width: 640px) {
    .upload-form { grid-template-columns: 1fr; }
}

/* Grid of photo cards */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.photo-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}
.photo-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #eee;
}
.photo-card .body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; }
.photo-card h4 { margin: 0 0 4px; font-size: 15px; }
.photo-card p { margin: 0; font-size: 13px; color: var(--muted); flex: 1; }
.photo-card .meta { font-size: 11px; color: #9ca3af; margin-top: 8px; }
.photo-card .actions { display: flex; gap: 8px; margin-top: 10px; }
.photo-card .owner { font-size: 11px; color: var(--primary); font-weight: 600; margin-top: 6px; }

.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 40px 20px;
    font-size: 14px;
}

/* Table (admin user management) */
table.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
table.data-table th, table.data-table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
}
table.data-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
table.data-table tr:hover { background: #fafafa; }
table.data-table .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
}
.modal h3 { margin-top: 0; }
.modal label {
    font-size: 13px; font-weight: 600; color: var(--muted);
    display: block; margin: 12px 0 6px;
}
.modal input[type="text"], .modal input[type="email"], .modal input[type="password"], .modal select, .modal textarea {
    width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #111827;
    color: #fff;
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 13px;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity .2s, transform .2s;
    z-index: 200;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

.spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    display: inline-block;
    animation: spin .7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tabs { display: flex; gap: 8px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.tabs button {
    background: none; border: none; padding: 10px 4px; margin-right: 18px;
    font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
    border-bottom: 2px solid transparent;
}
.tabs button.active { color: var(--primary); border-color: var(--primary); }
