/* Theme variables and shared components - HRMS UI Color Scheme */
:root {
    /* App background token (use across pages) - Dark gradient background */
    --app-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 35%, #334155 100%);

    /* Color Palette - HRMS Theme */
    --primary: #1e40af;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --secondary: #0f172a;
    --accent: #f59e0b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Spacing & Dimensions */
    --radius: 12px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50px;

    /* Shadows */
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
    --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

    /* Typography */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    --line-height-base: 1.6;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Z-Index Scale */
    --z-background: 0;
    --z-base: 1;
    --z-footer: 10;
    --z-modal: 100;
    --z-notification: 1000;

    --primary-gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    --sidebar-bg: linear-gradient(180deg, #1a1f2e 0%, #0f1419 100%);
    /* White cards on dark background */
    --card-bg: #ffffff;
    /* Page surface - transparent to show dark gradient background */
    --page-bg: transparent;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
}

/* Glass Card Effect / Base Card */
.glass-card, .card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: var(--shadow-xl);
    transition: var(--transition-base);
}

.glass-card:hover, .card:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(-4px);
}

/* Ensure content inside card surfaces is readable (dark on light) */
.glass-card, .card, .tenant-card, .card-section, .login-section {
    color: var(--text-primary);
}

/* Inputs & form typography — use Manrope for typed text for a modern, friendly look */
input, textarea, select, button, .form-control {
    font-family: 'Manrope', var(--font-family-base);
    font-weight: 500;
    letter-spacing: 0.1px;
}

/* Feature / small info card used on login/hero */
.feature-card {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius);
    padding: clamp(0.875rem, 2vh, 2rem);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(21, 58, 155, 0.45);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(21, 58, 155, 0.12) inset;
}

.feature-icon {
    width: clamp(44px, 7vh, 72px);
    height: clamp(44px, 7vh, 72px);
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: clamp(0.5rem, 1.5vh, 1.25rem);
    font-size: clamp(1.1rem, 2.5vh, 1.75rem);
    color: var(--white);
    flex-shrink: 0;
    transition: all var(--transition-base);
}

/* Login container / card */
.login-section {
    position: relative;
    flex-shrink: 0;
    background: var(--white);
    padding: 0.875rem;
    padding-top: 1.5rem;
    padding-bottom: 1.25rem;
    padding-right: 1rem;
    border-radius: var(--radius);
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.35), 0 18px 36px -18px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.05);
    width: clamp(375px, 32vw, 520px);
    z-index: var(--z-modal);
    animation: fadeInRight 0.8s ease forwards;
    margin: 1rem;
    margin-top: 6vh;
    align-self: flex-start;
}

.login-container { width: 100%; }

.host-badge {
    position: absolute;
    top: -20px;
    right: 16px;
    background: var(--primary);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow);
    z-index: 10;
}

.login-brand { text-align: center; margin-bottom: 0.5rem; }

.login-brand-logo {
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--white);
    margin: 0 auto 0.5rem;
    box-shadow: var(--shadow);
}

.login-brand-name { font-size: 1.35rem; font-weight: 700; color: var(--gray-900); margin-bottom: 0.25rem; }
.login-brand-tagline { font-size: 0.8rem; color: var(--gray-500); font-weight: 500; }

/* Form components */
.form-group { margin-bottom: 0.5rem; }
.form-label { display: block; font-weight: 500; margin-bottom: 0.25rem; color: var(--gray-700); font-size: 0.8rem; }
.form-input {
    width: 100%;
    padding: 0.75rem 0.875rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all var(--transition-base);
    background: var(--white);
    font-family: inherit;
    line-height: 1.2;
    min-height: 44px;
}

.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1); background: var(--white); }
.form-input::placeholder { color: var(--gray-600); opacity: 1; }

