* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --border: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    min-height: 100vh;
    color: var(--text-dark);
}

/* Splash Screen */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.splash-content {
    text-align: center;
    color: white;
}

.splash-content h1 {
    font-size: 80px;
    margin-bottom: 20px;
}

.splash-content h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Login Container */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.app-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.login-header h1 {
    font-size: 24px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-light);
    font-size: 14px;
}

/* Form Styles */
.login-form {
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Password Field with Toggle */
.password-field {
    position: relative;
    display: block;
}

.password-field input {
    width: 100%;
    padding: 14px 50px 14px 16px !important;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
}

.password-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.password-field i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    font-size: 18px;
    transition: color 0.2s;
    z-index: 10;
    pointer-events: auto;
}

.password-field i:hover {
    color: var(--primary);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(72, 187, 120, 0.4);
}

.btn-success:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

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

.btn-secondary:hover {
    background: var(--text-dark);
}

.btn-thirdary {
    background: transparent;
    border: 2px solid var(--text-light);
    color: var(--text-light);
}

.btn-thirdary:hover {
    background: var(--text-light);
    color: white;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    transition: transform 0.3s;
}

.btn-icon:hover {
    transform: scale(1.1);
}

.btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Error Message */
.error-message {
    background: #fee;
    color: var(--danger);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    border: 1px solid #fcc;
}

/* Login Footer */
.login-footer {
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Dashboard Styles */
.app-container {
    min-height: 100vh;
    background: var(--bg-light);
}

.app-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 16px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.header-content h1 {
    font-size: 20px;
    font-weight: 600;
}

/* User Info Card */
.user-info-card {
    background: white;
    margin: 15px;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    grid-template-columns: repeat(2, 1fr);
}

.user-details h3 {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.user-details p {
    font-size: 13px;
    color: var(--text-light);
    margin: 2px 0;
}

/* Main Content */

.app-main {
    padding: 32px 24px 24px 24px;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .app-main {
        padding: 18px 12px 16px 12px;
    }
}

/* EXPERIMENT: Horizontal Compact Layout - 2026-04-28 */
/* Grid 2 columns with compact horizontal cards */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 0 1rem;
    margin-bottom: 1rem;
}

.dashboard-card {
    background: white;
    padding: 14px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    cursor: pointer;
    text-align: center;
    min-height: 120px;
    justify-content: center;
    position: relative;
    /* Required for "Soon" badge positioning */
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    background: #fafbff;
}

.dashboard-card.coming-soon {
    position: relative;
}

.dashboard-card.coming-soon .card-icon,
.dashboard-card.coming-soon .dashboard-card-content {
    opacity: 0.6;
}

.dashboard-card.coming-soon::after {
    content: 'Soon';
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ffd89b 0%, #ffb347 100%);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.card-icon {
    font-size: 32px;
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f0f4ff 0%, #e8edff 100%);
    border-radius: 12px;
}

.dashboard-card-content {
    flex: 1;
    text-align: center;
    width: 100%;
}

.dashboard-card h3 {
    font-size: 15px;
    color: var(--text-dark);
    margin-bottom: 4px;
    font-weight: 600;
    line-height: 1.3;
}

.dashboard-card p {
    font-size: 12px;
    color: var(--text-light);
    margin: 0;
    line-height: 1.4;
}

.dashboard-card .btn {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ORIGINAL VERTICAL LAYOUT (backup for revert):
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0 1rem;
    margin-bottom: 1rem;
}

.dashboard-card {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: transform 0.3s;
}

.dashboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.card-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.dashboard-card h3 {
    font-size: 20px;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.dashboard-card p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 20px;
}
*/

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-dark);
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

.toast-success {
    background: var(--success);
}

.toast-error {
    background: var(--danger);
}

/* Filter Section */
.filter-section {
    background: white;
    padding: 1rem;
    margin: 15px 15px 14px 15px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-row label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4a5568;
    min-width: 30px;
    white-space: nowrap;
}

.filter-row input[type="date"],
.filter-row select {
    flex: 1;
    padding: 8px 10px;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #2d3748;
    font-family: 'Outfit', sans-serif;
}

.filter-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 0 1rem;
    margin-bottom: 1rem;
}

.summary-card {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.summary-icon {
    font-size: 2rem;
}

/* Store Activity / Form Card */
.main-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.form-card {
    background: white;
    padding: 24px;
    border-radius: 16px;
    /* box-shadow: 0 2px 8px rgba(0,0,0,0.06); */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin: 15px 1rem 1rem 1rem;
}

.form-card .form-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
    flex-wrap: wrap;
}

.form-card .form-group {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
}

.form-card .spacer {
    visibility: hidden;
}

.form-card label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-card select,
.form-card textarea,
.form-card input[type="file"],
.form-card input[type="text"],
.form-card input[type="number"] {
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 14px;
    height: 44px;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

/* Specific styling for select to prevent stretching */
.form-card select {
    padding-right: 32px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* Keep select sizing stable on focus and when content changes */
.form-card select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.08);
}

