@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #fff1f2; /* Rose 50 */
    --card-bg: rgba(255, 255, 255, 0.85);
    --border-color: rgba(225, 29, 72, 0.15); /* Rose 600 alpha */
    --accent-color: #db2777; /* Pink 600 */
    --accent-glow: rgba(219, 39, 119, 0.15);
    --text-primary: #4c0519; /* Rose 950 */
    --text-secondary: #9d174d; /* Rose 800 */
    --danger: #e11d48;
    --warning: #f59e0b;
    --success: #059669;
    --glass-blur: blur(8px);
    --unit: 12px;
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

h1, h2, h3, .brand {
    font-family: 'Outfit', sans-serif;
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 12px;
    padding-top: 16px;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(8px); /* Lighter blur for performance */
    border: 1px solid var(--border-color);
    border-radius: 12px; /* Slightly tighter radius */
    padding: 16px; /* Compact padding */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Lighter shadow */
    margin-bottom: 12px;
    transition: none; /* Disable transitions to save RAM */
}

/* Typography */
.section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.sub-section-header {
    margin-bottom: 12px; 
    color: var(--accent-color); 
    font-size: 14px; 
    text-transform: uppercase;
}

.form-sub-section {
    background: rgba(219, 39, 119, 0.04);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px dashed var(--border-color);
}

/* Forms */
.form-group {
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(225, 29, 72, 0.06);
}

.form-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 13px; /* Slightly smaller for mobile */
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--accent-color);
}

select, input[type="text"], input[type="number"], input[type="date"], input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

select:focus, input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px var(--accent-glow);
}

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

.btn-primary {
    background: var(--accent-color);
    color: white;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    backdrop-filter: var(--glass-blur);
}

.btn:hover {
    filter: brightness(1.1);
}

.btn:active {
    transform: scale(0.98);
}

/* Navigation & Pages */
.page {
    display: none;
}

.page.active {
    display: block;
}



/* Button Loading State */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

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

/* Checkbox Group */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(255, 255, 255, 0.3);
    padding: 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-primary);
}

.checkbox-item input {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    cursor: pointer;
}

/* Dashboard Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* RTL / List Items */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
}

.list-item:last-child {
    border-bottom: none;
}

/* Responsive */
@media (max-width: 480px) {
    .app-container {
        padding: 8px; /* Even tighter for small screens */
    }
    .glass-card {
        padding: 12px;
    }
}
