/* ========== AWS44 Admin CSS ========== */

:root {
    --admin-bg: #1a1d23;
    --admin-sidebar: #13151a;
    --admin-card: #22252d;
    --admin-border: rgba(255,255,255,0.08);
    --brown: #A55F46;
    --brown-hover: #B87258;
    --text: #FFFFFF;
    --text-sec: #9CA3AF;
    --green: #22c55e;
    --red: #ef4444;
    --font: 'Montserrat', sans-serif;
}

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

body { font-family: var(--font); background: var(--admin-bg); color: var(--text); }

a { text-decoration: none; color: inherit; }

/* ===== LOGIN ===== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container {
    background: var(--admin-card);
    padding: 40px;
    border-radius: 12px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo h1 { font-size: 2rem; color: var(--brown); }
.login-logo p { color: var(--text-sec); font-size: 0.85rem; }

.back-link {
    display: block;
    text-align: center;
    margin-top: 20px;
    color: var(--text-sec);
    font-size: 0.85rem;
    transition: color 0.3s;
}
.back-link:hover { color: var(--brown); }

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

.sidebar {
    width: 240px;
    background: var(--admin-sidebar);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--admin-border);
}

.sidebar-header h2 { font-size: 1.2rem; }
.sidebar-header h2 a { color: var(--brown); }
.sidebar-header .version { font-size: 0.7rem; color: var(--text-sec); }

.sidebar-nav { flex: 1; padding: 10px 0; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--text-sec);
    font-size: 0.85rem;
    transition: all 0.2s;
}

.nav-item:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-item.active { color: var(--brown); background: rgba(165,95,70,0.1); border-right: 3px solid var(--brown); }
.nav-item i { width: 18px; text-align: center; }

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--admin-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-footer a {
    font-size: 0.8rem;
    color: var(--text-sec);
    transition: color 0.2s;
}
.sidebar-footer a:hover { color: var(--brown); }

.admin-main {
    flex: 1;
    margin-left: 240px;
    min-height: 100vh;
}

.admin-header {
    padding: 20px 30px;
    background: var(--admin-card);
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 { font-size: 1.4rem; font-weight: 600; }
.admin-user { color: var(--text-sec); font-size: 0.85rem; }

.admin-content { padding: 30px; }

/* ===== CARDS ===== */
.card {
    background: var(--admin-card);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--admin-border);
}

.card h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h3 .btn { margin-left: auto; }

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--admin-card);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--admin-border);
}

.stat-icon { font-size: 1.5rem; color: var(--brown); margin-bottom: 8px; }
.stat-value { font-size: 2rem; font-weight: 700; }
.stat-label { font-size: 0.8rem; color: var(--text-sec); margin-top: 4px; }

/* ===== CHART ===== */
.simple-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 200px;
    padding: 10px 0;
}

.chart-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.chart-bar {
    width: 100%;
    max-width: 40px;
    background: var(--brown);
    border-radius: 3px 3px 0 0;
    min-height: 2px;
    transition: height 0.3s;
}

.chart-value { font-size: 0.65rem; color: var(--text-sec); margin-top: 4px; }
.chart-label { font-size: 0.6rem; color: var(--text-sec); }

/* ===== TABLES ===== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-sec);
    border-bottom: 1px solid var(--admin-border);
}

.table td {
    padding: 10px 12px;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--admin-border);
    vertical-align: middle;
}

.table tr:hover { background: rgba(255,255,255,0.02); }
.table tr.unread { background: rgba(165,95,70,0.08); }
.table tr.unread td { font-weight: 600; }
.table-compact td, .table-compact th { padding: 6px 8px; font-size: 0.8rem; }

.actions { white-space: nowrap; display: flex; gap: 6px; }

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
}
.badge-green { background: rgba(34,197,94,0.15); color: var(--green); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--red); }
.badge-blue { background: rgba(59,130,246,0.15); color: #60a5fa; }

/* ===== FORMS ===== */
.admin-form { max-width: 900px; }

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-sec);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: border-color 0.3s;
}

.form-group select { cursor: pointer; }

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brown);
}

.form-group select option { background: var(--admin-bg); color: var(--text); }
.form-group textarea { resize: vertical; min-height: 100px; }
.code-editor { font-family: 'Courier New', monospace; font-size: 0.85rem; }

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--admin-border);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-transform: none !important;
}

.checkbox-label input[type="checkbox"] { width: auto; }

.input-compact {
    padding: 6px 10px !important;
    font-size: 0.8rem !important;
}

.file-input { padding: 8px !important; }

/* ===== IMAGE DE FOND ===== */
.bg-upload-group {
    background: rgba(255,255,255,0.03);
    border: 1px dashed var(--admin-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.bg-images-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.bg-image-item {
    position: relative;
    width: 140px;
    height: 90px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--admin-border);
}

.bg-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bg-image-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(239,68,68,0.9);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    text-decoration: none;
    transition: background 0.2s;
}

