:root {
    --adm-bg: #f0eeea;
    --adm-card: #fff;
    --adm-text: #1c1c1c;
    --adm-muted: #777;
    --adm-border: #e0dcd4;
    --adm-accent: #8b7355;
    --adm-green: #3d8c5c;
    --adm-red: #c0392b;
    --adm-radius: 10px;
    --adm-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--adm-font);
    background: var(--adm-bg);
    color: var(--adm-text);
    line-height: 1.5;
    min-height: 100vh;
}

.hidden { display: none !important; }

/* Login */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: var(--adm-card);
    padding: 40px;
    border-radius: var(--adm-radius);
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    text-align: center;
}

.login-box h1 {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.login-box p {
    color: var(--adm-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
}

.login-box input {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--adm-border);
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 16px;
}

.login-error {
    color: var(--adm-red);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

/* Layout */
.admin-app { min-height: 100vh; display: flex; flex-direction: column; }

.admin-topbar {
    background: var(--adm-card);
    border-bottom: 1px solid var(--adm-border);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 50;
    flex-wrap: wrap;
}

.admin-topbar h1 { font-size: 1.1rem; font-weight: 500; }

.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.admin-body { display: flex; flex: 1; }

.admin-sidebar {
    width: 220px;
    background: var(--adm-card);
    border-right: 1px solid var(--adm-border);
    padding: 16px 0;
    flex-shrink: 0;
}

.admin-sidebar button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 0.92rem;
    cursor: pointer;
    color: var(--adm-muted);
    transition: background 0.15s;
}

.admin-sidebar button:hover { background: var(--adm-bg); color: var(--adm-text); }
.admin-sidebar button.active {
    background: var(--adm-bg);
    color: var(--adm-text);
    font-weight: 500;
    border-right: 3px solid var(--adm-accent);
}

.admin-content {
    flex: 1;
    padding: 24px;
    max-width: 900px;
}

/* Cards */
.card {
    background: var(--adm-card);
    border-radius: var(--adm-radius);
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--adm-border);
}

.card h2 {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--adm-border);
}

.card h3 {
    font-size: 0.95rem;
    margin: 20px 0 12px;
    color: var(--adm-accent);
}

/* Forms */
.field { margin-bottom: 16px; }

.field label {
    display: block;
    font-size: 0.82rem;
    color: var(--adm-muted);
    margin-bottom: 6px;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--adm-border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}

.field textarea { min-height: 90px; resize: vertical; }

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.field-hint {
    font-size: 0.78rem;
    color: var(--adm-muted);
    margin-top: 4px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 0.88rem;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}

.btn:hover { opacity: 0.88; }
.btn-primary { background: var(--adm-text); color: #fff; }
.btn-success { background: var(--adm-green); color: #fff; }
.btn-outline { background: #fff; color: var(--adm-text); border: 1px solid var(--adm-border); }
.btn-danger { background: var(--adm-red); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--adm-text);
    color: #fff;
    padding: 14px 22px;
    border-radius: 8px;
    font-size: 0.9rem;
    z-index: 200;
    animation: fadeIn 0.3s;
}

.toast.error { background: var(--adm-red); }
.toast.success { background: var(--adm-green); }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Portfolio grid */
.folder-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.folder-tab {
    padding: 8px 14px;
    border: 1px solid var(--adm-border);
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
}

.folder-tab.active {
    background: var(--adm-text);
    color: #fff;
    border-color: var(--adm-text);
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.media-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    background: #eee;
}

.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-item .del-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0,0,0,0.65);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.upload-zone {
    border: 2px dashed var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    margin-top: 12px;
}

.upload-zone:hover { border-color: var(--adm-accent); }
.upload-zone input { display: none; }

.preview-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--adm-border);
    margin-top: 8px;
}

/* Package cards */
.package-card {
    border: 1px solid var(--adm-border);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.package-card .pkg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.feature-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.feature-row input { flex: 1; }

.status-bar {
    background: #fff8e6;
    border: 1px solid #f0d78c;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    color: #7a6520;
}

@media (max-width: 768px) {
    .admin-body { flex-direction: column; }
    .admin-sidebar {
        width: 100%;
        display: flex;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid var(--adm-border);
        padding: 8px;
    }
    .admin-sidebar button {
        white-space: nowrap;
        padding: 8px 14px;
        border-radius: 20px;
        width: auto;
        border-right: none;
    }
    .admin-sidebar button.active { border-right: none; background: var(--adm-text); color: #fff; }
    .field-row { grid-template-columns: 1fr; }
}
