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

/* --- CSS Variables & Design Tokens (Modern ERP Style) --- */
:root {
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    /* Theme Palette - Dark Slate / Rich Navy with Professional Cyan/Gold Accents */
    --color-bg-main: #f1f5f9;
    --color-bg-sidebar: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    --color-bg-card: #ffffff;
    --color-bg-header: rgba(255, 255, 255, 0.95);
    
    --color-primary: #0f172a;
    --color-primary-light: #0284c7;
    --color-secondary: #64748b;
    --color-accent: #10b981; /* Emerald Harvest Green */
    --color-accent-amber: #d97706; /* Golden Amber Grain */
    
    --color-text-main: #1e293b;
    --color-text-muted: #475569;
    --color-text-light: #94a3b8;
    --color-text-white: #ffffff;
    
    --color-border: #cbd5e1;
    --color-border-focus: #0284c7;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 0 3px rgba(2, 132, 199, 0.15);

    --border-radius-sm: 4px; /* Crisp, precise ERP borders */
    --border-radius-md: 6px;
    --border-radius-lg: 8px;
    
    --sidebar-width: 240px;
    --header-height: 55px; /* Compact Header */
    
    --transition-speed: 0.15s; /* Snappy transitions */
}

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

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-main);
    color: var(--color-text-main);
    line-height: 1.4;
    font-size: 13px; /* High-density data scanning */
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    font-weight: 600;
}

a {
    color: var(--color-primary-light);
    text-decoration: none;
    transition: all var(--transition-speed);
}

a:hover {
    color: #0369a1;
}

/* --- Login Page --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at 10% 20%, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.98) 100%), 
                url('https://images.unsplash.com/photo-1574323347407-f5e1ad6d020b?q=80&w=1920&auto=format&fit=crop') no-repeat center center/cover;
    padding: 1.5rem;
}

.login-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 400px;
    padding: 2rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    animation: fadeIn var(--transition-speed) ease-out;
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo h1 {
    color: var(--color-text-white);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffd700, #ff8c00);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-logo p {
    color: var(--color-text-light);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

.login-card form .form-group {
    margin-bottom: 1rem;
}

.login-card form label {
    display: block;
    color: var(--color-text-white);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    opacity: 0.9;
}

.login-card form input[type="text"],
.login-card form input[type="password"] {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius-sm);
    color: var(--color-text-white);
    padding: 0.5rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all var(--transition-speed);
}

.login-card form input:focus {
    outline: none;
    border-color: var(--color-primary-light);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-glow);
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--color-accent-amber) 0%, #d97706 100%);
    color: var(--color-primary);
    border: none;
    border-radius: var(--border-radius-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.65rem;
    cursor: pointer;
    margin-top: 0.75rem;
    transition: all var(--transition-speed);
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    background: linear-gradient(135deg, #fbbf24 0%, #e05e00 100%);
}

.login-error {
    background: rgba(239, 68, 68, 0.15);
    border-left: 4px solid #ef4444;
    padding: 0.6rem 0.8rem;
    border-radius: 4px;
    color: #fca5a5;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.login-timeout {
    background: rgba(245, 158, 11, 0.15);
    border-left: 4px solid #f59e0b;
    padding: 0.6rem 0.8rem;
    border-radius: 4px;
    color: #fde047;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

/* --- Layout Structure --- */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar (High Contrast ERP Navigation) --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-bg-sidebar);
    color: var(--color-text-white);
    flex-shrink: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    transition: transform var(--transition-speed) ease-in-out;
}

/* Sidebar Open State (Desktop & Mobile safe transition) */
.sidebar.open {
    left: 0 !important;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-brand {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--color-text-white);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.sidebar-brand span {
    color: var(--color-accent-amber);
}

.sidebar-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1rem 0.5rem;
}

.nav-group-title {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--color-text-light);
    margin: 1rem 0.5rem 0.35rem;
    opacity: 0.4;
    font-weight: 700;
}

.sidebar-menu {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 0.15rem;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.6rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-speed);
}