/* Buttons */
.btn-primary {
    background: linear-gradient(180deg, var(--primary-light), var(--primary));
    color: var(--white);
    padding: 0.65rem 1.2rem;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    transition: all 0.18s ease;
    border: 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(15, 45, 120, 0.24);
    font-family: inherit;
    min-height: 44px;
}

/* Global app overrides - HRMS UI theme */
body {
    background: var(--app-bg) !important;
    color: var(--text-primary);
    min-height: 100vh;
    font-family: var(--font-family-base);
    line-height: var(--line-height-base);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background overlay pattern */
.bg-overlay {
    position: fixed;
    inset: 0;
    background: url('data:image/svg+xml,<svg width="80" height="80" viewBox="0 0 80 80" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="smallGrid" width="8" height="8" patternUnits="userSpaceOnUse"><path d="M 8 0 L 0 0 0 8" fill="none" stroke="%23334155" stroke-width="0.5" opacity="0.1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23smallGrid)"/></svg>') repeat;
    pointer-events: none;
    z-index: var(--z-background);
}

.nav-header {
    background: var(--white) !important;
    color: var(--gray-900) !important;
    border-bottom: 1px solid var(--gray-200) !important;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: var(--z-modal);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hide nav-header when user scrolls down */
.nav-header.navbar-hidden {
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
}

.nav-link, .nav-link i, .nav-link span {
    color: var(--gray-600) !important;
}

.nav-link.active, .nav-link:hover {
    background: var(--primary) !important;
    color: var(--white) !important;
}

.footer {
    background: var(--gray-900) !important;
    color: var(--gray-300) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 -1px 3px 0 rgb(0 0 0 / 0.3);
}

.page-header, .page-title { color: var(--white) !important; }
.page-subtitle { color: var(--gray-300) !important; }

/* Make primary buttons slightly richer and retain accessibility */
.btn-primary {
    background: linear-gradient(180deg, var(--primary-light), var(--primary));
    border: 0;
    color: var(--white);
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: #f5f7fa;
    color: #4f5d75;
    padding: 0.65rem 1.2rem;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    transition: all var(--transition-base);
    border: 1px solid #dce1e8;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    font-family: inherit;
    min-height: 44px;
}

.btn-secondary:hover { background: var(--gray-100); color: var(--primary); }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: var(--radius); margin-bottom: 1.5rem; font-size: 0.875rem; border: 1px solid; display: flex; align-items: center; gap: 0.5rem; }
.alert-error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }

/* Footer */
.footer { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px); border-top: 1px solid rgba(255, 255, 255, 0.1); padding: 1rem 2rem; color: var(--gray-100); font-size: 0.875rem; z-index: var(--z-footer); }
.footer-content { display: flex; justify-content: space-between; align-items: center; max-width: 1400px; margin: 0 auto; }
.footer-links { display: flex; gap: 2rem; }
.footer-links a { color: var(--gray-500); text-decoration: none; transition: color var(--transition-base); }
.footer-links a:hover { color: var(--white); }

/* Animations (kept minimal here) */
@keyframes fadeInRight { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

/* ---------------------------------------------------------------
   Utility & Tenant Manager specific helpers
   --------------------------------------------------------------- */
.card-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1rem;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    margin-top: 1rem;
}

.form-row {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.divider {
    border: none;
    border-top: 1px solid rgba(0,0,0,0.06);
    margin: 0.75rem 0;
}

.meta-count {
    margin-left: auto;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--gray-600);
}

.tenant-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-top: 0.75rem;
}

.tenant-card {
    padding: 1rem;
    background: var(--white);
    border: 1px solid rgba(15, 23, 42, 0.04);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

.card-actions { display:flex; gap:0.5rem; justify-content:flex-end; margin-top:0.6rem; }

.btn-outline-primary {
    background: var(--white);
    color: var(--primary);
    border: 1px solid var(--primary);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.mb-1 { margin-bottom: 1rem; }
.mt-0-5 { margin-top: 0.5rem; }

