/* Basic reset for app-like presentation */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: linear-gradient(180deg, #fafafa 0%, #f3f4f6 100%);
    color: #111827;
}

/* App container tuned for modern look - fully responsive and fluid */
#app-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    border-radius: 1rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(250,250,250,0.96));
    padding: 0;
    box-shadow: 0 12px 40px rgba(17,24,39,0.12);
    overflow: hidden;
    min-height: 100vh; /* ensure full height on small devices */
    height: auto; /* let content determine height */
}

/* Layout tweaks for medium and larger screens */
@media (min-width: 640px) {
    #app-container {
        padding: 12px;
        border-radius: 1rem;
    }
}

/* Larger screens: constrain width and center content with subtle vertical inset */
@media (min-width: 1024px) {
    #app-container {
        max-width: 1100px;
        margin-top: 24px;
        margin-bottom: 24px;
    }
}

/* Desktop: use a two-column grid optionally for wide dashboard pages (keeps header full width) */
@media (min-width: 1280px) {
    #app-container {
        display: grid;
        grid-template-rows: auto 1fr;
        grid-template-columns: 1fr;
        max-width: 1200px;
        margin-top: 36px;
        margin-bottom: 36px;
    }
}

/* Ensure internal scroll areas behave consistently and allow full-height content where needed */
.main-full-height {
    display: flex;
    flex-direction: column;
    min-height: 0; /* allow children to shrink and scroll inside */
}

/* Small devices: make interactive targets a bit larger for touch */
@media (max-width: 480px) {
    button, .tab-btn {
        padding: 0.9rem 1rem;
        font-size: 15px;
    }
}

/* Keep previous height helpers but prefer fluid behavior */
@media (min-width: 768px) {
    .tab-content-scroll {
        max-height: calc(100vh - 160px); /* avoid overshooting viewport when header present */
    }
}

/* Improve buttons and interactive surfaces */
button, .tab-btn {
    border-radius: 12px;
    transition: transform .12s ease, box-shadow .12s ease, background-color .12s ease;
    will-change: transform;
}

button:active { transform: translateY(1px) scale(0.997); }

/* Card and list rounded aesthetic */
.bg-white, .rounded-xl, .rounded-lg {
    border-radius: 14px !important;
}

/* Slightly larger, softer shadows for cards */
.shadow, .shadow-md, .shadow-lg, .shadow-xl {
    box-shadow: 0 8px 24px rgba(15,23,42,0.06) !important;
}

/* More spacious paddings for modern touch-friendly controls */
.p-4 { padding: 1.25rem !important; }
.p-3 { padding: .9rem !important; }
.p-2 { padding: .6rem !important; }
.py-2 { padding-top: .6rem !important; padding-bottom: .6rem !important; }

/* Slightly larger avatar / icon sizes where applied */
svg.h-5.w-5, svg.h-6.w-6 { width: 1.25rem; height: 1.25rem; }

/* Modern header styling used by dashboards */
header { 
    background: linear-gradient(90deg, rgba(220,38,38,0.98), rgba(185,28,28,0.95));
    box-shadow: 0 6px 18px rgba(220,38,38,0.08);
}
header .tab-nav-scroll { background: transparent; }

/* Better readable modal content (SweetAlert2 tweaks)
   Updated to make modals full-screen so floating windows show all tab options */
.swal2-popup {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
}
.swal2-html-container {
    padding: 1rem !important;
    height: calc(100vh - 64px) !important; /* leave space for title/controls */
    overflow-y: auto !important;
}
.swal2-title {
    font-weight: 700 !important;
    font-size: 1.125rem !important;
    padding: 1rem 1.25rem !important;
}

/* Improve tab nav visuals for app style */
.tab-nav-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding: 6px;
    gap: 6px;
}
.tab-nav-scroll .tab-btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1rem;
    margin: 0 6px;
    border-radius: 12px;
    background: transparent;
    color: rgba(255,255,255,0.9);
    border: 1px solid transparent;
}
.tab-nav-scroll .tab-btn.text-white {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
    box-shadow: 0 6px 14px rgba(15,23,42,0.04);
}

/* Subtle elevation lines for content wrappers */
#content-view, #content-view > div, .bg-white {
    border: 1px solid rgba(15,23,42,0.03);
}

/* Responsive: small devices keep same behavior but ensure touch-friendly sizes */
@media (max-width: 480px) {
    .swal2-title { font-size: 1rem !important; padding: 0.75rem !important; }
    .swal2-html-container { padding: 0.75rem !important; height: calc(72vh) !important; }
}

/* --- Tab content vertical scroll helper --- 
   Apply 'tab-content-scroll' to a main/content wrapper to ensure inner content scrolls smoothly
   while keeping header/tab nav fixed. */
.tab-content-scroll {
    /* Ensure the container becomes a scrollable region for tab content */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Provide consistent inner padding and preserve existing layout */
    padding: 0.5rem;
}

/* --- Logout button visibility / touch target improvements --- */
#logout-btn {
    min-width: 92px;
    padding: .6rem .9rem;
    border-radius: 10px;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(220,38,38,0.12);
    background: linear-gradient(180deg, #ef4444, #dc2626);
    border: 1px solid rgba(0,0,0,0.06);
    transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease;
}
#logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(220,38,38,0.16);
}
#logout-btn:active {
    transform: translateY(0);
    opacity: 0.98;
}

/* Provide a subtle scrollbar style (non-intrusive) */
.tab-nav-scroll::-webkit-scrollbar { height: 8px; }
.tab-nav-scroll::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 8px; }
.tab-nav-scroll::-webkit-scrollbar-track { background: transparent; }