/* ========================================
   Parbey QR Menü - Admin Panel Styles
   Light Theme — Premium & Interactive
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #6b0f24;
    --primary-light: #8b2040;
    --primary-dark: #4a0a19;
    --primary-glow: rgba(107, 15, 36, 0.12);
    --bg: #f4f6fb;
    --bg-card: #ffffff;
    --bg-surface: #f9fafb;
    --bg-input: #ffffff;
    --text: #1e1e2f;
    --text-sec: #64748b;
    --text-muted: #94a3b8;
    --accent: #d97706;
    --accent-bg: rgba(217, 119, 6, 0.08);
    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.08);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.08);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.08);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.08);
    --border: rgba(0, 0, 0, 0.06);
    --border-focus: rgba(107, 15, 36, 0.3);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 32px rgba(107, 15, 36, 0.12);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --trans: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --trans-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: var(--trans); }
a:hover { color: var(--primary-light); }

/* ── Animations ── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(24px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fadeInUp 0.5s ease both; }
.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.3s; }
.animate-in-delay-4 { animation-delay: 0.4s; }

/* ── Skeleton Loading ── */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

/* ── Auth Pages ── */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background:
        radial-gradient(circle at 20% 30%, rgba(107, 15, 36, 0.06), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(217, 119, 6, 0.04), transparent 50%),
        linear-gradient(135deg, #f8f9ff 0%, #f4f6fb 50%, #fdf8f4 100%);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 44px 36px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
    animation: scaleIn 0.6s ease both;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.auth-logo h1 i {
    -webkit-text-fill-color: var(--primary);
    margin-right: 4px;
}

.auth-logo p {
    color: var(--text-sec);
    font-size: 0.88rem;
    margin-top: 6px;
    font-weight: 400;
}

.auth-toggle {
    text-align: center;
    margin-top: 24px;
    font-size: 0.85rem;
    color: var(--text-sec);
}
.auth-toggle a {
    color: var(--primary);
    font-weight: 600;
}
.auth-toggle a:hover {
    text-decoration: underline;
}

/* ── Forms ── */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-sec);
    margin-bottom: 7px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.form-input {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    font-family: inherit;
    transition: var(--trans);
    outline: none;
}

.form-input:hover {
    border-color: rgba(0, 0, 0, 0.12);
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

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

select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--trans);
    font-family: inherit;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: var(--trans);
}

.btn:hover::after { opacity: 1; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: scale(0.97); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    box-shadow: 0 4px 14px rgba(107, 15, 36, 0.25);
}
.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(107, 15, 36, 0.35);
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text);
    border: 1.5px solid var(--border);
}
.btn-secondary:hover {
    background: #fff;
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.2);
}
.btn-danger:hover { background: #dc2626; }

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-sm { padding: 9px 18px; font-size: 0.78rem; }
.btn-xs { padding: 6px 12px; font-size: 0.72rem; }
.btn-block { width: 100%; }
.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ── Panel Layout ── */
.panel-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform var(--trans);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.03);
}

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

.sidebar-brand {
    font-size: 1.15rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
}

.sidebar-brand i {
    -webkit-text-fill-color: var(--primary);
    margin-right: 3px;
}

.sidebar-company {
    font-size: 0.75rem;
    color: var(--text-sec);
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.sidebar-nav {
    flex: 1;
    padding: 14px 12px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-sec);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--trans);
    cursor: pointer;
    margin-bottom: 4px;
    text-decoration: none;
    position: relative;
}

.nav-item:hover {
    background: var(--bg-surface);
    color: var(--text);
    transform: translateX(3px);
}

.nav-item.active {
    background: var(--primary-glow);
    color: var(--primary);
    font-weight: 600;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid var(--border);
}

/* ── Main Content ── */
.panel-main {
    flex: 1;
    margin-left: 260px;
    padding: 28px 36px;
    min-height: 100vh;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
    animation: fadeInUp 0.5s ease both;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text);
}

.page-subtitle {
    color: var(--text-sec);
    font-size: 0.85rem;
    margin-top: 3px;
    font-weight: 400;
}

