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

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #fafafa;
    color: #222;
}

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

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #b05adf, #f06292);
    color: #fff;
    display: flex;
    flex-direction: column;
    padding: 16px 14px;
}

.sidebar-logo {
    margin-bottom: 16px;
}

.logo-main {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 2px;
}

.logo-sub {
    font-size: 12px;
    opacity: 0.9;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: auto;
    margin-top: 8px;
}

.sidebar-nav a {
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 14px;
    transition: background 0.2s, transform 0.1s;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.18);
    transform: translateX(2px);
}

.sidebar-user {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(0,0,0,0.15);
    font-size: 13px;
}

.sidebar-user-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.sidebar-user-links a {
    font-size: 12px;
    opacity: 0.9;
}

.sidebar-footer {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

#theme-toggle {
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.7);
    background: transparent;
    color: #fff;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}

.content {
    flex: 1;
    padding: 18px;
    max-width: 1100px;
    margin: 0 auto;
}

.card {
    background: #fff;
    border-radius: 14px;
    border: 1px solid #f8bbd0;
    padding: 16px 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    margin-bottom: 14px;
}

.card h1, .card h2, .card h3 {
    margin-top: 0;
}

.btn {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary {
    background: #ab47bc;
    color: #fff;
}

.btn-outline {
    background: transparent;
    color: #ab47bc;
    border: 1px solid #ab47bc;
}

.btn-primary:hover {
    background: #7b1fa2;
}

.btn-outline:hover {
    background: rgba(171,71,188,0.08);
}

.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.form-row label {
    font-size: 13px;
    margin-bottom: 4px;
}

.form-row input,
.form-row select,
.form-row textarea {
    font-size: 14px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.form-actions {
    display: flex;
    gap: 8px;
}

.alert {
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
}

.alert-error {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    color: #b71c1c;
}

.alert-success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #1b5e20;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff8e1;
    border-radius: 10px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 6px 8px;
    border-bottom: 1px solid #ffe0b2;
}

.table th {
    background: #ffe0b2;
    text-align: left;
}

.site-footer {
    border-top: 1px solid #eee;
    padding: 8px 14px;
    font-size: 12px;
    background: #fff;
}

.footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links a {
    margin-left: 10px;
    color: #666;
}

/* Dark mode */
body.theme-dark {
    background: #121212;
    color: #f5f5f5;
}

body.theme-dark .sidebar {
    background: linear-gradient(180deg, #4a148c, #880e4f);
}

body.theme-dark .card {
    background: #1e1e1e;
    border-color: #8e24aa;
    box-shadow: 0 2px 10px rgba(0,0,0,0.7);
}

body.theme-dark .table {
    background: #212121;
}

body.theme-dark .table th {
    background: #4e342e;
}

body.theme-dark .table td {
    border-bottom-color: #4e342e;
}

body.theme-dark .site-footer {
    background: #1e1e1e;
    border-top-color: #333;
}

/* Responsive: mobile -> top nav */
@media (max-width: 800px) {
    .layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        padding: 8px 10px;
    }
    .sidebar-logo {
        margin-bottom: 0;
        margin-right: 10px;
    }
    .sidebar-nav {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        margin: 0 8px;
    }
    .sidebar-user {
        display: none;
    }
    .content {
        padding: 12px;
    }
}

/* Profile cards & banner */
.profile-card {
    padding: 0;
    overflow: hidden;
}

.profile-banner {
    position: relative;
    min-height: 140px;
    border-radius: 14px 14px 0 0;
    overflow: hidden;
}

.profile-banner img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    opacity: 0.75;
}

.profile-banner-overlay {
    position: absolute;
    left: 16px;
    bottom: 10px;
    right: 16px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

.profile-banner-overlay h1 {
    margin: 0 0 4px 0;
    font-size: 22px;
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
}

.profile-body {
    display: flex;
    padding: 14px 16px 16px 16px;
    gap: 16px;
}

.profile-left {
    width: 140px;
    flex-shrink: 0;
}

.profile-right {
    flex: 1;
}

.profile-avatar {
    width: 130px;
    height: 130px;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid #f8bbd0;
    background: #fff;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #777;
}

/* Galerie */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.gallery-item {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #f8bbd0;
    background: #fff;
    font-size: 12px;
}

.gallery-thumb {
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-meta {
    padding: 4px 6px 6px 6px;
}

.gallery-date {
    color: #888;
    font-size: 11px;
}

/* Hot or Not layout tweaks */
@media (max-width: 700px) {
    .profile-body {
        flex-direction: column;
    }
}
