/* ========== STAMPI - DESIGN SYSTEM ========== */
/* Cores extraídas da logo: Navy #2B3A4E, Green #4CD964 */

:root {
    --primary: #2B3A4E;
    --primary-dark: #1E2A38;
    --primary-light: #3D5068;
    --accent: #4CD964;
    --accent-dark: #34B84C;
    --accent-light: #7AE88A;
    --bg: #F5F7FA;
    --bg-card: #FFFFFF;
    --text: #2B3A4E;
    --text-light: #6B7C93;
    --text-muted: #9AADBE;
    --border: #E2E8F0;
    --border-light: #EDF2F7;
    --danger: #E53E3E;
    --warning: #ED8936;
    --info: #4299E1;
    --success: #4CD964;
    --shadow: 0 1px 3px rgba(43, 58, 78, 0.08), 0 1px 2px rgba(43, 58, 78, 0.06);
    --shadow-md: 0 4px 6px rgba(43, 58, 78, 0.07), 0 2px 4px rgba(43, 58, 78, 0.06);
    --shadow-lg: 0 10px 15px rgba(43, 58, 78, 0.1), 0 4px 6px rgba(43, 58, 78, 0.05);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

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

a {
    color: var(--accent-dark);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent);
}

/* ========== TIPOGRAFIA ========== */
h1, h2, h3, h4, h5 {
    color: var(--primary);
    font-weight: 700;
    line-height: 1.3;
}

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

/* ========== LAYOUT ========== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

/* ========== SIDEBAR ========== */
.sidebar {
    width: 260px;
    background: var(--primary);
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-header img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.sidebar-header h2 {
    color: white;
    font-size: 1.1rem;
    word-break: break-word;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    color: white;
    background: rgba(255,255,255,0.05);
}

.sidebar-nav a.active {
    color: white;
    background: rgba(76, 217, 100, 0.1);
    border-left-color: var(--accent);
}

.sidebar-nav a .icon {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
}

.sidebar-logo-bottom {
    display: block;
    max-width: 120px;
    margin: 0 auto 0.75rem;
}

.sidebar-footer a {
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
}

.sidebar-footer a:hover {
    color: var(--danger);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    margin-left: 260px;
    padding: 2rem;
    min-height: 100vh;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ========== CARDS ========== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
}

/* ========== STAT CARDS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.green { background: rgba(76, 217, 100, 0.12); color: #3BB854; }
.stat-icon.blue { background: rgba(66, 153, 225, 0.12); color: var(--info); }
.stat-icon.orange { background: rgba(237, 137, 54, 0.12); color: var(--warning); }
.stat-icon.red { background: rgba(229, 62, 62, 0.12); color: var(--danger); }
.stat-icon.navy { background: rgba(43, 58, 78, 0.1); color: var(--primary); }

.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 500;
}

/* ========== FORMS ========== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background: white;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 85%);
}

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

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* ========== LOGO UPLOAD PREVIEW ========== */
.logo-preview-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.logo-preview-box {
    width: 100%;
    height: 140px;
    background: var(--primary-dark);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    border: 2px dashed rgba(255, 255, 255, 0.15);
    transition: var(--transition);
    position: relative;
}

.logo-preview-box:hover {
    border-color: rgba(255, 255, 255, 0.35);
    background: var(--primary);
}

.logo-preview-box img {
    max-width: 70%;
    max-height: 90px;
    object-fit: contain;
}

.logo-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.85rem;
    pointer-events: none;
}

.logo-preview-placeholder i {
    font-size: 2rem;
}

.logo-preview-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-file-name {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.logo-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.65rem 0.85rem;
    background: #EBF5FF;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--info);
    line-height: 1.45;
}

.logo-hint i {
    font-size: 1rem;
    margin-top: 1px;
    flex-shrink: 0;
}

.logo-hint strong {
    color: var(--primary);
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

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

.btn-primary:hover {
    background: var(--accent-dark);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background: var(--primary-dark);
    color: white;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--border);
}