/* ── Stats Cards ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: var(--trans);
    animation: fadeInUp 0.5s ease both;
    cursor: default;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    border-color: rgba(107, 15, 36, 0.15);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 14px;
}

.stat-icon.cat { background: var(--primary-glow); color: var(--primary); }
.stat-icon.item { background: var(--accent-bg); color: var(--accent); }
.stat-icon.link { background: var(--success-bg); color: var(--success); }

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text);
    animation: countUp 0.6s ease both;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-sec);
    margin-top: 6px;
    font-weight: 500;
}

/* ── Data Card / Table ── */
.data-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.5s ease both;
    transition: var(--trans);
}

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

.data-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}

.data-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}

.data-list { list-style: none; }

.data-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    transition: var(--trans);
    animation: fadeIn 0.4s ease both;
}

.data-list-item:last-child { border-bottom: none; }
.data-list-item:hover { background: var(--bg-surface); }

.data-list-thumb {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-surface);
    box-shadow: var(--shadow-sm);
}
.data-list-thumb img { width: 100%; height: 100%; object-fit: cover; }

.data-list-info { flex: 1; min-width: 0; }
.data-list-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.data-list-meta { font-size: 0.75rem; color: var(--text-sec); margin-top: 2px; }
.data-list-actions { display: flex; gap: 6px; }

/* ── Modal ── */
.panel-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.panel-modal-overlay.active { display: flex; }

.panel-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 18px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.35s ease both;
}

.panel-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px;
    border-bottom: 1px solid var(--border);
}
.panel-modal-title { font-size: 1.1rem; font-weight: 700; }
.panel-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--trans);
    padding: 6px;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.panel-modal-close:hover {
    color: var(--text);
    background: var(--bg-surface);
}

.panel-modal-body { padding: 26px; }
.panel-modal-footer {
    padding: 18px 26px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: var(--bg-surface);
    border-radius: 0 0 18px 18px;
}

/* ── File Upload ── */
.file-upload {
    border: 2px dashed rgba(0, 0, 0, 0.1);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    cursor: pointer;
    transition: var(--trans);
    position: relative;
    background: var(--bg-surface);
}
.file-upload:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
}
.file-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-upload-icon { font-size: 1.6rem; color: var(--text-muted); margin-bottom: 8px; }
.file-upload-text { font-size: 0.8rem; color: var(--text-sec); }
.file-upload-preview {
    max-width: 120px;
    max-height: 80px;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

/* ── QR Code Page ── */
.qr-container { text-align: center; max-width: 520px; margin: 0 auto; }
.qr-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 44px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    animation: scaleIn 0.5s ease both;
}
.qr-code-wrapper {
    background: #fff;
    border-radius: var(--radius);
    padding: 28px;
    display: inline-block;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}
.qr-url {
    color: var(--text-sec);
    font-size: 0.82rem;
    word-break: break-all;
    margin-bottom: 20px;
    padding: 12px 18px;
    background: var(--bg-surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
}
.qr-disabled { padding: 60px 20px; }
.qr-disabled i { font-size: 3rem; color: var(--text-muted); margin-bottom: 16px; }
.qr-disabled p { color: var(--text-sec); margin-bottom: 8px; }

/* ── Toast ── */
.toast {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 380px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.toast.show { transform: translateX(0); }
.toast.success { background: linear-gradient(135deg, #10b981, #059669); }
.toast.error { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast.info { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }

/* ── Mobile Toggle ── */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 101;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.1rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: var(--trans);
}
.mobile-toggle:hover { background: var(--primary-glow); color: var(--primary); }

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 99;
}

/* ── Color Picker ── */
.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}
.color-picker-wrapper input[type="color"] {
    width: 52px;
    height: 42px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: none;
    padding: 2px;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    animation: fadeInUp 0.5s ease both;
}
.empty-state i {
    font-size: 3.5rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}
.empty-state p {
    color: var(--text-sec);
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* ── Badge ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* ── Responsive ── */
@media(max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .mobile-toggle { display: flex; }
    .mobile-overlay.active { display: block; }
    .panel-main { margin-left: 0; padding: 72px 16px 24px; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .auth-card { padding: 32px 24px; }
    .panel-modal { margin: 12px; border-radius: 16px; }
}

@media(max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .panel-main { padding: 68px 12px 20px; }
}