.sidebar-menu a:hover {
    color: var(--color-text-white);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-menu li.active a {
    color: var(--color-text-white);
    background: rgba(2, 132, 199, 0.25);
    border-left: 3px solid var(--color-primary-light);
    font-weight: 600;
}

/* Custom Scrollbar for Sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 3px;
}
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1.5px;
}

/* --- Main Content Panel --- */
.main-panel {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* --- Top Header Bar --- */
.top-header {
    height: var(--header-height);
    background: var(--color-bg-header);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: var(--shadow-sm);
}

.toggle-sidebar-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--color-primary);
}

.header-brand h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-primary);
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.fy-badge {
    background-color: rgba(217, 119, 6, 0.08);
    border: 1px solid rgba(217, 119, 6, 0.2);
    color: var(--color-accent-amber);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-text-main);
    font-weight: 600;
    font-size: 0.8rem;
}

.user-avatar {
    width: 24px;
    height: 24px;
    background-color: var(--color-primary);
    color: var(--color-text-white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* --- Content Body --- */
.content-wrapper {
    padding: 1.25rem; /* High-density spacing */
    flex-grow: 1;
}

/* --- Breadcrumbs --- */
.breadcrumbs {
    display: flex;
    list-style: none;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
    gap: 0.35rem;
}

.breadcrumbs li + li::before {
    content: "/";
    padding-right: 0.35rem;
    color: var(--color-text-light);
}

/* --- Page Header --- */
.page-title-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
}

.page-title-box h2 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.25px;
}

/* --- Dashboard Stat Widgets --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: box-shadow var(--transition-speed);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
}

.stat-info h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.stat-info .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.1;
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-icon.primary {
    background-color: rgba(2, 132, 199, 0.08);
    color: var(--color-primary-light);
}

.stat-icon.success {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--color-accent);
}

.stat-icon.amber {
    background-color: rgba(217, 119, 6, 0.08);
    color: var(--color-accent-amber);
}

/* --- Content Cards (High Density ERP Style) --- */
.card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.25rem;
}

.card-header {
    background-color: #f8fafc;
    border-bottom: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top-left-radius: var(--border-radius-md);
    border-top-right-radius: var(--border-radius-md);
}

.card-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-primary);
}

.card-body {
    padding: 1rem;
}

/* --- Dense Forms & Inputs --- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.form-group {
    margin-bottom: 0.75rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: 0.25rem;
}

.form-control {
    width: 100%;
    height: 32px; /* Standard ERP input height */
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    font-family: var(--font-body);
    font-size: 0.825rem;
    background-color: #ffffff;
    color: var(--color-text-main);
    transition: all var(--transition-speed);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: var(--shadow-glow);
}

.form-control:read-only,
.form-control:disabled {
    background-color: #f1f5f9;
    cursor: not-allowed;
}

select.form-control {
    padding: 0.3rem 0.5rem;
}

/* --- Precise & Distinct Action Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.45rem 1rem;
    height: 32px; /* Matches input height */
    border-radius: var(--border-radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all var(--transition-speed);
}

.btn-primary {
    background-color: var(--color-primary-light);
    color: var(--color-text-white);
}
.btn-primary:hover {
    background-color: #0369a1;
}

.btn-secondary {
    background-color: #ffffff;
    border-color: var(--color-border);
    color: var(--color-text-muted);
}
.btn-secondary:hover {
    background-color: #f1f5f9;
    color: var(--color-text-main);
}

.btn-accent {
    background-color: var(--color-accent);
    color: var(--color-text-white);
}
.btn-accent:hover {
    background-color: #059669;
}

.btn-danger {
    background-color: #ef4444;
    color: var(--color-text-white);
}
.btn-danger:hover {
    background-color: #b91c1c;
}

/* Small action buttons (for lists/tables) */
.btn-sm {
    padding: 0.2rem 0.5rem;
    height: 24px;
    font-size: 0.75rem;
}

/* --- High-Density Striped ERP Tables --- */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    margin-bottom: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    max-height: 68vh; /* Limit height for scrollable lists with sticky header */
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.825rem; /* High-density data grid */
    text-align: left;
}

.table th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f8fafc; /* Crisp light header background */
    color: var(--color-text-main);
    font-family: var(--font-body);
    font-weight: 700;
    padding: 0.55rem 0.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--color-border);
}

