:root {
    --bg-dark: #0f172a;       /* Dark Blue/Black */
    --card-bg: #1e293b;       /* Lighter Card */
    --text-primary: #f1f5f9;  /* White/Grey */
    --text-secondary: #94a3b8;
    --accent: #10b981;        /* Green */
    --border: #334155;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
}

.container {
    max_width: 1200px;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.status-badge {
    background: #064e3b;
    color: var(--accent);
    padding: 5px 15px;
    border-radius: 20px;
    border: 1px solid var(--accent);
    font-size: 0.9em;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
}

.card h3 {
    margin-top: 0;
    font-size: 1em;
    color: var(--text-secondary);
}

.big-number {
    font-size: 2em;
    font-weight: bold;
    margin: 10px 0;
}

.sub-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 10px;
}

/* Form Styling */
input[type="number"], input[type="text"], input[type="password"] {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: white;
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.btn {
    background-color: var(--accent);
    color: #000;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    opacity: 0.9;
}

.nav-link {
    color: var(--text-secondary);
    margin-left: 15px;
    text-decoration: none;
}
/* Logo Styling */
.header-logo {
    height: 50px; /* Adjust based on your logo aspect ratio */
    margin-right: 15px;
    vertical-align: middle;
}

/* Floating Refresh Button */
.refresh-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--accent); /* Green */
    color: #000;
    border: none;
    padding: 15px 25px;
    border-radius: 50px; /* Pill shape */
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    
    /* Animation settings */
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.refresh-fab:hover {
    background-color: #fff;
}

/* Class to hide the button while scrolling */
.refresh-fab.is-hidden {
    opacity: 0;
    transform: translateY(20px); /* Slide down slightly */
    pointer-events: none; /* Prevent clicking while hidden */
}

/* --- iPhone app (PWA) --- */
.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn:disabled {
    opacity: 0.6;
}

.pwa-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: var(--text-secondary);
}

.pwa-msg {
    flex-basis: 100%;
    color: var(--text-secondary);
    font-size: 0.9em;
    margin-top: 8px;
}

.pwa-msg:empty {
    display: none;
}

/* Phone layout */
@media (max-width: 600px) {
    body {
        padding: 12px;
        padding-top: calc(12px + env(safe-area-inset-top));
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        padding-left: calc(12px + env(safe-area-inset-left));
        padding-right: calc(12px + env(safe-area-inset-right));
        -webkit-text-size-adjust: 100%;
    }

    .header {
        flex-wrap: wrap;
        gap: 12px;
        margin-bottom: 20px;
    }

    .header h1 {
        font-size: 1.3em;
    }

    .header-logo {
        height: 36px;
        margin-right: 10px;
    }

    /* 16px stops iOS zooming the page when a field is tapped */
    input[type="number"], input[type="text"], input[type="password"], input[type="date"] {
        font-size: 16px;
    }

    .pwa-bar .btn {
        flex: 1 1 100%;
    }

    .refresh-fab {
        bottom: calc(20px + env(safe-area-inset-bottom));
        right: 20px;
        padding: 12px 20px;
    }
}