.btn-outline:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

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

.btn-danger:hover {
    background: #C53030;
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 0.9rem 2rem;
    font-size: 1.05rem;
}

.btn-block {
    display: flex;
    width: 100%;
    justify-content: center;
}

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

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    background: var(--bg);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border);
}

table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.95rem;
}

table tbody tr:hover {
    background: rgba(76, 217, 100, 0.03);
}

/* ========== BADGES ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1;
}

.badge-success { background: rgba(76, 217, 100, 0.12); color: #3BB854; }
.badge-warning { background: rgba(237, 137, 54, 0.12); color: var(--warning); }
.badge-danger { background: rgba(229, 62, 62, 0.12); color: var(--danger); }
.badge-info { background: rgba(66, 153, 225, 0.12); color: var(--info); }
.badge-primary { background: rgba(43, 58, 78, 0.1); color: var(--primary); }

/* ========== ALERTS ========== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-success {
    background: rgba(76, 217, 100, 0.1);
    color: #3BB854;
    border: 1px solid rgba(76, 217, 100, 0.2);
}

.alert-error {
    background: rgba(229, 62, 62, 0.1);
    color: var(--danger);
    border: 1px solid rgba(229, 62, 62, 0.2);
}

.alert-warning {
    background: rgba(237, 137, 54, 0.1);
    color: var(--warning);
    border: 1px solid rgba(237, 137, 54, 0.2);
}

.alert-info {
    background: rgba(66, 153, 225, 0.1);
    color: var(--info);
    border: 1px solid rgba(66, 153, 225, 0.2);
}

/* ========== STAMP CARD (CARTELA) ========== */
.cartela {
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(43, 58, 78, 0.10), 0 2px 8px rgba(43, 58, 78, 0.06);
    padding: 0;
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.8);
}



.cartela-body {
    padding: 1rem 2rem 2rem;
}

.stamps-grid {
    display: grid;
    grid-template-columns: repeat(5, 58px);
    gap: 0.75rem;
    margin: 1rem 0 1.5rem;
    justify-content: center;
}

.stamp-slot {
    aspect-ratio: 1;
    border-radius: 10px;
    border: 2.5px dashed var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    background: var(--bg);
    width: 58px;
    height: 58px;
    margin: 0 auto;
}

.stamp-slot.filled {
    border: 2.5px solid var(--accent);
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent), transparent 85%), color-mix(in srgb, var(--accent), transparent 95%));
    color: var(--accent);
    transform: scale(1);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--accent), transparent 80%);
}

.stamp-slot.filled::after {
    content: '✓';
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
}

.stamp-slot:not(.filled)::after {
    content: attr(data-number);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    opacity: 0.6;
}

.cartela-progress {
    text-align: center;
    margin-top: 0.5rem;
}

.progress-bar {
    background: var(--border-light);
    border-radius: 50px;
    height: 8px;
    overflow: hidden;
    margin: 0.5rem 0;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 50px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.cartela-reward {
    text-align: center;
    padding: 1.25rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent), transparent 92%), color-mix(in srgb, var(--accent), transparent 98%));
    border-radius: 14px;
    margin-top: 1.25rem;
    border: 1px solid color-mix(in srgb, var(--accent), transparent 85%);
    position: relative;
    overflow: hidden;
}

.cartela-reward::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent), transparent 94%) 0%, transparent 70%);
    pointer-events: none;
}

.cartela-reward .reward-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.cartela-reward h4 {
    color: var(--accent);
    margin-bottom: 0.25rem;
    font-size: 1rem;
}

.cartela-reward p {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* ========== AUTH PAGES ========== */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #1a2332 100%);
    padding: 1rem 2rem 2rem;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(76, 217, 100, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(76, 217, 100, 0.05) 0%, transparent 50%);
    pointer-events: none;
    animation: authBgMove 15s ease-in-out infinite alternate;
}

@keyframes authBgMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-5%, -3%); }
}

