/* Mobile-Optimized CSS for SisGerCli Mobile App */
:root {
    --primary-gradient: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    --accent-color: #0dcaf0;
    --text-bg: #f8f9fa;
    --card-bg: #ffffff;
    --card-border: #dee2e6;
    --base-font-size: 1.1rem;
    --touch-target: 52px;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
    padding-bottom: 40px;
    -webkit-tap-highlight-color: transparent;
    font-size: var(--base-font-size);
}

/* Sticky Navbar / Header */
.mobile-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 1040;
}

#logo {
    font-size: 1.85rem;
}

#logo i {
    font-size: 2.2rem;
}

.mobile-brand {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Search Bar & Dropdown */
.search-container {
    position: relative;
}

.mobile-search-input {
    border-radius: 32px;
    padding-left: 3.5rem;
    padding-right: 3.5rem;
    height: 64px;
    background-color: #ffffff !important;
    border: 2px solid #cbd5e1;
    color: #0f172a !important;
    font-size: 1.3rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.mobile-search-input::placeholder {
    color: #94a3b8;
    font-size: 1.2rem;
}

.mobile-search-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 5px rgba(13, 110, 253, 0.2);
}

.search-icon-inside {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #0d6efd;
    font-size: 1.5rem;
    pointer-events: none;
}

.btn-clear-search {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
}

/* Autocomplete Dropdown overlay */
.mobile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1.5px solid var(--card-border);
    border-radius: 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    z-index: 1050;
    max-height: 320px;
    overflow-y: auto;
}

.mobile-dropdown-item {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: #212529;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    cursor: pointer;
}

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

.mobile-dropdown-item:active,
.mobile-dropdown-item.active {
    background-color: #0d6efd;
    color: #fff;
}

.mobile-dropdown-item i {
    font-size: 1.4rem;
}

/* Selected Client Card */
.client-selected-card {
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    border: 1.5px solid #dee2e6;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.client-selected-card .fw-bold {
    font-size: 1.2rem;
}

.client-selected-card .small {
    font-size: 0.95rem;
}

#btnDeselectClient {
    flex-shrink: 0 !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 50% !important;
    aspect-ratio: 1 / 1 !important;
}

/* Option Navigation Pills */
.mobile-nav-pills {
    background-color: #f8f9fa;
    padding: 6px;
    border-radius: 16px;
    border: 1.5px solid var(--card-border);
    display: flex;
    gap: 6px;
}

.mobile-nav-pills .nav-link {
    flex: 1;
    text-align: center;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #6c757d;
    border: none;
    background: transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--touch-target);
}

.mobile-nav-pills .nav-link i {
    font-size: 1.2rem;
}

.mobile-nav-pills .nav-link.active {
    background-color: #0d6efd;
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(13, 110, 253, 0.35);
}

/* Option 1: Ficha Cadastral em Cards */
.btn-copy-text {
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 18px;
    min-height: 42px;
}

/* Card único da ficha cadastral */
.ficha-card {
    background: #ffffff;
    border: 1.5px solid var(--card-border);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    margin-bottom: 8px;
}

/* Título interno de cada bloco */
.ficha-block-header {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 0.3px;
}

.ficha-block-header i {
    font-size: 1.05rem;
    flex-shrink: 0;
}

/* Linha divisora entre blocos */
.ficha-divider {
    height: 1px;
    background: var(--card-border);
    margin: 0;
}

/* Linha label + valor */
.ficha-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.ficha-row:last-child {
    border-bottom: none;
}

.ficha-label {
    color: #6c757d;
    font-size: 0.93rem;
    font-weight: 500;
    flex-shrink: 0;
    min-width: 100px;
    max-width: 40%;
    line-height: 1.4;
    padding-top: 1px;
}

.ficha-value {
    color: #212529;
    font-size: 0.93rem;
    font-weight: 500;
    text-align: right;
    word-break: break-word;
    line-height: 1.4;
    flex: 1;
}

.ficha-mono {
    letter-spacing: 0.3px;
}

/* Badges de status */
.ficha-badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.93rem;
    font-weight: 600;
}

.ficha-badge-active {
    background-color: rgba(40, 167, 69, 0.12);
    color: #198754;
    border: 1.5px solid rgba(40, 167, 69, 0.3);
}

.ficha-badge-inactive {
    background-color: rgba(220, 53, 69, 0.12);
    color: #dc3545;
    border: 1.5px solid rgba(220, 53, 69, 0.3);
}

/* Separador de múltiplos endereços */
.ficha-loc-label {
    padding: 8px 18px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0d6efd;
    background-color: #f0f5ff;
    border-bottom: 1px solid rgba(13, 110, 253, 0.15);
}

/* Estado vazio dentro de seção */
.ficha-empty {
    padding: 16px 18px;
    color: #adb5bd;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

/* Estado de erro */
.ficha-error {
    border-radius: 12px;
    font-size: 0.95rem;
}

/* Loading da ficha */
.ficha-loading {
    padding: 40px 24px;
}

/* Option 2: Orders View */
.order-card {
    background-color: var(--card-bg);
    border: 1.5px solid var(--card-border);
    border-radius: 16px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}

.order-card:active {
    transform: scale(0.99);
}

.order-header {
    padding: 18px 20px;
    cursor: pointer;
}

.order-items-box {
    background-color: #f8f9fa;
    border-top: 1.5px solid var(--card-border);
    padding: 18px 20px;
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
}

.order-item-row {
    padding: 14px 0;
    border-bottom: 1.5px dashed #dee2e6;
}

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

/* Badges and Helpers */
.badge-custom-active {
    background-color: rgba(46, 160, 67, 0.15);
    color: #28a745;
    border: 1.5px solid rgba(46, 160, 67, 0.3);
    font-size: 0.85rem;
    padding: 6px 12px;
}

.badge-custom-inactive {
    background-color: rgba(248, 81, 73, 0.15);
    color: #dc3545;
    border: 1.5px solid rgba(248, 81, 73, 0.3);
    font-size: 0.85rem;
    padding: 6px 12px;
}

.text-cyan {
    color: #0dcaf0 !important;
}

.empty-state {
    padding: 60px 24px;
    text-align: center;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 16px;
    opacity: 0.5;
}