.table td {
    padding: 0.5rem 0.75rem; /* Dense spacing */
    border-bottom: 1px solid #e2e8f0;
    color: var(--color-text-main);
    vertical-align: middle;
}

.table tbody tr:nth-child(even) {
    background-color: #f8fafc; /* Clean alternating stripes */
}

.table tbody tr:hover {
    background-color: #e2e8f0; /* Clear highlight on hover */
}

/* --- Badge Badges --- */
.badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-info {
    background-color: rgba(2, 132, 199, 0.1);
    color: #0369a1;
    border: 1px solid rgba(2, 132, 199, 0.2);
}

/* --- System Footer --- */
.footer {
    padding: 1rem 1.5rem;
    background: #ffffff;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-align: center;
    margin-top: auto;
}

/* --- Alert Messages --- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.825rem;
    border-left: 4px solid transparent;
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.05);
    border-color: var(--color-accent);
    color: #065f46;
    border-width: 1px 1px 1px 4px;
    border-style: solid;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.05);
    border-color: #ef4444;
    color: #991b1b;
    border-width: 1px 1px 1px 4px;
    border-style: solid;
}

/* --- Placeholder Styling --- */
.placeholder-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
    border: 2px dashed var(--color-border);
    border-radius: var(--border-radius-md);
    background-color: #f8fafc;
}

.placeholder-icon {
    font-size: 2.2rem;
    color: var(--color-text-light);
    margin-bottom: 1rem;
}

.placeholder-section h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
}

.placeholder-section p {
    color: var(--color-text-muted);
    max-width: 440px;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

/* --- Snappy Keyframe Animations --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Responsive Adaptations & Mobile Redesign --- */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: -280px; /* Off-screen on mobile/tablet */
        width: 280px;
        height: 100vh;
        z-index: 1000 !important; /* Ensure it stays above the overlay (998) and top-header (100) */
        transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-lg);
        border-top-right-radius: 16px;
        border-bottom-right-radius: 16px;
        background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
        transform: none !important; /* Disable translateX override */
    }
    
    .sidebar.open {
        left: 0 !important;
    }
    
    .main-panel {
        margin-left: 0;
        width: 100%;
    }
    
    .toggle-sidebar-btn {
        display: block;
    }
}

/* Bottom Navigation Bar (Mobile Application Feel) */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background-color: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 997;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -3px 20px rgba(0, 0, 0, 0.3);
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    gap: 4px;
    flex: 1;
    height: 100%;
    position: relative;
    transition: all 0.2s ease;
}

.bottom-nav a i {
    font-size: 18px;
    transition: transform 0.2s ease;
}

.bottom-nav a:active i {
    transform: scale(0.9);
}

.bottom-nav a.active {
    color: #0ea5e9;
}

.bottom-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 6px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #0ea5e9;
}