.auth-card {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 1.5rem 3rem 2rem;
    width: 100%;
    max-width: 750px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    position: relative;
    z-index: 1;
    animation: authCardIn 0.5s ease-out;
}

@keyframes authCardIn {
    0% { opacity: 0; transform: translateY(20px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-logo .logo-icon {
    width: 64px;
    height: 64px;
    background: var(--primary);
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.auth-logo .logo-icon svg {
    width: 36px;
    height: 36px;
}

.auth-logo h1 {
    font-size: 1.75rem;
    color: var(--primary);
}

.auth-logo p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-top: 0.5rem;
    line-height: 1.5;
}

.auth-card .form-group label {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
}

.auth-card .form-control {
    border: 2px solid var(--border-light);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    transition: all 0.3s ease;
    background: var(--bg);
}

.auth-card .form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent), transparent 88%);
    background: white;
}

.auth-card .btn-primary {
    border-radius: 14px;
    padding: 0.9rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    box-shadow: 0 4px 14px rgba(76, 217, 100, 0.35);
    transition: all 0.3s ease;
}

.auth-card .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(76, 217, 100, 0.4);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.7;
}

.auth-footer a {
    color: var(--accent-dark);
    font-weight: 600;
}

/* ========== LANDING PAGE ========== */
.landing-nav {
    background: var(--primary);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.landing-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.landing-nav .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    font-size: 1.3rem;
    font-weight: 800;
}

.landing-nav .nav-links {
    display: flex;
    gap: 1rem;
}

.landing-nav .nav-links a {
    color: rgba(255,255,255,0.8);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
}

.landing-nav .nav-links a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.landing-nav .nav-links a.btn-primary {
    color: white;
}

.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 5rem 0;
    text-align: center;
    color: white;
}

