/* Daycare Operations Premium CSS Styling (v2 upgraded) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --font-primary: 'Inter', sans-serif;
    --font-header: 'Outfit', sans-serif;
    
    /* HSL Elegant Color Palette */
    --hue: 215;
    --primary: hsl(var(--hue), 85%, 55%);
    --primary-hover: hsl(var(--hue), 85%, 45%);
    --primary-light: hsl(var(--hue), 90%, 96%);
    --bg-app: hsl(var(--hue), 30%, 97%);
    --bg-card: hsla(0, 0%, 100%, 0.85);
    --text-main: hsl(var(--hue), 25%, 15%);
    --text-muted: hsl(var(--hue), 15%, 45%);
    --border-color: hsl(var(--hue), 20%, 90%);
    
    /* Accents */
    --success: hsl(145, 75%, 42%);
    --success-light: hsl(145, 75%, 95%);
    --danger: hsl(355, 80%, 55%);
    --danger-light: hsl(355, 80%, 96%);
    --warning: hsl(40, 90%, 50%);
    --warning-light: hsl(40, 90%, 95%);
    --info: hsl(200, 80%, 50%);
    
    /* Shadows & Border Radii */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 15px 45px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

/* Glassmorphism Container */
.glass-container {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: var(--shadow-md);
}

/* Auth Page layout */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: radial-gradient(circle at top right, hsl(var(--hue), 80%, 90%), var(--bg-app));
}

.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header h1 {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 8px;
}

.auth-header p {
    font-size: 14px;
    color: var(--text-muted);
}

.lang-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.lang-btn:hover, .lang-btn.active {
    color: var(--primary);
    background: var(--primary-light);
}

/* Inputs & Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: var(--font-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: #ffffff;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsla(var(--hue), 85%, 55%, 0.15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #ffffff;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background-color: var(--danger);
    color: #ffffff;
}

.btn-danger:hover {
    background-color: hsl(355, 80%, 45%);
}

.btn-success {
    background-color: var(--success);
    color: #ffffff;
}

.btn-success:hover {
    background-color: hsl(145, 75%, 35%);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
}

/* Alert Boxes */
.alert {
    padding: 15px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 20px;
    border-left: 4px solid transparent;
}

.alert-danger {
    background-color: var(--danger-light);
    color: hsl(355, 80%, 25%);
    border-left-color: var(--danger);
}

.alert-success {
    background-color: var(--success-light);
    color: hsl(145, 75%, 20%);
    border-left-color: var(--success);
}

.alert-warning {
    background-color: var(--warning-light);
    color: hsl(40, 90%, 20%);
    border-left-color: var(--warning);
}

/* Local OTP Debug Banner */
.debug-banner {
    background: #111;
    color: #00ff00;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    text-align: center;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: #0f172a; /* Premium dark background */
    color: #f8fafc;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-brand {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 22px;
    color: #ffffff;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-tenant {
    font-size: 12px;
    color: #94a3b8;
    background: #1e293b;
    padding: 6px 12px;
    border-radius: 20px;
    margin-bottom: 30px;
    text-align: center;
    font-weight: 500;
}

.sidebar-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.menu-item > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.menu-item > a:hover {
    color: #ffffff;
    background: #1e293b;
}

.menu-item.active > a {
    color: #ffffff;
    background: var(--primary);
}

/* Sidebar Submenus */
.submenu {
    list-style: none;
    padding-left: 48px; /* Indented to align inside the parent section */
    margin-top: 6px;
    margin-bottom: 6px;
    display: none;
    flex-direction: column;
    gap: 4px;
}

.menu-item.active .submenu {
    display: flex;
}

.menu-item:not(.active) .submenu {
    display: none !important; /* Strictly disappear when not on that page */
}

.submenu li a {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 12px !important;
    padding: 6px 12px !important;
    color: #64748b !important;
    background: transparent !important;
    font-weight: 400 !important;
    border-left: 2px solid #334155;
    border-radius: 0 !important;
    transition: all 0.2s ease;
}

.submenu li a:hover {
    color: #ffffff !important;
    background: transparent !important;
    border-left-color: var(--primary);
}

.sidebar-footer {
    padding-top: 20px;
    border-top: 1px solid #1e293b;
}

.user-profile {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 15px;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    color: #ffffff;
}

.user-role {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Main Content Area */
.main-content {
    flex-grow: 1;
    margin-left: 280px;
    padding: 40px;
    background-color: var(--bg-app);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
}

.content-header h2 {
    font-family: var(--font-header);
    font-size: 26px;
    font-weight: 600;
    color: var(--text-main);
}

.lang-switch-inline {
    display: flex;
    gap: 8px;
}

/* Cards & Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.grid-form-auto {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 20px;
    align-items: flex-end;
}

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 22px;
    color: var(--text-main);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: background 0.2s;
}

.mobile-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99;
}

@media (max-width: 1024px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .grid-form-auto {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    body.sidebar-open .sidebar {
        transform: translateX(0);
    }
    
    body.sidebar-open .sidebar-overlay {
        display: block;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 20px 15px !important;
    }
    
    .mobile-menu-toggle {
        display: block !important;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .lang-switch-inline {
        width: 100%;
        justify-content: flex-end;
    }
}

.card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 25px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 25px;
}

.card-title {
    font-family: var(--font-header);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Digital Clock Widget */
.clock-widget {
    background: linear-gradient(135deg, var(--primary), hsl(var(--hue), 85%, 40%));
    color: #ffffff;
    padding: 30px;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-md);
}

.clock-time {
    font-family: var(--font-header);
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.clock-date {
    font-size: 14px;
    opacity: 0.8;
    font-weight: 500;
    text-transform: uppercase;
}

/* Tables styling */
.table-responsive {
    overflow-x: auto;
    width: 100%;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    text-align: left;
}

.table th, .table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    background: var(--primary-light);
}

.table tr:hover {
    background-color: var(--primary-light);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-info {
    background: var(--primary-light);
    color: var(--primary);
}

/* Safety Ratio Warning Badges */
.badge-ratio-danger {
    background: var(--danger-light);
    color: var(--danger);
    font-size: 11px;
    border: 1px solid var(--danger);
    font-weight: 700;
    border-radius: 20px;
    padding: 2px 10px;
}

.badge-ratio-success {
    background: var(--success-light);
    color: var(--success);
    font-size: 11px;
    border: 1px solid var(--success);
    font-weight: 700;
    border-radius: 20px;
    padding: 2px 10px;
}

/* Credentials Grid */
.credentials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.credential-card {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.credential-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.cred-category {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.cred-name {
    font-family: var(--font-header);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-main);
}

.cred-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 13px;
}

.cred-label {
    color: var(--text-muted);
    font-weight: 500;
}

.cred-val {
    font-family: monospace;
    font-weight: 600;
}

.cred-val.blurred {
    filter: blur(4px);
    user-select: none;
}

.cred-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    gap: 8px;
}

/* Guideline Feedback Comments Section */
.guideline-comments-list {
    margin-top: 15px;
    padding-left: 20px;
    border-left: 2px solid var(--border-color);
}

.comment-bubble {
    background: var(--bg-app);
    padding: 10px 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    font-size: 13px;
}

.comment-author {
    font-weight: 600;
    font-size: 12px;
    color: var(--primary);
    margin-bottom: 4px;
}

/* Toast Message */
.toast-msg {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #1e293b;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Modal styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 500px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

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

.modal-header h3 {
    font-family: var(--font-header);
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    cursor: pointer;
    font-size: 20px;
    color: var(--text-muted);
}
