:root {
    --primary-color: #696cff;
    --primary-hover: #5f61e6;
    --bg-light: #f5f5f9;
    --text-dark: #32475c;
    --text-muted: #8592a3;
    --white: #ffffff;
    --border-color: #e4e6f4;
    --shadow-sm: 0 0.125rem 0.25rem rgba(161, 172, 184, 0.2);
    --shadow-md: 0 0.25rem 0.5rem rgba(161, 172, 184, 0.3);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.05);
    min-height: 100vh;
}
html {
    background-color: #e9ecef;
}

/* Utilities */
.text-primary-custom { color: var(--primary-color) !important; }
.bg-primary-custom { background-color: var(--primary-color) !important; color: var(--white); }

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    border-radius: var(--radius-md);
    padding: 0.6rem 1.2rem;
    font-weight: 600;
}
.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Cards & Tiles */
.card-custom {
    background: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-custom:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Form inputs */
.form-control {
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
}
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(105, 108, 255, 0.1);
}

/* Topbar */
.app-topbar {
    background: var(--white);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.app-topbar .app-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-dark);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: rgba(105, 108, 255, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* RCP Hero Button */
.btn-rcp {
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(105, 108, 255, 0.2);
}

/* Grid Tiles */
.tile {
    text-decoration: none;
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    text-align: center;
    height: 100%;
}
.tile .tile-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    background: rgba(105, 108, 255, 0.1);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tile .tile-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin: 0;
}

/* Select Company List */
.company-list-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-dark);
    transition: background-color 0.2s;
}
.company-list-item:hover {
    background-color: var(--bg-light);
}
.company-list-item:last-child {
    border-bottom: none;
}
.company-logo-placeholder {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background-color: var(--primary-color);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-right: 1rem;
}

/* Location Loader & Animations */
.location-loader {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.location-loader .pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: rgba(105, 108, 255, 0.4);
    border-radius: 50%;
    z-index: 1;
    animation: pulse-animation 1.5s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}

@keyframes pulse-animation {
    0% { transform: scale(0.5); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

@keyframes bounce-pin {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(-10deg); }
    50% { transform: translateY(0) rotate(0deg); }
    75% { transform: translateY(-5px) rotate(10deg); }
}

.bouncing-pin {
    animation: bounce-pin 1.2s infinite ease-in-out;
    display: inline-block;
}

/* Text Fade Transition */
.fade-transition {
    transition: opacity 0.4s ease-in-out;
}
.fade-out {
    opacity: 0 !important;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 1rem;
}
.calendar-header-day {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    padding-bottom: 5px;
}
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background-color: var(--white);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    position: relative;
    box-shadow: 0 2px 4px rgba(161, 172, 184, 0.1);
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}
.calendar-day.empty {
    background-color: transparent;
    box-shadow: none;
    cursor: default;
}
.calendar-day:active:not(.empty) {
    transform: scale(0.95);
}
.calendar-day.active {
    background-color: var(--primary-color);
    color: var(--white);
}
.calendar-day .shift-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 3px;
}
.calendar-day .shift-dot.blue { background-color: var(--primary-color); }
.calendar-day .shift-dot.green { background-color: #71dd37; }
.calendar-day .shift-dot.purple { background-color: #e83e8c; }
.calendar-day.active .shift-dot { background-color: var(--white) !important; }

/* Custom Badges (Sneat style) */
.bg-label-primary {
    background-color: rgba(105, 108, 255, 0.16) !important;
    color: var(--primary-color) !important;
}
.bg-label-success {
    background-color: rgba(113, 221, 55, 0.16) !important;
    color: #71dd37 !important;
}
.bg-label-warning {
    background-color: rgba(255, 171, 0, 0.16) !important;
    color: #ffab00 !important;
}
.bg-label-danger {
    background-color: rgba(255, 62, 29, 0.16) !important;
    color: #ff3e1d !important;
}
.bg-label-secondary {
    background-color: rgba(133, 146, 163, 0.16) !important;
    color: #8592a3 !important;
}

/* Custom Nav Pills */
.nav-pills .nav-link {
    background-color: var(--white);
    color: var(--text-muted);
    transition: all 0.2s ease-in-out;
}
.nav-pills .nav-link.active, .nav-pills .show > .nav-link {
    background-color: var(--primary-color) !important;
    color: var(--white) !important;
    box-shadow: 0 0.125rem 0.25rem rgba(105, 108, 255, 0.4) !important;
}

/* Floating Action Button (FAB) */
.fab-wrapper {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px; /* same as body max-width */
    display: flex;
    justify-content: flex-end;
    padding-right: 20px;
    z-index: 1050;
    pointer-events: none; /* Allows clicking through the wrapper */
}

.fab-btn {
    pointer-events: auto;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 0.5rem 1rem rgba(105, 108, 255, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    padding: 0;
}

.fab-btn:active {
    transform: scale(0.92);
}