.photo-preview {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.photo-preview img {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

@media (max-width: 600px) {
    .form-card .form-row {
        flex-direction: column;
    }
}

/* Mobile improvements for store-activity form */
@media (max-width: 480px) {
    .form-card {
        padding: 20px 16px;
        margin: 0 0.75rem 1rem 0.75rem;
        margin-top: 15px;
    }

    .form-card h2 {
        font-size: 22px;
        margin-bottom: 16px;
    }

    .form-card .form-row {
        gap: 10px;
    }

    .form-card .form-group {
        flex: 1 1 100%;
        width: 100%;
    }

    .form-card label {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .form-card select,
    .form-card textarea,
    .form-card input[type="file"],
    .form-card input[type="text"],
    .form-card input[type="number"] {
        padding: 10px 12px;
        font-size: 15px;
        height: 44px;
    }

    .form-card select {
        padding-right: 32px;
    }

    .form-card textarea {
        min-height: 90px;
        padding: 10px 12px;
    }

    .photo-preview img {
        width: 64px;
        height: 64px;
    }

    .form-card .form-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-top: 16px;
    }

    .form-card .form-actions .btn {
        width: 100%;
        padding: 12px 20px;
    }

    .form-help {
        font-size: 11px;
        line-height: 1.3;
    }
}

/* input with icon */
.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-with-icon .icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 18px;
    pointer-events: none;
}

.input-with-icon select,
.input-with-icon textarea,
.input-with-icon input[type="text"] {
    padding-left: 38px;
    flex: 1;
    width: 100%;
}

.form-card textarea {
    min-height: 96px;
    padding: 12px 14px;
}

.form-card .form-group {
    margin-bottom: 12px;
}

.form-card h2 {
    margin: 0 0 12px 0;
    color: var(--text-dark);
}

.summary-content h4 {
    margin: 0;
    font-size: 1.5rem;
    color: #667eea;
}

.summary-content p {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: #718096;
}

/* Records List */
.records-list {
    padding: 0;
}

.record-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0 15px 1rem 15px;
    overflow: hidden;
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.record-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.time-icon {
    font-size: 1.2rem;
}

.record-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-completed {
    background: #48bb78;
    color: white;
}

.status-pending {
    background: #ed8936;
    color: white;
}

.record-body {
    padding: 1rem;
}

.record-body h4 {
    margin: 0 0 1rem;
    color: #2d3748;
}

.record-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.record-detail {
    display: flex;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.detail-label {
    color: #718096;
    min-width: 100px;
}

.detail-value {
    color: #2d3748;
    font-weight: 500;
}

.record-photo {
    padding: 0 1rem 1rem;
}

.record-photo img {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.record-photo img:hover {
    transform: scale(1.02);
}

/* States */
.loading-state,
.empty-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.empty-icon,
.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state h3,
.error-state h3 {
    margin: 0 0 0.5rem;
    color: #2d3748;
}

.empty-state p,
.error-state p {
    margin: 0;
    color: #718096;
}

/* Responsive */
@media (max-width: 768px) {
    .login-card {
        padding: 30px 24px;
    }

    /* Keep 2 columns on mobile for compact layout */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.65rem;
        padding: 0 0.75rem;
    }

    .dashboard-card {
        padding: 12px 10px;
        min-height: 100px;
    }

    .card-icon {
        font-size: 26px;
        width: 42px;
        height: 42px;
    }

    .dashboard-card h3 {
        font-size: 13px;
        line-height: 1.2;
    }

    .dashboard-card p {
        font-size: 10px;
        line-height: 1.3;
    }

    /* Adjust Soon badge for smaller cards */
    .dashboard-card.coming-soon::after {
        font-size: 8px;
        padding: 2px 6px;
        top: 6px;
        right: 8px;
    }
}

@media (min-width: 601px) {
    .mobile-only {
        display: none !important;
    }
}

/* Bottom Navigation Bar */
.bottom-nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 66px;
    background: #fff;
    border-top: 1px solid #eef2f6;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.03);
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-bar a {
    transition: all 0.2s ease;
}

.bottom-nav-bar a:active {
    transform: scale(0.92);
}

/* Shimmering Skeleton Loader for Bottom Navigation Bar */
.bottom-nav-bar-skeleton {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    height: 100%;
    padding: 0 10px;
    box-sizing: border-box;
}

.bottom-nav-bar-skeleton .skeleton-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.bottom-nav-bar-skeleton .skeleton-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e2e8f0;
}

.bottom-nav-bar-skeleton .skeleton-label {
    width: 36px;
    height: 8px;
    border-radius: 4px;
    background: #e2e8f0;
}

.bottom-nav-bar-skeleton .skeleton-center {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #e2e8f0;
    transform: translateY(-10px);
}

.skeleton-shimmer {
    background: linear-gradient(90deg, #f0f4f8 25%, #e2e8f0 50%, #f0f4f8 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer-anim 1.5s infinite linear;
}

@keyframes skeleton-shimmer-anim {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}