/* ================================================================
   StaffHub — Roster Module Styles (Mobile-Optimized)
   css/company-roster.css

   SECTION A — Standalone page styles (company-roster.html)
   SECTION B — Dashboard-embedded (#roster-section scoped)
   ================================================================ */

/* ================================================================
   SECTION A — STANDALONE PAGE STYLES
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; background: #f1f5f9; color: #1e293b; min-height: 100vh; }

/* ── Top bar ──────────────────────────────────────────────── */
.top-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; background: #fff; border-bottom: 1.5px solid #e2e8f0; position: sticky; top: 0; z-index: 100; }
.top-bar-title { font-size: 16px; font-weight: 700; color: #0f172a; }
.top-bar-sub   { font-size: 12px; color: #64748b; margin-top: 2px; }
.top-bar-right { display: flex; align-items: center; gap: 10px; }
.top-bar-user  { font-size: 12px; color: #475569; font-weight: 500; }
.top-bar-btn   { padding: 6px 14px; border-radius: 8px; border: 1.5px solid #e2e8f0; background: #fff; color: #475569; font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all .15s; min-height: 36px; }
.top-bar-btn:hover { background: #f1f5f9; }

/* ── Auth overlay ─────────────────────────────────────────── */
#authOverlay { position: fixed; inset: 0; background: #f1f5f9; display: flex; align-items: center; justify-content: center; z-index: 9999; }
.auth-card { background: #fff; border-radius: 14px; padding: 32px; width: 100%; max-width: 380px; border: 1.5px solid #e2e8f0; text-align: center; }
.auth-card h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.auth-card p  { font-size: 13px; color: #64748b; margin-bottom: 20px; }
.auth-input   { width: 100%; padding: 10px 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 16px; font-family: inherit; margin-bottom: 10px; transition: border-color .15s; }
.auth-input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.auth-btn     { width: 100%; padding: 10px; border-radius: 8px; border: none; background: #2563eb; color: #fff; font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; margin-top: 6px; transition: background .15s; min-height: 44px; }
.auth-btn:hover    { background: #1d4ed8; }
.auth-btn:disabled { opacity: .5; cursor: not-allowed; }
.auth-error { margin-top: 10px; font-size: 12px; color: #e11d48; display: none; }

.content-wrap { max-width: 1200px; margin: 0 auto; }

/* ── Toast ────────────────────────────────────────────────── */
.toast-container { position: fixed; top: 16px; right: 16px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; box-shadow: 0 4px 12px rgba(0,0,0,.1); animation: toastIn .3s ease, toastOut .3s ease 2.7s forwards; max-width: 340px; }
.toast-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.toast-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.toast-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

@keyframes toastIn  { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }
@keyframes rsFadeIn  { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes rsSlideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Tabs ─────────────────────────────────────────────────── */
.rs-tabs { display: flex; gap: 0; border-bottom: 2px solid #e2e8f0; background: #fff; padding: 0 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.rs-tabs::-webkit-scrollbar { display: none; }
.rs-tab  { padding: 12px 18px; font-size: 13px; font-weight: 600; color: #64748b; cursor: pointer; border: none; background: none; border-bottom: 2.5px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: all .15s; font-family: inherit; }
.rs-tab:hover  { color: #1e293b; }
.rs-tab.active { color: #2563eb; border-bottom-color: #2563eb; }

.rs-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 10px; font-weight: 700; margin-left: 6px; vertical-align: middle; }
.rs-badge-warn   { background: #fef3c7; color: #92400e; }
.rs-badge-info   { background: #dbeafe; color: #1e40af; }
.rs-badge-danger { background: #fee2e2; color: #991b1b; }

.rs-panel        { display: none; padding: 16px; animation: rsFadeIn .2s ease; }
.rs-panel.active { display: block; }

.rs-card { background: #fff; border: 1.5px solid #e2e8f0; border-radius: 12px; padding: 18px; margin-bottom: 14px; }
.rs-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.rs-card-title  { font-size: 15px; font-weight: 700; color: #0f172a; margin: 0; }

.rs-btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; border: 1.5px solid transparent; transition: all .15s; min-height: 36px; }
.rs-btn-primary       { background: #2563eb; color: #fff; border-color: #2563eb; }
.rs-btn-primary:hover { background: #1d4ed8; }
.rs-btn-success       { background: #16a34a; color: #fff; border-color: #16a34a; }
.rs-btn-success:hover { background: #15803d; }
.rs-btn-danger        { background: #fff1f2; color: #e11d48; border-color: #fecdd3; }
.rs-btn-danger:hover  { background: #ffe4e6; }
.rs-btn-outline       { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
.rs-btn-outline:hover { background: #e2e8f0; }
.rs-btn-sm            { padding: 5px 10px; font-size: 11px; }
.rs-btn:disabled      { opacity: .5; cursor: not-allowed; }

.rs-form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.rs-label      { font-size: 12px; font-weight: 600; color: #475569; }
.rs-input, .rs-select { padding: 8px 10px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 16px; font-family: inherit; color: #1e293b; background: #fff; transition: border-color .15s; }
.rs-input:focus, .rs-select:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }

.rs-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.rs-stat  { background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 10px; padding: 12px; text-align: center; }
.rs-stat-value { font-size: 22px; font-weight: 800; color: #0f172a; }
.rs-stat-label { font-size: 11px; color: #64748b; margin-top: 2px; font-weight: 500; }

.rs-empty      { text-align: center; padding: 40px 20px; color: #94a3b8; font-size: 13px; }
.rs-empty-icon { font-size: 32px; margin-bottom: 8px; }

.rs-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 9999; align-items: center; justify-content: center; padding: 16px; }
.rs-modal-overlay.visible { display: flex; }
.rs-modal { background: #fff; border-radius: 14px; width: 100%; max-width: 420px; max-height: 85vh; overflow-y: auto; padding: 20px; box-shadow: 0 25px 50px rgba(0,0,0,.15); animation: rsSlideUp .2s ease; -webkit-overflow-scrolling: touch; }
.rs-modal-title   { font-size: 16px; font-weight: 700; color: #0f172a; margin: 0 0 16px; }
.rs-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ── Standalone responsive ────────────────────────────────── */
@media (max-width: 768px) {
    .top-bar { padding: 10px 12px; flex-wrap: wrap; gap: 8px; }
    .top-bar-user { display: none; }
    .content-wrap { padding: 0; }
    .toast-container { left: 12px; right: 12px; }
    .toast { max-width: 100%; }
}

@media (max-width: 600px) {
    .rs-stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .rs-tabs  { padding: 0 8px; }
    .rs-tab   { padding: 10px 12px; font-size: 12px; }
    .rs-panel { padding: 10px; }
    .rs-card  { padding: 12px; }
    .rs-stat-value { font-size: 18px; }
    .rs-modal { padding: 16px; border-radius: 10px; }
}


/* ================================================================
   SECTION B — DASHBOARD EMBEDDED STYLES
   (#roster-section scoped)
   ================================================================ */

#roster-section { padding: 0; }
#roster-section * { box-sizing: border-box; }

#roster-section .rs-tabs { display: flex; gap: 0; border-bottom: 2px solid #e2e8f0; background: #fff; padding: 0 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
#roster-section .rs-tabs::-webkit-scrollbar { display: none; }
#roster-section .rs-tab  { padding: 12px 18px; font-size: 13px; font-weight: 600; color: #64748b; cursor: pointer; border: none; background: none; border-bottom: 2.5px solid transparent; margin-bottom: -2px; white-space: nowrap; transition: all .15s; font-family: inherit; position: relative; }
#roster-section .rs-tab:hover  { color: #1e293b; }
#roster-section .rs-tab.active { color: #2563eb; border-bottom-color: #2563eb; }

#roster-section .rs-badge      { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 10px; font-weight: 700; margin-left: 6px; vertical-align: middle; }
#roster-section .rs-badge-warn { background: #fef3c7; color: #92400e; }
#roster-section .rs-badge-info { background: #dbeafe; color: #1e40af; }

#roster-section .rs-panel        { display: none; padding: 16px; animation: rsFadeIn .2s ease; }
#roster-section .rs-panel.active { display: block; }

#roster-section .rs-card         { background: #fff; border: 1.5px solid #e2e8f0; border-radius: 12px; padding: 18px; margin-bottom: 14px; }
#roster-section .rs-card-header  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
#roster-section .rs-card-title   { font-size: 15px; font-weight: 700; color: #0f172a; margin: 0; }

#roster-section .rs-btn          { display: inline-flex; align-items: center; gap: 5px; padding: 7px 14px; border-radius: 8px; font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; border: 1.5px solid transparent; transition: all .15s; min-height: 36px; }
#roster-section .rs-btn-primary       { background: #2563eb; color: #fff; border-color: #2563eb; }
#roster-section .rs-btn-primary:hover { background: #1d4ed8; }
#roster-section .rs-btn-success       { background: #16a34a; color: #fff; border-color: #16a34a; }
#roster-section .rs-btn-success:hover { background: #15803d; }
#roster-section .rs-btn-danger        { background: #fff1f2; color: #e11d48; border-color: #fecdd3; }
#roster-section .rs-btn-danger:hover  { background: #ffe4e6; }
#roster-section .rs-btn-outline       { background: #f8fafc; color: #475569; border-color: #e2e8f0; }
#roster-section .rs-btn-outline:hover { background: #e2e8f0; }
#roster-section .rs-btn-sm            { padding: 5px 10px; font-size: 11px; }
#roster-section .rs-btn:disabled      { opacity: .5; cursor: not-allowed; }

#roster-section .rs-form-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
#roster-section .rs-label      { font-size: 12px; font-weight: 600; color: #475569; }
#roster-section .rs-input, #roster-section .rs-select { padding: 8px 10px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 16px; font-family: inherit; color: #1e293b; background: #fff; transition: border-color .15s; }
#roster-section .rs-input:focus, #roster-section .rs-select:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

#roster-section .rs-stats      { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
#roster-section .rs-stat        { background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 10px; padding: 12px; text-align: center; }
#roster-section .rs-stat-value  { font-size: 22px; font-weight: 800; color: #0f172a; }
#roster-section .rs-stat-label  { font-size: 11px; color: #64748b; margin-top: 2px; font-weight: 500; }

#roster-section .rs-empty       { text-align: center; padding: 40px 20px; color: #94a3b8; font-size: 13px; }
#roster-section .rs-empty-icon  { font-size: 32px; margin-bottom: 8px; }

#roster-section .rs-modal-overlay         { display: none; position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 9999; align-items: center; justify-content: center; padding: 16px; }
#roster-section .rs-modal-overlay.visible { display: flex; }
#roster-section .rs-modal                 { background: #fff; border-radius: 14px; width: 100%; max-width: 420px; max-height: 85vh; overflow-y: auto; padding: 20px; box-shadow: 0 25px 50px rgba(0,0,0,.15); animation: rsSlideUp .2s ease; -webkit-overflow-scrolling: touch; }
#roster-section .rs-modal-title           { font-size: 16px; font-weight: 700; color: #0f172a; margin: 0 0 16px; }
#roster-section .rs-modal-actions         { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ── Dashboard-embedded responsive ────────────────────────── */
@media (max-width: 768px) {
    #roster-section .rs-stats { grid-template-columns: repeat(2, 1fr); }
    #roster-section .rs-panel { padding: 10px; }
    #roster-section .rs-card  { padding: 12px; }
    #roster-section .rs-stat-value { font-size: 18px; }

    #roster-section .rs-card-header {
        flex-direction: column;
        align-items: stretch;
    }

    #roster-section .rs-card-header > div {
        width: 100%;
        justify-content: flex-start;
    }

    #roster-section .rs-modal {
        max-width: 100%;
        border-radius: 0;
        max-height: 100vh;
    }

    #roster-section .rs-modal-overlay { padding: 0; }
}

@media (max-width: 480px) {
    #roster-section .rs-tabs  { padding: 0 8px; }
    #roster-section .rs-tab   { padding: 10px 12px; font-size: 12px; }
    #roster-section .rs-card  { padding: 10px; }
}