/* Admin Panel Styles */
:root {
    --primary: #e63946;
    --primary-dark: #c1121f;
    --secondary: #1d3557;
    --bg: #f0f2f5;
    --sidebar-bg: #1d3557;
    --sidebar-text: #a8b2c1;
    --sidebar-active: #fff;
    --card-bg: #fff;
    --border: #e2e8f0;
    --text: #1a202c;
    --text-muted: #718096;
    --success: #38a169;
    --danger: #e53e3e;
    --warning: #d69e2e;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* Login */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--secondary) 0%, #457b9d 100%);
}

.login-container { width: 100%; max-width: 420px; padding: 1rem; }

.login-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,.15);
}

.login-header { text-align: center; margin-bottom: 2rem; }
.login-icon { font-size: 3rem; display: block; margin-bottom: 0.5rem; }
.login-header h1 { font-size: 1.5rem; color: var(--secondary); }
.login-header p { color: var(--text-muted); font-size: 0.9rem; }
.login-footer { text-align: center; color: rgba(255,255,255,.7); margin-top: 1.5rem; font-size: 0.85rem; }

/* Layout */
.admin-body { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}

.sidebar-brand {
    padding: 1.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,.1);
}

.brand-icon { font-size: 1.4rem; }

.sidebar-nav { flex: 1; padding: 1rem 0; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all .2s;
    font-size: 0.95rem;
}

.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.12); color: var(--sidebar-active); font-weight: 600; }

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,.1);
}

.admin-info { margin-bottom: 0.75rem; }
.admin-info strong { display: block; color: #fff; font-size: 0.9rem; }
.admin-info small { color: var(--sidebar-text); font-size: 0.8rem; }

.btn-logout {
    display: block;
    text-align: center;
    padding: 0.5rem;
    background: rgba(255,255,255,.1);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    transition: background .2s;
}
.btn-logout:hover { background: rgba(255,255,255,.2); }

.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; color: var(--secondary); }

.page-actions { margin-bottom: 1.5rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 { font-size: 1.1rem; font-weight: 600; }
.card-body { padding: 1.5rem; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon { font-size: 2rem; }
.stat-number { display: block; font-size: 1.75rem; font-weight: 700; color: var(--secondary); }
.stat-label { font-size: 0.85rem; color: var(--text-muted); }

/* Table */
.table-responsive { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 0.875rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.table th {
    background: #f7fafc;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.table tr:hover td { background: #f7fafc; }
.text-center { text-align: center; }

.thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}

.thumb-lg {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: block;
}

.thumb-placeholder {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #edf2f7;
    border-radius: 6px;
    font-size: 1.2rem;
}

.actions-cell { white-space: nowrap; }

.link-vitrine {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    word-break: break-all;
}
.link-vitrine:hover { text-decoration: underline; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #c6f6d5; color: #22543d; }
.badge-danger { background: #fed7d7; color: #742a2a; }
.badge-warning { background: #fefcbf; color: #744210; margin-left: 0.5rem; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s;
    font-family: inherit;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn-outline:hover { background: #f7fafc; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c53030; }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn-block { width: 100%; justify-content: center; }

/* Forms */
.form-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.form-group { display: flex; flex-direction: column; }
.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group input[type="color"],
.form-group select,
.form-group textarea {
    padding: 0.6rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color .2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230,57,70,.15);
}

.form-group small { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.25rem; }

.input-prefix {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.input-prefix span {
    padding: 0.6rem 0.75rem;
    background: #f7fafc;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-right: 1px solid var(--border);
}

.input-prefix input {
    border: none !important;
    flex: 1;
    box-shadow: none !important;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 1.5rem;
}

.form-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.login-form .form-group { margin-bottom: 1rem; }

/* Alerts */
.alert {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.alert-success { background: #c6f6d5; color: #22543d; border: 1px solid #9ae6b4; }
.alert-error { background: #fed7d7; color: #742a2a; border: 1px solid #feb2b2; }
.alert p { margin: 0; }

/* Filter */
.filter-bar {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-form label { font-size: 0.85rem; font-weight: 500; }
.filter-form select {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
}

/* Help steps */
.help-steps { display: flex; flex-direction: column; gap: 1.25rem; }

.step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.step-num {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.step strong { display: block; margin-bottom: 0.25rem; }
.step p { color: var(--text-muted); font-size: 0.9rem; }

/* QR Code page */
.qrcode-page { max-width: 500px; margin: 0 auto; }

.qrcode-card { text-align: center; padding: 2rem; }

.qrcode-header { margin-bottom: 1.5rem; }
.qrcode-logo { width: 60px; height: 60px; object-fit: contain; border-radius: 8px; margin-bottom: 0.75rem; }
.qrcode-header h2 { font-size: 1.25rem; }
.qrcode-header p { color: var(--text-muted); }

.qrcode-image { margin: 1.5rem 0; }
.qrcode-image img { max-width: 280px; border: 4px solid #fff; box-shadow: var(--shadow); border-radius: 8px; }

.qrcode-link { margin: 1.5rem 0; text-align: left; }
.qrcode-link label { font-size: 0.85rem; font-weight: 600; display: block; margin-bottom: 0.5rem; }

.copy-group { display: flex; gap: 0.5rem; }
.copy-group input {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
}

.qrcode-actions { display: flex; gap: 0.75rem; justify-content: center; margin: 1.5rem 0; flex-wrap: wrap; }

.qrcode-tips {
    text-align: left;
    background: #f7fafc;
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-top: 1.5rem;
}

.qrcode-tips h3 { font-size: 0.95rem; margin-bottom: 0.75rem; }
.qrcode-tips ul { padding-left: 1.25rem; color: var(--text-muted); font-size: 0.85rem; }
.qrcode-tips li { margin-bottom: 0.4rem; }

@media print {
    .sidebar, .page-actions, .page-header, .qrcode-actions, .qrcode-tips { display: none !important; }
    .main-content { margin: 0; padding: 0; }
    .qrcode-card { box-shadow: none; }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar { width: 100%; position: relative; }
    .main-content { margin-left: 0; padding: 1rem; }
    .admin-body { flex-direction: column; }
    .form-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
}