.hero h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero h1 span {
    color: var(--accent);
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.features {
    padding: 5rem 0;
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.feature-card .feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.landing-footer {
    background: var(--primary);
    color: rgba(255,255,255,0.6);
    padding: 2rem 0;
    text-align: center;
    font-size: 0.9rem;
}

/* ========== CLIENTE PORTAL ========== */
.cliente-nav {
    background: var(--primary);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cliente-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
}

.cliente-nav .logo {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: white;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.cliente-nav .logo img {
    transition: opacity 0.2s;
}

.cliente-nav .user-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
    font-weight: 500;
}

.cliente-nav .user-info a {
    color: rgba(255,255,255,0.6);
    font-weight: 500;
    transition: all 0.2s;
    border-radius: 8px;
    padding: 0.35rem 0.65rem;
}

.cliente-nav .user-info a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.cliente-body {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
}

/* Welcome section */
.cliente-welcome {
    margin-bottom: 2rem;
}

.cliente-welcome h1 {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.cliente-welcome p {
    color: var(--text-light);
    font-size: 0.95rem;
}

.estab-list {
    display: grid;
    gap: 0.85rem;
}

.estab-card {
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(43, 58, 78, 0.06), 0 0px 1px rgba(43, 58, 78, 0.08);
    display: flex;
    flex-direction: row;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.estab-card:hover {
    box-shadow: 0 8px 24px rgba(43, 58, 78, 0.1), 0 2px 8px rgba(43, 58, 78, 0.06);
    transform: translateY(-3px);
    color: var(--text);
    border-color: transparent;
}

.estab-card-banner {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    width: 25%;
    flex-shrink: 0;
    border-radius: 16px 0 0 16px;
}

.estab-card-banner img {
    max-height: 60px;
    max-width: 80%;
    object-fit: contain;
}

.estab-card-banner .logo-placeholder {
    background: rgba(255, 255, 255, 0.15) !important;
    color: white;
}

.estab-card-body {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    flex: 1;
}

.estab-card .estab-info {
    flex: 1;
    min-width: 0;
}

.estab-card .estab-info h3 {
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.estab-card .estab-info p {
    color: var(--text-light);
    font-size: 0.85rem;
    line-height: 1.5;
}

.estab-card .estab-stamps {
    text-align: center;
    flex-shrink: 0;
    background: var(--bg);
    border-radius: 12px;
    padding: 0.65rem 1rem;
    min-width: 70px;
}

.estab-card .estab-stamps .stamp-count {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--accent-dark);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.estab-card .estab-stamps .stamp-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Cortesia badge in estab card */
.estab-cortesia-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--accent-dark);
    font-weight: 600;
    font-size: 0.82rem;
    background: rgba(76, 217, 100, 0.1);
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    margin-top: 0.3rem;
}

/* Congrats card for available cortesias */
.cortesia-card {
    background: linear-gradient(135deg, rgba(76,217,100,0.06), rgba(255,255,255,0.9));
    border: 2px solid rgba(76,217,100,0.18);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cortesia-card::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 60%;
    height: 80%;
    background: radial-gradient(circle, rgba(76, 217, 100, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.cortesia-card .cortesia-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    display: inline-block;
    animation: celebratePulse 2s ease-in-out infinite;
}

@keyframes celebratePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.cortesia-card h2 {
    color: var(--accent-dark);
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 0.35rem;
}

/* History items */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.2s;
}

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

.history-item:hover {
    background: rgba(76, 217, 100, 0.02);
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    border-radius: 8px;
}

.history-item .history-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.history-item .history-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.history-item .history-icon.stamp-icon {
    background: rgba(76, 217, 100, 0.1);
    color: var(--accent-dark);
}

.history-item .history-icon.gift-icon {
    background: rgba(237, 137, 54, 0.1);
    color: var(--warning);
}

.history-item .history-text strong {
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
}

.history-item .history-text span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.history-item .history-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
    text-align: right;
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    border-radius: 12px;
    transition: all 0.2s;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
}

.back-link:hover {
    color: var(--text);
    background: var(--bg);
    border-color: var(--border);
    transform: translateX(-3px);
}

/* Client cards with improved styling */
.cliente-body .card {
    border-radius: 16px;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 8px rgba(43, 58, 78, 0.04);
}

.cliente-body .card-header {
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 0.5rem;
}

.cliente-body .card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

/* Empty states in client */
.cliente-body .empty-state {
    padding: 2.5rem 1rem;
}

.cliente-body .empty-state .empty-icon {
    font-size: 2.5rem;
    opacity: 0.3;
}

/* No active cartela */
.no-cartela {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 1rem;
    font-size: 0.95rem;
}

/* Establishment identity above cartela */
.estab-identity {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-top: 1rem;
}

.estab-identity img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

.estab-identity h2 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

/* ========== CARTELA HERO HEADER ========== */
.cartela-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 0 0 28px 28px;
    padding: 1.5rem 1rem 2rem;
    margin-bottom: 1.5rem;
}

.cartela-hero .cliente-nav {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.cartela-hero-identity {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cartela-hero-identity img {
    height: 72px;
    object-fit: contain;
    margin-bottom: 0.75rem;
}

.cartela-hero-identity .logo-placeholder {
    margin-bottom: 0.75rem;
}

.cartela-hero-identity h2 {
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: white;
}

/* ========== EMPTY STATE ========== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* ========== MODAL ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

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

.modal {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal h2 {
    margin-bottom: 1.5rem;
}

/* Page header title with hamburger */
.page-header-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.dashboard-actions {
    display: flex;
    gap: 0.5rem;
}

/* Status badge inline in Carimbos column */
.td-inline-status {
    display: inline-flex;
    margin-left: 0.5rem;
}

/* Hide Status column entirely */
.td-status-cell {
    display: none;
}

/* ========== SEARCH ========== */
.search-box {
    position: relative;
    margin-bottom: 1.5rem;
}

.search-box input {
    width: 100%;
    padding: 0.7rem 1rem 0.7rem 2.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 85%);
}

.search-box .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ========== COLOR PICKER ========== */
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-picker-group input[type="color"] {
    width: 50px;
    height: 40px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 2px;
}

/* ========== RESPONSIVE ========== */

/* Dashboard grid layouts */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.info-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 100%;
        background: var(--primary);
        display: flex;
        flex-direction: column;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-header {
        justify-content: center;
        flex-direction: column;
        text-align: center;
        padding: 1rem 1.5rem 1.5rem;
    }

    .sidebar-header img {
        width: 56px;
        height: 56px;
    }

    .sidebar-nav {
        flex: 1;
    }

    .sidebar-nav a {
        padding: 1rem 2rem;
        font-size: 1.1rem;
        border-left: none;
        justify-content: center;
    }

    .sidebar-nav a.active {
        border-left: none;
        background: rgba(76, 217, 100, 0.15);
    }

    .sidebar-footer {
        position: relative;
        padding: 1.5rem;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stamps-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
    }

    .dashboard-actions {
        display: flex;
        gap: 0.5rem;
        width: 100%;
    }

    .dashboard-actions .btn {
        flex: 1;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
    }

    .page-header-actions {
        width: 100%;
    }

    .page-header-actions .btn {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .info-grid-3 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .form-grid-2 {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .page-header-title {
        width: 100%;
    }

    /* Tables: card-style on mobile */
    .table-wrapper {
        overflow-x: visible;
    }

    table, table thead, table tbody, table th, table td, table tr {
        display: block;
        width: 100%;
    }

    table thead {
        display: none;
    }

    table tr {
        margin-bottom: 0.75rem;
        border: 1px solid var(--border-light);
        border-radius: var(--radius-sm);
        padding: 0.75rem;
        background: var(--bg-card);
    }

    table td {
        padding: 0.35rem 0;
        text-align: right;
        border-bottom: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.9rem;
        flex-wrap: nowrap;
    }

    table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.8rem;
        color: var(--text-light);
        text-transform: uppercase;
        letter-spacing: 0.03em;
        margin-right: 1rem;
        flex-shrink: 0;
    }

    table td:last-child {
        padding-bottom: 0;
    }

    table td.td-no-label::before {
        display: none;
    }

    table td.td-no-label {
        justify-content: flex-end;
    }

    /* Hide Status column on mobile (shown inline in Carimbos) */
    table td.td-status-cell {
        display: none;
    }

    /* Show inline status badge on mobile */
    .td-inline-status {
        display: inline-flex !important;
        margin-left: 0;
    }

    /* Carimbos cell with status: label left, count + badge right */
    table td.td-status-label {
        flex-wrap: nowrap;
        gap: 0.5rem;
    }

    table td.td-status-label::before {
        content: attr(data-label);
        flex-shrink: 0;
        margin-right: auto;
    }

    /* Action button full-width centered on mobile */
    table td.td-action-cell::before {
        display: none;
    }

    table td.td-action-cell {
        justify-content: center;
        padding-top: 0.5rem;
    }

    table td.td-action-cell .btn {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        padding: 0.65rem 1rem;
        font-size: 0.95rem;
    }

    /* Card headers on mobile */
    .card-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .card-header h3 {
        font-size: 1rem;
    }

    /* Flex-between stacking on small screens */
    .flex-between {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Stat cards compact */
    .stat-card {
        padding: 1rem 0.85rem;
        flex-direction: column-reverse;
        align-items: flex-start;
        gap: 0.6rem;
        min-height: 110px;
        position: relative;
    }

    .stat-card .stat-icon {
        position: absolute;
        top: 0.85rem;
        right: 0.85rem;
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .stat-icon {
        width: 44px;
        height: 44px;
    }

    .stat-info h3 {
        font-size: 1.4rem;
    }

    .stat-info p {
        font-size: 0.8rem;
    }

    /* Card padding */
    .card {
        padding: 1rem;
    }

    /* Search box */
    .search-box {
        flex-direction: column;
    }

    /* Features grid */
    .features-grid {
        grid-template-columns: 1fr;
    }

    /* Landing nav */
    .landing-nav .container {
        flex-direction: column;
        gap: 0.5rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    /* Cliente estab list */
    .estab-card {
        flex-direction: column;
    }

    .estab-card-banner {
        width: 100%;
        min-height: 90px;
        border-radius: 16px 16px 0 0;
    }

    .estab-card-body {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }

    .estab-card .estab-stamps {
        width: 100%;
    }

    .cliente-body {
        padding: 1.25rem 1rem 2rem;
    }

    .cliente-welcome h1 {
        font-size: 1.3rem;
    }

    /* Cartela mobile */
    .cartela-header {
        padding: 1.5rem 1.5rem 1.25rem;
    }

    .cartela-body {
        padding: 0.75rem 1.25rem 1.5rem;
    }

    .stamps-grid {
        gap: 0.5rem;
    }

    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .cortesia-card {
        padding: 1.5rem;
    }

    .history-item:hover {
        margin: 0;
        padding-left: 0;
        padding-right: 0;
    }
}

/* ========== MOBILE TOP BAR (establishment) ========== */
.mobile-topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 99;
    background: var(--primary);
    padding: 0.6rem 1rem;
    align-items: center;
    justify-content: space-between;
}

.mobile-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobile-topbar-logo {
    height: 34px;
}

.mobile-topbar-sair {
    color: rgba(255,255,255,0.6);
    font-size: 1.25rem;
    padding: 0.25rem;
    transition: color 0.2s;
}

.mobile-topbar-sair:hover {
    color: white;
}

.sidebar-close-btn {
    display: none;
    justify-content: flex-end;
    padding: 1rem 1.25rem 0;
}

.sidebar-close-btn button {
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s;
}

.sidebar-close-btn button:hover {
    color: white;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .mobile-topbar {
        display: flex;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .sidebar-close-btn {
        display: flex;
    }

    .main-content {
        padding-top: 1rem;
    }
}

/* ========== PERSONALIZAÇÃO DINÂMICA ========== */
.custom-primary { background-color: var(--custom-primary, var(--primary)); }
.custom-accent { background-color: var(--custom-accent, var(--accent)); }

/* ========== Utilitários ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Logo placeholder default */
.logo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.1rem;
}

/* ========== BOOTSTRAP ICONS SIZING ========== */
/* Icons inside buttons and badges */
.btn .bi, .badge .bi { margin-right: 0.3em; vertical-align: -0.125em; }
.btn-sm .bi { font-size: 0.9em; }
.btn-lg .bi { font-size: 1.1em; }

/* Page header icons */
.page-header h1 .bi { margin-right: 0.4rem; vertical-align: -0.05em; }

/* Card header icons */
.card-header h3 .bi { margin-right: 0.3rem; vertical-align: -0.1em; }

/* Sidebar nav icons */
.sidebar-nav a .icon .bi { font-size: 1.1rem; vertical-align: -0.1em; }
.sidebar-footer a .bi { margin-right: 0.3rem; vertical-align: -0.1em; }

/* Mobile menu button icon */
.mobile-menu-btn .bi { font-size: 1.4rem; }

/* Stat card icons */
.stat-icon .bi { font-size: 1.5rem; }

/* Feature card icons (landing page) */
.feature-card .feature-icon .bi { font-size: 3rem; color: var(--accent); }

/* Empty state icons */
.empty-state .empty-icon .bi { font-size: 3rem; }

/* Reward / gift icons */
.cartela-reward .reward-icon .bi { font-size: 2rem; color: var(--accent); }

/* Search icon */
.search-box .search-icon .bi { font-size: 1rem; }

/* Alert icons */
.alert .bi { margin-right: 0.4rem; vertical-align: -0.1em; }

/* Celebration / large icons */
div > .bi.bi-stars { color: var(--accent); }

/* User info icon */
.user-info .bi { margin-right: 0.2rem; vertical-align: -0.1em; }
