/* Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Public Sans", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
}

:root {
    --primary-color: #FF6600;
    --bg-color: #F5F5F5;
    --card-bg: #FFFFFF;
    --text-color: #333333;
    --text-secondary: #777777;
    --border-color: #E0E0E0;
    --success-color: #28a745;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    /* App-like feel */
}

/* Screen Management */
.screen {
    display: none;
    height: 100%;
    width: 100%;
    overflow-y: auto;
    position: absolute;
    top: 0;
    left: 0;
    background-color: var(--bg-color);
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* Select Seller Screen */
#tela-selecao-vendedor {
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #FFF5ED;
    background-image: none;
    flex-direction: column;
}

/* Login Screen */
#tela-login {
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #fff;
    background-image: none;
    flex-direction: column;
}

.login-container {
    padding: 30px;
    border-radius: 16px;
    border: 1px solid var(--Gray-30, #D5D7DA);
    background: var(--Gray-10, #F5F5F5);
    width: 100%;
    max-width: 350px;
    text-align: center;
    margin-top: auto;
    margin-bottom: auto;
}

.login-footer {
    width: 100%;
    display: flex;
    justify-content: center;
    padding-bottom: 20px;
}

.logo-area h1 {
    color: #000;
    font-size: 28px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    margin-top: 45px;
}

.title-form {
    display: block;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 25px;
    color: var(--text-color);
}

.logo-area p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.input-group {
    margin-bottom: 15px;
    text-align: left;
}

.input-group label {
    display: none;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 15px;
    border: 1px solid #E0E0E0;
    border-radius: 12px;
    font-size: 14px;
    outline: none;
    background-color: white;
    color: #333;
}

.input-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 40px;
    /* Space for arrow */
}

.input-group input::placeholder,
.input-group select::placeholder {
    color: #999;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--primary-color);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    color: white;
    border: none;
    border-radius: 12px;
    background: var(--Orange-0, #FA7108);
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.btn-primary:active {
    opacity: 0.9;
}

/* Header */
.app-header {
    background-color: var(--card-bg);
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    width: 100%;
    align-items: center;
    font-weight: bold;
}

.with-back {
    justify-content: flex-start;
    gap: 15px;
}

.btn-back {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-color);
    cursor: pointer;
    padding: 0 10px 0 0;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--primary-color);
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-logout-styled {
    display: flex;
    width: 40px;
    height: 40px;
    padding: 0 8px;
    justify-content: center;
    align-items: center;
    gap: 4px;
    border-radius: 8px;
    border: 1px solid #F0F0F0;
    background: #FFF;
    cursor: pointer;
}

.btn-logout-styled,
#btn-logout,
#btn-logout-vendor {
    display: flex;
    width: 40px;
    height: 40px;
    padding: 0 8px;
    justify-content: center;
    align-items: center;
    gap: 4px;
    border-radius: 8px;
    border: 1px solid #F0F0F0;
    background: #FFF;
    cursor: pointer;
    box-shadow: none;
    /* Removing previous shadow if any */
}

/* Search Bar */
.search-bar-container {
    padding: 15px 20px;
    background-color: var(--bg-color);
}

#barra-busca {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    background-color: white;
    outline: none;
}

/* Tabs */
.tabs {
    display: flex;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.tab-content.active {
    display: block;
}

/* Lists */
.campanha-list,
.cliente-list {
    list-style: none;
    padding-bottom: 20px;
}

.campanha-item,
.cliente-item {
    background-color: var(--card-bg);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: transform 0.1s;
}

.campanha-item:active,
.cliente-item:active {
    transform: scale(0.98);
}

.item-info h3 {
    font-size: 16px;
    margin-bottom: 5px;
    color: var(--text-color);
}

.item-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.item-meta {
    text-align: right;
    font-size: 12px;
    color: var(--text-secondary);
}

.tag-urgente {
    color: #d32f2f;
    font-weight: bold;
    font-size: 11px;
    background: #ffebee;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 5px;
}

.arrow-icon {
    color: var(--text-secondary);
    font-size: 18px;
    margin-left: 10px;
}

/* Progress Section */
.progress-section {
    padding: 30px 20px;
    background-color: var(--card-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

.progress-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 8px solid var(--bg-color);
    border-top-color: var(--primary-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.progress-circle span {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.progress-circle small {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Cliente Item Specifics */
.cliente-item {
    cursor: default;
    /* Default cursor unless action */
}

.btn-enviar {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}

.status-enviado {
    color: var(--success-color);
    font-weight: bold;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-enviado::before {
    content: '✓';
}

/* Install Utilities */
.btn-secondary {
    width: 100%;
    padding: 15px;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 12px;
    background: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

.btn-secondary:active {
    background-color: #fefefe;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: white;
    padding: 25px;
    border-radius: 16px;
    width: 100%;
    max-width: 320px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
}

.ios-instruction {
    margin-top: 15px;
    text-align: left;
    font-size: 14px;
    color: #555;
}

.ios-instruction p {
    margin-bottom: 8px;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: -200px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 20px;
    max-width: 90%;
    width: 350px;
    z-index: 2000;
    transition: bottom 0.4s ease-out;
}

.toast-notification.show {
    bottom: 30px;
}

.toast-content {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.toast-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.toast-text {
    flex: 1;
    text-align: left;
}

.toast-text strong {
    display: block;
    color: var(--text-color);
    font-size: 16px;
    margin-bottom: 5px;
}

.toast-text p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}

/* Vendor Selection Header */
.vendor-header {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 350px;
    margin-bottom: 20px;
}

.vendor-store-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    padding: 0 15px;
}

/* HR Styling */
hr {
    border: none;
    border-top: 1px solid #E5E7EB;
    margin: 20px 0;
}

.login-container hr {
    margin: 20px 0;
}
/* Atualizar status bar (aba Recorrentes) */
.atualizar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

.atualizar-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.atualizar-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    flex-shrink: 0;
}

.atualizar-indicator.loading {
    background: #FFA726;
    animation: atualizar-pulse 1.2s infinite;
}

.atualizar-indicator.ok {
    background: #4CAF50;
}

.atualizar-indicator.error {
    background: #E53935;
}

@keyframes atualizar-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.atualizar-status {
    font-size: 13px;
    color: #444;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-atualizar {
    background: var(--primary-color, #2C3AD6);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    flex-shrink: 0;
}

.btn-atualizar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