.bg-image-delete:hover { background: #ef4444; }

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--brown);
    color: var(--text);
    border: none;
    border-radius: 6px;
    font-family: var(--font);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.btn:hover { background: var(--brown-hover); }

.btn-secondary { background: rgba(255,255,255,0.1); }
.btn-secondary:hover { background: rgba(255,255,255,0.15); }

.btn-danger { background: var(--red); }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 6px 12px; font-size: 0.75rem; }
.btn-full { width: 100%; justify-content: center; }

/* ===== TOOLBAR ===== */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar-select {
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--admin-border);
    padding-bottom: 0;
}

.tab {
    padding: 10px 18px;
    font-size: 0.82rem;
    color: var(--text-sec);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--brown); border-bottom-color: var(--brown); }

/* ===== COLORS SETTINGS ===== */
.colors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.color-item label { display: block; font-size: 0.8rem; color: var(--text-sec); margin-bottom: 6px; }

.color-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.color-input-wrap input[type="color"] {
    width: 50px;
    height: 38px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
}

.color-hex {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    color: var(--text);
    font-family: monospace;
    font-size: 0.85rem;
}

/* ===== TWO COLUMNS ===== */
.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ===== PHOTOS ADMIN ===== */
.photos-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.photo-admin-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    overflow: hidden;
}

.photo-admin-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.photo-edit-form {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.photo-edit-form input,
.photo-edit-form select {
    padding: 6px 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    color: var(--text);
    font-size: 0.8rem;
    font-family: var(--font);
}

.photo-edit-form select option { background: var(--admin-bg); color: var(--text); }

.photo-edit-row {
    display: flex;
    gap: 6px;
}

.photo-edit-row select { flex: 1; }

.photo-edit-actions {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

/* ===== UPLOAD FORM ===== */
.upload-form {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
}

.upload-form .form-group { margin-bottom: 0; }

/* ===== ADD ITEM FORM ===== */
.add-item-form {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--admin-border);
}

.add-item-form input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    color: var(--text);
    font-family: var(--font);
}

/* ===== MEDIA GRID ===== */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.media-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    overflow: hidden;
}

.media-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.media-info {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.media-name {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-meta { font-size: 0.65rem; color: var(--text-sec); }

.media-item form { padding: 0 10px 10px; }

/* ===== HOME IMAGES ===== */
.home-image-item {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--admin-border);
}

.home-image-preview {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.03);
}

.home-image-preview img { width: 100%; height: 100%; object-fit: cover; }
.no-image { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-sec); font-size: 1.5rem; }

.home-image-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; }

.home-image-fields input[type="file"],
.home-image-fields input[type="text"] {
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.85rem;
}

/* ===== ALERTS ===== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: var(--green); }
.alert-error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--red); }
.alert-info { background: rgba(59,130,246,0.1); border: 1px solid rgba(59,130,246,0.3); color: #60a5fa; }

/* ===== MESSAGE DETAIL ===== */
.message-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    color: var(--text-sec);
    font-size: 0.85rem;
}

.message-meta span { display: flex; align-items: center; gap: 6px; }

.message-body {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
}

.message-body h4 { font-size: 0.85rem; color: var(--text-sec); margin-bottom: 10px; }
.message-body p { line-height: 1.8; }

/* ===== DRAG & DROP REORDER ===== */
.sortable-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.sortable-item {
    cursor: grab;
    position: relative;
    border: 2px solid transparent;
    border-radius: 8px;
    transition: border-color 0.2s, opacity 0.2s, transform 0.2s;
    background: var(--admin-card);
    overflow: hidden;
}

.sortable-item:active { cursor: grabbing; }

.sortable-item.dragging {
    opacity: 0.4;
    border-color: var(--brown);
    transform: scale(0.95);
}

.sortable-item.drag-over {
    border-color: var(--brown);
    border-style: dashed;
}

.sortable-item .drag-handle {
    position: absolute;
    top: 6px; left: 6px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    width: 26px; height: 26px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    z-index: 2;
    pointer-events: none;
}

.sortable-item .sort-number {
    position: absolute;
    top: 6px; right: 6px;
    background: var(--brown);
    color: #fff;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 2;
}

.sortable-item img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.sortable-item .item-info {
    padding: 8px 10px;
    font-size: 0.8rem;
    color: var(--text-sec);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sortable-item .item-actions {
    padding: 0 10px 10px;
    display: flex;
    justify-content: flex-end;
}

.reorder-hint {
    color: var(--text-sec);
    font-size: 0.8rem;
    font-style: italic;
    margin-bottom: 10px;
}

/* ===== EDITEUR WYSIWYG ===== */
.editor-wrapper {
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--admin-card);
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--admin-border);
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;
    padding-right: 8px;
    border-right: 1px solid var(--admin-border);
}

.toolbar-group:last-child { border-right: none; padding-right: 0; }

