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

/* Border on buttons */
.btn-light,
.btn-outline-secondary {
    border: 1px solid #ccc !important;
}
.btn-light:hover,
.btn-outline-secondary:hover {
    border-color: #999 !important;
}

:root {
    --primary-color: #16B3A7;
    --secondary-color: #0F5C68;
    --bg-color: #f4f7f6;
    --login-bg-color: #e6f7f5;
    --white: #ffffff;
    --text-color: #333333;
    --border-radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* PIX Payment Card */
.pix-card {
    max-width: 380px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.pix-card-header {
    background: linear-gradient(135deg, #16B3A7 0%, #0F5C68 100%);
    padding: 20px;
    text-align: center;
    color: #fff;
}
.pix-card-header i {
    font-size: 2.2rem;
    margin-bottom: 6px;
}
.pix-card-header h5 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    opacity: 0.9;
}
.pix-card-body {
    padding: 20px;
    text-align: center;
}
.pix-card .pix-valor {
    display: inline-block;
    background: #e8f5f3;
    color: var(--primary-color);
    font-size: 1.6rem;
    font-weight: 800;
    padding: 8px 28px;
    border-radius: 40px;
    margin-bottom: 18px;
    letter-spacing: 1px;
}
.pix-card .pix-qr-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
}
.pix-card .pix-qr-wrapper img {
    width: 200px;
    height: 200px;
    border-radius: 16px;
    padding: 10px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(22,179,167,0.2);
    border: 3px solid #e0f2ef;
}
.pix-card .pix-qr-wrapper .pix-pulse {
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 22px;
    border: 3px solid var(--primary-color);
    animation: pixPulse 2s ease-in-out infinite;
    pointer-events: none;
}
@keyframes pixPulse {
    0% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 0.2; transform: scale(1.06); }
    100% { opacity: 0.6; transform: scale(1); }
}
.pix-card .pix-copy-area {
    background: #f8faf9;
    border: 1px dashed #cde8e4;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
    text-align: left;
    position: relative;
}
.pix-card .pix-copy-area label {
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 4px;
}
.pix-card .pix-copy-area code {
    font-size: 0.7rem;
    color: #555;
    word-break: break-all;
    display: block;
    line-height: 1.4;
    max-height: 48px;
    overflow-y: auto;
}
.pix-card .pix-copy-area .btn-copy-pix {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}
.pix-card .pix-copy-area .btn-copy-pix:hover {
    background: #0f9d92;
}
.pix-card .pix-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}
.pix-card .pix-status.pending {
    background: #fff8e1;
    color: #b8860b;
}
.pix-card .pix-status.approved {
    background: #e8f5e9;
    color: #2e7d32;
}
.pix-card .pix-status.cancelled {
    background: #fbe9e7;
    color: #c62828;
}
.pix-card .pix-status i {
    font-size: 1.1rem;
}
.pix-card .pix-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid #ffe082;
    border-top: 3px solid #b8860b;
    border-radius: 50%;
    animation: pixSpin 0.8s linear infinite;
    display: inline-block;
}
@keyframes pixSpin {
    to { transform: rotate(360deg); }
}
.pix-card .pix-footer {
    padding: 10px 20px;
    background: #fafcfa;
    border-top: 1px solid #eef3f1;
    text-align: center;
}
.pix-card .pix-footer small {
    color: #aaa;
    font-size: 0.7rem;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
body.has-fixed-nav {
    padding-top: 70px;
}

/* Auth Pages */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: var(--login-bg-color);
    overflow-x: hidden;
    max-width: 100vw;
}

.auth-card {
    background: var(--white);
    padding: 2rem 1.5rem;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 2px solid #b0b0b0;
    width: 100%;
    max-width: 450px;
    text-align: center;
    box-sizing: border-box;
}

.auth-logo {
    width: 70px;
    margin-bottom: 1rem;
}

.auth-title {
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
    font-size: 1.75rem;
}

.auth-subtitle {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.auth-tabs {
    background: #f0f2f5;
    padding: 5px;
    border-radius: 12px;
    display: flex;
    margin-bottom: 1.5rem;
}

.auth-tab {
    flex: 1;
    padding: 12px 8px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
    background: transparent;
    color: #666;
    font-size: 0.95rem;
}

.auth-tab.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(22, 179, 167, 0.3);
}

.form-control {
    border-radius: 12px;
    padding: 14px 16px;
    border: 2px solid #c0c0c0 !important;
    background: #fcfcfc;
    font-size: 1rem;
}

/* Garante que campos em input-group também tenham a borda cinza */
.input-group .form-control {
    border-radius: 12px;
}

.input-group .btn {
    border-radius: 0 12px 12px 0;
    border-color: #c0c0c0;
}
.toggle-pwd-btn {
    border-left: 0 !important;
    z-index: 5;
    opacity: 1 !important;
    transition: background 0.2s ease;
}
.toggle-pwd-btn:hover {
    background: #e9ecef !important;
}
.toggle-pwd-btn:hover i {
    color: #000 !important;
}

