:root {
    --primary: #0a4d8c;
    --primary-light: #1a6fba;
    --primary-dark: #083d70;
    --accent: #CC009C;
    --bg-light: #e8f4fc;
    --bg-white: #ffffff;
    --text-dark: #041026;
    --text-muted: #5a7a94;
    --border-color: #d0e8f7;
    --success: #25D366;
    
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 8px rgba(10, 77, 140, 0.08);
    --shadow-md: 0 8px 24px rgba(10, 77, 140, 0.12);
    --shadow-lg: 0 16px 32px rgba(10, 77, 140, 0.16);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    padding-bottom: 100px; /* Space for sticky button */
}

/* Header */
.topbar {
    background-color: var(--primary);
    color: white;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.logo i {
    width: 24px;
    height: 24px;
    color: var(--accent);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
}

.hidden {
    display: none !important;
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* Cards */
.card {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(255,255,255,0.8);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bg-light);
}

.card-header i {
    color: var(--primary-light);
    width: 20px;
    height: 20px;
}

.card-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary);
}

/* Inputs */
.input-group {
    margin-bottom: 1.25rem;
}

.input-group:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-light);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.2s ease;
    outline: none;
}

input:focus, select:focus {
    background: var(--bg-white);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(26, 111, 186, 0.1);
}

/* Currency Input */
.currency-input {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    padding-left: 1rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.currency-input:focus-within {
    background: var(--bg-white);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(26, 111, 186, 0.1);
}

.currency-input span {
    color: var(--text-muted);
    font-weight: 500;
}

.currency-input input {
    background: transparent;
    border: none;
    padding-left: 0.5rem;
}

.currency-input input:focus {
    box-shadow: none;
    background: transparent;
}

/* File Upload */
.file-upload-wrapper {
    position: relative;
    width: 100%;
    height: 60px;
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.file-upload-trigger {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-light);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: var(--primary-light);
    font-weight: 600;
    transition: all 0.2s ease;
}

.file-upload-wrapper:hover .file-upload-trigger {
    background: #dbe9f4;
    border-color: var(--primary-light);
}

.image-preview {
    margin-top: 0.75rem;
    display: none;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.image-preview img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.image-preview.has-image {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Switches / Toggles */
.occurrence-section {
    margin-bottom: 1rem;
}

.occurrence-header {
    margin-bottom: 1rem;
}

.switch-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    cursor: pointer;
}

.occurrence-title {
    font-weight: 600;
    color: var(--primary);
    font-size: 1rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

input:checked + .slider {
    background-color: var(--accent);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* Collapsible Content */
.collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    opacity: 0;
}

.collapsible-content.expanded {
    max-height: 1000px;
    opacity: 1;
    margin-top: 1rem;
}

.divider {
    height: 1px;
    background-color: var(--bg-light);
    margin: 1.5rem 0;
}

/* Buttons */
.actions {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--bg-light);
    z-index: 90;
    display: flex;
    justify-content: center;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 16, 38, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loading-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