.toolbar-right { margin-left: auto; border-right: none; }

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-sec);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.toolbar-btn:hover { background: rgba(255,255,255,0.08); color: var(--text); border-color: var(--admin-border); }

.toolbar-btn.color-btn { width: 28px; height: 28px; font-size: 0.8rem; }

.toolbar-toggle {
    width: auto;
    padding: 0 10px;
    gap: 6px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
}

.toolbar-toggle.active { background: var(--brown); color: #fff; border-color: var(--brown); }

.toolbar-select {
    padding: 4px 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--admin-border);
    border-radius: 4px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.8rem;
    cursor: pointer;
}

.toolbar-select option { background: var(--admin-bg); color: var(--text); }

.editor-visual {
    min-height: 350px;
    max-height: 600px;
    overflow-y: auto;
    padding: 20px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.95rem;
    line-height: 1.7;
    outline: none;
}

.editor-visual:focus { box-shadow: inset 0 0 0 2px rgba(165,95,70,0.3); }

.editor-visual h1 { font-size: 2em; color: var(--brown); margin: 16px 0 8px; }
.editor-visual h2 { font-size: 1.5em; color: var(--brown); margin: 14px 0 6px; }
.editor-visual h3 { font-size: 1.2em; color: var(--brown); margin: 12px 0 4px; }
.editor-visual h4 { font-size: 1.05em; color: var(--brown); margin: 10px 0 4px; }
.editor-visual p { margin-bottom: 10px; }
.editor-visual a { color: var(--brown); text-decoration: underline; }
.editor-visual ul, .editor-visual ol { padding-left: 24px; margin: 8px 0; }
.editor-visual blockquote { border-left: 3px solid var(--brown); padding: 10px 16px; margin: 10px 0; opacity: 0.8; font-style: italic; }
.editor-visual img { max-width: 100%; height: auto; border-radius: 6px; margin: 8px 0; cursor: pointer; }
.editor-visual strong { font-weight: 700; }

.editor-html {
    width: 100%;
    min-height: 350px;
    max-height: 600px;
    padding: 16px;
    background: #0d1117;
    color: #c9d1d9;
    border: none;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
}

/* Modal upload image */
.editor-upload-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-upload-inner {
    background: var(--admin-card);
    padding: 30px;
    border-radius: 12px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.editor-upload-inner h4 { font-size: 1.1rem; margin-bottom: 16px; }

.var-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.var-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    color: var(--text);
    font-family: var(--font);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}

.var-item:hover {
    background: rgba(165,95,70,0.15);
    border-color: var(--brown);
}

.var-item code {
    font-size: 0.78rem;
    color: var(--brown);
    background: rgba(0,0,0,0.2);
    padding: 2px 6px;
    border-radius: 3px;
}

.editor-upload-inner input[type="file"],
.editor-upload-inner input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--admin-border);
    border-radius: 6px;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
}

/* ===== ADMIN HAMBURGER ===== */
.admin-hamburger {
    display: none;
    position: fixed;
    top: 12px; left: 12px;
    z-index: 10001;
    cursor: pointer;
    width: 40px; height: 40px;
    align-items: center;
    justify-content: center;
    background: var(--admin-sidebar);
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
}
.admin-hamburger span {
    display: block;
    width: 20px; height: 2px;
    background: var(--text);
    border-radius: 1px;
    transition: all 0.3s;
}
.admin-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.admin-hamburger.open span:nth-child(2) { opacity: 0; }
.admin-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .sidebar { width: 60px; }
    .sidebar-header h2, .sidebar-header .version { display: none; }
    .nav-item span { display: none; }
    .nav-item { justify-content: center; padding: 12px; }
    .sidebar-footer a span { display: none; }
    .admin-main { margin-left: 60px; }
    .admin-content { padding: 16px; }
    .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
    .two-columns { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .sidebar {
        display: flex;
        position: fixed;
        left: -280px;
        top: 0;
        width: 260px;
        height: 100%;
        z-index: 10000;
        transition: left 0.3s;
        box-shadow: none;
    }
    .sidebar.open {
        left: 0;
        box-shadow: 4px 0 20px rgba(0,0,0,0.5);
    }
    .sidebar-header h2, .sidebar-header .version { display: block; }
    .nav-item span { display: inline; }
    .nav-item { justify-content: flex-start; padding: 10px 20px; }
    .sidebar-footer a { font-size: 0.8rem; }
    .admin-main { margin-left: 0; }
    .admin-content { padding: 12px; }
    .admin-header { padding: 14px 16px; padding-left: 56px; }
    .admin-header h1 { font-size: 1.1rem; }

    /* Hamburger admin */
    .admin-hamburger {
        display: flex !important;
    }

    /* Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 9999;
    }
    .sidebar-overlay.active { display: block; }

    .stats-grid { grid-template-columns: 1fr; }
    .sortable-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