.form-control:focus {
    box-shadow: 0 0 0 3px rgba(22, 179, 167, 0.1);
    border-color: var(--primary-color);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s;
    font-size: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(22, 179, 167, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Dashboard & Components */
.sidebar {
    background: var(--secondary-color);
    color: white;
    min-height: 100vh;
}

.card {
    border: 1px solid rgba(22, 179, 167, 0.3);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.stats-card {
    border-left: 4px solid var(--primary-color) !important;
}

.card:hover {
    transform: translateY(-5px);
}

.card:active {
    transform: translateY(0);
}

.stats-card {
    padding: 1.25rem;
    border-left: 5px solid var(--primary-color);
    border: 1px solid rgba(22, 179, 167, 0.25) !important;
    overflow: hidden;
}

.stats-card .card-footer-icon {
    background: #f0f2f5;
    margin: -1.25rem;
    margin-top: 0.75rem;
    padding: 0.6rem 1.25rem;
    text-align: right;
    border-top: 1px solid rgba(22, 179, 167, 0.1);
}

body.dark-mode .stats-card .card-footer-icon {
    background: #3d3d3d;
    border-top-color: rgba(255,255,255,0.05);
}

.stats-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    opacity: 0.3;
}

tr.table-orange {
    --bs-table-bg: #fff3cd;
    --bs-table-color: #664d03;
}

tr.bg-row-orange {
    background-color: #fff3cd !important;
}

.btn-floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
    z-index: 1000;
    border: none;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #ccc;
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fafafa;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(22, 179, 167, 0.05);
}

.upload-area-square {
    max-width: 280px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Offcanvas Menu */
.offcanvas {
    --offcanvas-bg: #f8f9fa;
}

.offcanvas .nav-item {
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.offcanvas .offcanvas-body .nav-link {
    color: #333 !important;
    padding: 14px 20px !important;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.2s;
}
.offcanvas .offcanvas-body .nav-link:hover {
    background: rgba(0,0,0,0.05);
}
.offcanvas .offcanvas-body .nav-link.active {
    color: var(--primary-color) !important;
    background: rgba(22, 179, 167, 0.08);
}
.offcanvas .offcanvas-body .nav-link.active:hover {
    background: rgba(22, 179, 167, 0.15);
}
.offcanvas .offcanvas-body .nav-link.text-danger {
    color: #dc3545 !important;
}
.offcanvas .offcanvas-body .nav-link.text-warning {
    color: #856404 !important;
}

/* Dark Mode */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode .card, body.dark-mode .auth-card {
    background: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .form-control {
    background: #3d3d3d;
    border-color: #444;
    color: #fff;
}

body.dark-mode .offcanvas {
    background: #2d2d2d;
}

body.dark-mode .offcanvas .offcanvas-body .nav-link {
    color: #e0e0e0 !important;
}

body.dark-mode .offcanvas .nav-item {
    border-bottom-color: rgba(255,255,255,0.05);
}

body.dark-mode .offcanvas .offcanvas-body .nav-link.active {
    background: rgba(22, 179, 167, 0.15);
}
body.dark-mode .offcanvas .offcanvas-body .nav-link.active:hover {
    background: rgba(22, 179, 167, 0.25);
}

body.dark-mode .offcanvas .offcanvas-body .nav-link:hover {
    background: rgba(22, 179, 167, 0.1);
}

/* WhatsApp preview in readonly */
.wa-preview {
    background: #f8f9fa !important;
    font-size: 0.85rem !important;
}

body.dark-mode .wa-preview {
    background: #3d3d3d !important;
    color: #e0e0e0 !important;
}

/* Mobile fixed navbar */
@media (max-width: 991.98px) {
    .navbar {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1030;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }
    .navbar .container {
        padding-left: 16px;
        padding-right: 16px;
    }
    .navbar .navbar-toggler {
        margin-right: 0;
    }
    .container.py-4,
    .container-fluid.py-4 {
        padding-top: 86px !important;
    }
    body > .py-4:first-of-type {
        padding-top: 86px !important;
    }
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    .auth-card {
        padding: 1.75rem 1.25rem;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .stats-card {
        padding: 1rem;
    }
    
    .stats-icon {
        font-size: 2rem;
    }
    
    .btn-floating {
        width: 52px;
        height: 52px;
        bottom: 16px;
        right: 16px;
    }
    
    .upload-area {
        padding: 20px 12px;
    }
    
    .modal-dialog {
        margin: 1rem;
    }
}

@media (max-width: 480px) {
    .auth-wrapper {
        padding: 8px;
    }
    
    .auth-card {
        padding: 1.5rem 0.75rem;
    }
    
    .auth-title {
        font-size: 1.35rem;
    }
    
    .auth-subtitle {
        font-size: 0.85rem;
    }
    
    .form-control {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    
/* Password toggle transition */
.input-group input[type="password"],
.input-group input[type="text"] {
    transition: filter 0.3s ease, background 0.3s ease;
}
.input-group input.show-pwd {
    filter: none;
}
.toggle-pwd-btn i {
    transition: transform 0.3s ease;
    display: inline-block;
}

.btn-primary {
        padding: 12px;
        font-size: 0.95rem;
    }
    
    .btn-floating {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }
    
    .btn-group, .d-flex {
        flex-wrap: wrap;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* Extra small screens adjustments */
@media (max-width: 360px) {
    .auth-title {
        font-size: 1.25rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn-floating {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
}

/* Card layout for tables */
.table-card-mode.force-card thead {
    display: none;
}
.table-card-mode.force-card tbody tr {
    display: block;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid rgba(22, 179, 167, 0.15);
}
.table-card-mode.force-card tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border: none;
    text-align: right;
}
.table-card-mode.force-card tbody td:before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    text-align: left;
}
.table-card-mode.force-card tbody td.text-end,
.table-card-mode.force-card tbody td.text-center {
    text-align: right;
}
.table-card-mode.force-card tbody td.text-end:before,
.table-card-mode.force-card tbody td.text-center:before {
    display: none;
}
/* Card mode: Excluir à esquerda, Editar ao centro, Ver à direita */
.table-card-mode.force-card .acoes-botoes {
    display: flex;
    justify-content: space-between;
    width: 100%;
}
.table-card-mode.force-card .btn-excluir { order: 1; }
.table-card-mode.force-card .btn-editar { order: 2; }
.table-card-mode.force-card .btn-ver { order: 3; }

/* Mobile card layout (auto on small screens) */
@media (max-width: 767px) {
    .table-card-mode:not(.force-table) thead {
        display: none;
    }
    .table-card-mode:not(.force-table) tbody tr {
        display: block;
        background: #fff;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        margin-bottom: 12px;
        padding: 12px;
        border: 1px solid rgba(22, 179, 167, 0.15);
    }
    .table-card-mode:not(.force-table) tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 6px 0;
        border: none;
        text-align: right;
    }
    .table-card-mode:not(.force-table) tbody td:before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        color: #888;
        text-transform: uppercase;
        text-align: left;
    }
    .table-card-mode:not(.force-table) tbody td.text-end,
    .table-card-mode:not(.force-table) tbody td.text-center {
        text-align: right;
    }
    .table-card-mode:not(.force-table) tbody td.text-end:before,
    .table-card-mode:not(.force-table) tbody td.text-center:before {
        display: none;
    }
    .table-card-mode:not(.force-table) .acoes-botoes {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }
    .table-card-mode:not(.force-table) .btn-excluir { order: 1; }
    .table-card-mode:not(.force-table) .btn-editar { order: 2; }
    .table-card-mode:not(.force-table) .btn-ver { order: 3; }

    body.dark-mode .table-card-mode:not(.force-table) tbody tr,
    body.dark-mode .table-card-mode.force-card:not(.force-table) tbody tr {
        background: #2d2d2d;
        border-color: #444;
    }

    .navbar-nav {
        padding-top: 10px;
    }
    .navbar-nav .nav-item {
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .card {
        margin-bottom: 8px;
    }
}

/* Novo Upload button */
.btn-upload {
    background: linear-gradient(135deg, var(--primary-color), #0ea89a);
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 24px 40px;
    min-height: 120px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(22, 179, 167, 0.3);
    position: relative;
    overflow: hidden;
}
.btn-upload::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%);
    animation: btn-shine 3s infinite;
}
@keyframes btn-shine {
    0% { transform: translateX(-100%) rotate(25deg); }
    100% { transform: translateX(100%) rotate(25deg); }
}
.btn-upload:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(22, 179, 167, 0.45);
    color: #fff;
}
.btn-upload:active {
    transform: translateY(0);
}
.btn-upload-icon {
    font-size: 2rem;
    margin-bottom: 4px;
}
.btn-upload-text {
    font-size: 1.1rem;
    font-weight: 700;
}
.btn-upload-sub {
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: 400;
}

/* Loja tabs */
.loja-tab {
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid #dee2e6;
    color: #495057;
    border-radius: 50px !important;
    padding: 6px 16px;
    font-size: 0.875rem;
    background: #f8f9fa;
    transition: all 0.2s;
}
.loja-tab:hover {
    background: #e9ecef;
}
.loja-tab.active {
    background: var(--primary-color) !important;
    color: #fff !important;
    border-color: var(--primary-color) !important;
}
.loja-tab .badge-count {
    background: rgba(0,0,0,0.1);
    color: inherit;
    font-weight: 600;
}
.loja-tab.active .badge-count {
    background: rgba(255,255,255,0.25);
    color: #fff;
}
.dashboard-registro-card {
    transition: transform .15s;
}
.dashboard-registro-card:hover {
    transform: translateY(-2px);
}
.loja-content {
    display: none;
}
.loja-content.active {
    display: block;
}
#lojaTabs::-webkit-scrollbar {
    height: 4px;
}
#lojaTabs::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

/* Lembrar-me pulse */
@keyframes pulse-check {
    0%, 100% { box-shadow: 0 0 0 0 rgba(22, 179, 167, 0.4); }
    50% { box-shadow: 0 0 0 5px rgba(22, 179, 167, 0); }
}
#lembrarCheck {
    animation: pulse-check 2s infinite;
    border-color: var(--primary-color);
}
#lembrarCheck:checked {
    animation: none;
    box-shadow: none;
}
