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

:root {
    --sidebar-bg: #1a1a1a;
    --sidebar-text: #b0b0b0;
    --sidebar-active: #ffffff;
    --sidebar-hover: #2a2a2a;
    --sidebar-active-bg: #333333;
    --bg: #f5f5f5;
    --bg-white: #ffffff;
    --border: #e0e0e0;
    --text: #1a1a1a;
    --text-secondary: #666666;
    --text-muted: #999999;
    --accent: #333333;
    --accent-hover: #555555;
    --green: #22c55e;
    --green-bg: rgba(34, 197, 94, 0.1);
    --orange: #f59e0b;
    --orange-bg: rgba(245, 158, 11, 0.1);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.1);
    --blue: #3b82f6;
    --blue-bg: rgba(59, 130, 246, 0.1);
    --radius: 8px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --transition: 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
}

/* ==================== LOGIN SCREEN ==================== */
.login-screen {
    position: fixed;
    inset: 0;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5000;
}

.login-card {
    background: #242424;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 48px 40px 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-icon {
    margin-bottom: 20px;
}

.login-icon svg {
    width: 40px;
    height: 40px;
    color: #888;
}

.login-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 32px;
}

.login-field {
    margin-bottom: 16px;
}

.login-field input {
    width: 100%;
    padding: 12px 16px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition);
}

.login-field input:focus {
    border-color: #666;
}

.login-field input::placeholder {
    color: #666;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #fff;
    color: #1a1a1a;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
}

.login-btn:hover {
    background: #e0e0e0;
}

.login-error {
    color: var(--red);
    font-size: 13px;
    margin-top: 12px;
    min-height: 18px;
}

/* ==================== APP LAYOUT ==================== */
.app {
    display: flex;
    height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: 220px;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 24px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-sub {
    font-size: 11px;
    font-weight: 500;
    color: var(--sidebar-text);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.brand-main {
    font-size: 18px;
    font-weight: 800;
    color: var(--sidebar-active);
    letter-spacing: 0.5px;
}

.nav-menu {
    list-style: none;
    padding: 8px 10px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--sidebar-text);
    transition: all var(--transition);
    margin-bottom: 2px;
    font-size: 14px;
    font-weight: 500;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-active);
}

.nav-item.active {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active);
}

.nav-parent {
    user-select: none;
}

.nav-parent .nav-chevron {
    width: 14px;
    height: 14px;
    margin-left: auto;
    transition: transform 0.2s;
}

.nav-parent.open .nav-chevron {
    transform: rotate(180deg);
}

.nav-submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    padding-left: 16px;
}

.nav-submenu.open {
    max-height: 120px;
}

.nav-sub-item {
    font-size: 13px !important;
    padding: 8px 14px !important;
}

.sidebar-footer {
    padding: 16px 10px;
    border-top: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.sidebar-link:hover {
    color: var(--sidebar-active);
    background: var(--sidebar-hover);
}

.sidebar-link svg {
    width: 16px;
    height: 16px;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

/* ==================== PAGES ==================== */
.page {
    display: none;
    padding: 40px 48px;
    overflow-y: auto;
    flex: 1;
}

.page.active {
    display: block;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--text);
    margin-bottom: 6px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 15px;
}

.page-actions {
    margin-top: 16px;
    display: flex;
    gap: 10px;
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

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

.btn-secondary {
    background: var(--bg-white);
    color: var(--text);
    border: 1px solid var(--border);
}

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

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border: 1px solid transparent;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ==================== STAT CARDS (3 columns) ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.stat-icon {
    color: var(--text-muted);
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-number {
    font-size: 42px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 12px;
}

.stat-manage {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.stat-manage:hover {
    color: var(--text);
}

/* ==================== DASHBOARD BOTTOM ROW ==================== */
.dashboard-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-header h3 {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text);
}

.card-link {
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition);
}

.card-link:hover {
    color: var(--text);
}

.empty-text {
    color: var(--text-muted);
    font-size: 14px;
}

.tips-list {
    list-style: disc;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tips-list li {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ==================== REVIEWS ==================== */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.review-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    box-shadow: var(--shadow);
}

.review-content {
    flex: 1;
}

.review-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.review-name {
    font-size: 16px;
    font-weight: 700;
}

.review-stars {
    color: #f59e0b;
    font-size: 16px;
    letter-spacing: 2px;
}

.review-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.review-date {
    font-size: 12px;
    color: var(--text-muted);
}

.review-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Star Rating Input */
.star-rating {
    display: flex;
    gap: 4px;
}

.star-rating .star {
    font-size: 28px;
    cursor: pointer;
    color: #ddd;
    transition: color 0.15s;
}

.star-rating .star.active {
    color: #f59e0b;
}

.star-rating .star:hover,
.star-rating .star:hover ~ .star {
    color: #f59e0b;
}

/* ==================== GALLERY ==================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4/3;
    background: #e5e5e5;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-title {
    font-size: 13px;
    font-weight: 600;
}

.gallery-item-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 16px;
}

.gallery-item:hover .gallery-item-delete {
    opacity: 1;
}

/* ==================== TABLES ==================== */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.data-table th {
    background: var(--bg);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.data-table tr:hover td {
    background: #fafafa;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.empty-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 16px !important;
}

.message-cell {
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

/* ==================== FORMS ==================== */
.form-card {
    max-width: 600px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

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

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ==================== SETTINGS ==================== */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 24px;
}

.settings-card h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 15px;
}

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 520px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==================== TOAST ==================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    font-size: 14px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    min-width: 280px;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==================== DASHBOARD SUBMISSION LIST ==================== */
.dash-submission-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
}

.dash-submission-item:last-child {
    border-bottom: none;
}

.dash-submission-name {
    font-weight: 600;
    color: var(--text);
}

.dash-submission-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-bottom-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -220px;
        top: 0;
        bottom: 0;
        z-index: 200;
        transition: left var(--transition);
    }
    .sidebar.open {
        left: 0;
    }
    .page {
        padding: 20px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    .dashboard-bottom-row {
        grid-template-columns: 1fr;
    }
}