/* Sidebar Backdrop Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.sidebar-overlay.show {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 768px) {
    body {
        padding-bottom: 85px; /* Prevent bottom nav from covering content, extra safe */
        font-size: 14px; /* Enhanced readability on mobile */
    }
    
    .bottom-nav {
        display: flex;
    }
    
    /* Centered, Clean Mobile Header */
    .top-header {
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--color-bg-header);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--color-border);
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .header-brand {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
        white-space: nowrap;
        width: auto;
    }
    
    .header-brand h3.header-title {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--color-primary);
        margin: 0;
        letter-spacing: -0.2px;
    }
    
    .header-meta {
        display: flex !important;
        align-items: center;
        gap: 0.5rem;
        z-index: 101;
    }
    .header-meta .fy-badge,
    .header-meta .user-profile {
        display: none !important;
    }
    .lang-toggle-btn {
        padding: 0.35rem 0.6rem !important;
        font-size: 0.75rem !important;
    }
    
    .toggle-sidebar-btn {
        z-index: 101; /* Stay on top */
    }
    
    .content-wrapper {
        padding: 1rem 0.75rem;
    }
    
    /* Layout title adjustments */
    .page-title-box {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .page-title-box h2 {
        font-size: 1.35rem;
    }
    
    .page-title-box .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    /* Form grids stacking */
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .form-group[style*="grid-column"] {
        grid-column: span 1 !important;
    }
    
    /* Input field target sizing - 16px to prevent automatic iOS zoom */
    .form-control, 
    select, 
    textarea,
    button, 
    .btn {
        min-height: 44px;
        font-size: 16px !important;
    }
    
    /* Hide top-level labels preceding text inputs, selects, or textareas on mobile to save vertical space */
    .form-group > label:has(+ input:not([type="date"]):not([type="checkbox"]):not([type="radio"]), + select, + textarea) {
        display: none;
    }
    
    .form-group label {
        font-size: 0.85rem;
        margin-bottom: 0.35rem;
    }
    
    /* Card layouts */
    .card {
        padding: 1rem;
        border-radius: var(--border-radius-md);
    }
    
    .card-header {
        padding-bottom: 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .card-header h3 {
        font-size: 1rem;
    }
    
    /* 2x2 Dashboard Stat Grid */
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
        margin-bottom: 1.25rem;
    }
    
    /* Stat cards watermark icon style */
    .stat-card {
        position: relative;
        overflow: hidden;
        padding: 0.85rem !important;
        min-height: 95px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        align-items: flex-start;
        border-radius: var(--border-radius-md);
    }
    
    .stat-card .stat-info {
        z-index: 2;
        width: 100%;
    }
    
    .stat-card .stat-info h4 {
        font-size: 0.68rem !important;
        margin-bottom: 0.25rem;
        color: var(--color-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.3px;
        line-height: 1.2;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem !important;
        font-weight: 700;
        margin-top: auto;
    }
    
    .stat-card .stat-icon {
        position: absolute !important;
        right: -5px !important;
        bottom: -5px !important;
        width: 55px !important;
        height: 55px !important;
        background: none !important;
        border-radius: 0 !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        z-index: 1;
    }
    
    .stat-card .stat-icon i {
        font-size: 2.2rem !important;
        opacity: 0.12; /* Watermark effect */
    }
    
    /* Table scrollbars for bulk grids */
    .table-responsive {
        border-radius: var(--border-radius-md);
        box-shadow: inset 0 0 4px rgba(0,0,0,0.05);
        scrollbar-width: none;  /* Firefox */
        -ms-overflow-style: none;  /* IE and Edge */
    }
    
    .table-responsive::-webkit-scrollbar {
        display: none; /* Hide default scrollbars */
    }
}

/* --- Searchable Dropdown Custom Styles --- */
.searchable-select-wrapper {
    position: relative;
    width: 100%;
}
.searchable-select-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px;
    padding-right: 2.25rem !important;
}
.searchable-select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-md);
    max-height: 220px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 2px;
}
.searchable-select-item {
    padding: 0.65rem 0.75rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--color-text-main);
    transition: background-color 0.15s;
}
.searchable-select-item:hover, .searchable-select-item.active {
    background-color: #f1f5f9;
    color: var(--color-primary-light);
}

/* --- Google Translate Styling Polish --- */
.goog-te-banner-frame.skiptranslate,
.goog-te-banner-frame,
#goog-gt-tt,
.goog-te-balloon-frame,
#goog-gt-tt.skiptranslate,
.skiptranslate,
iframe.skiptranslate {
    display: none !important;
    visibility: hidden !important;
}
body {
    top: 0 !important;
}
.goog-logo-link {
    display: none !important;
}
.goog-te-gadget {
    color: transparent !important;
    font-size: 0 !important;
}
.goog-te-gadget .goog-te-combo {
    display: none !important;
}
.goog-text-highlight {
    background-color: transparent !important;
    box-shadow: none !important;
}

/* --- Global Print Media Styles --- */
@media print {
    .no-print, 
    #sidebar, 
    .sidebar,
    .top-header, 
    .page-title-box, 
    .footer, 
    .bottom-nav, 
    .sidebar-overlay,
    #sidebar-overlay,
    .lang-toggle-btn,
    .btn,
    button {
        display: none !important;
    }
    .main-panel {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    .content-wrapper {
        padding: 0 !important;
    }
}

