/* ========================================
   APARTADO PAY - Complete Design System
   Premium Apple-Style PWA
======================================== */

/* === CSS RESET & VARIABLES === */
:root {
    --bg: #F2F2F7;
    --card: #FFFFFF;
    --text: #1C1C1E;
    --text-secondary: #8E8E93;
    --primary: #007AFF;
    --success: #34C759;
    --danger: #FF3B30;
    --input-bg: #E5E5EA;
    --border: rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

body {
    padding-bottom: 100px;
    /* Space for bottom nav */
}

/* === LAYOUT === */
.container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* === TYPOGRAPHY === */
h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    color: var(--text);
}

h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.section-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* === CARDS === */
.card {
    background: var(--card);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.card-dark {
    background: linear-gradient(145deg, #2C2C2E 0%, #1C1C1E 100%);
    color: #FFFFFF;
    border-radius: 20px;
    padding: 28px 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.card-dark .label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-dark .value {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -1px;
    margin: 8px 0 20px 0;
}

.card-dark .btn-glass {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* === FORMS === */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    color: var(--text);
    background-color: var(--input-bg);
    border: none;
    border-radius: 12px;
    outline: none;
    transition: background-color 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.form-group input:focus,
.form-group select:focus {
    background-color: #D1D1D6;
}

.form-group input[type="file"] {
    padding: 14px;
    background: transparent;
    border: 2px dashed var(--border);
    cursor: pointer;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%238E8E93' 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 16px center;
    background-size: 18px;
    padding-right: 48px;
}

/* === BUTTONS === */
.btn {
    display: block;
    width: 100%;
    padding: 16px 24px;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: white;
    background: var(--primary);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.1s ease;
}

.btn:active {
    opacity: 0.85;
    transform: scale(0.98);
}

.btn-success {
    background: var(--success);
}

.btn-danger {
    background: var(--danger);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

/* === STATS GRID === */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card);
    padding: 16px;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.stat-card .label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 22px;
    font-weight: 700;
    margin-top: 4px;
}

/* === LIST ITEMS === */
.list-item {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--card);
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease;
}

.list-item:active {
    transform: scale(0.98);
}

.list-item-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.list-item-avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--input-bg);
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.list-item-info .name {
    font-size: 17px;
    font-weight: 600;
}

.list-item-info .detail {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* === PROGRESS BAR === */
.progress-container {
    margin-bottom: 8px;
}

.progress-bar {
    height: 8px;
    background: var(--input-bg);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar .fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* === BOTTOM NAVIGATION === */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    flex: 1;
    height: 100%;
    gap: 4px;
    transition: color 0.2s ease;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item svg,
.nav-item .icon {
    width: 26px;
    height: 26px;
}

.nav-item span {
    font-size: 11px;
    font-weight: 600;
}

/* === UTILITIES === */
.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-muted {
    color: var(--text-secondary);
}

.text-center {
    text-align: center;
}

.mt-16 {
    margin-top: 16px;
}

.mt-24 {
    margin-top: 24px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-24 {
    margin-bottom: 24px;
}

/* === HEADER === */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #1C1C1E;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
}

/* === BADGE === */
.badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
}

.badge-success {
    background: rgba(52, 199, 89, 0.15);
    color: var(--success);
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state p {
    margin-bottom: 16px;
}

.empty-state a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}