* {
    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);
}

/* 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-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;
    }
}

.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: 1rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.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: 22px;
    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: 0 1rem 1rem 1rem;
    margin-top: 15px;
}
.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; }
.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:12px 14px;
    border-radius:10px;
    border:1px solid var(--border);
    background: #fff;
    font-size:14px;
    height:48px;
    box-sizing:border-box;
}

/* 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: 22px;
        margin: 0 1rem 1rem 1rem;
        margin-top: 15px;
    }

    .form-card .form-row {
        gap: 10px;
    }
    .form-card .form-group {
        flex: 1 1 100%;
        width: 100%;
    }
    .form-card label { font-size: 13px; }
    .form-card select,
    .form-card textarea,
    .form-card input[type="file"],
    .form-card input[type="text"],
    .form-card input[type="number"] {
        padding: 12px 14px;
        font-size: 15px;
    }
    .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%; }
}

/* input with icon */
.input-with-icon{ position:relative; display:flex; align-items:center; }
.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; }
.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 1rem 1rem;
}

.record-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    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;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

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