/* ═══════════════════════════════════════════════════════
   AVIJYA PORTAL — FULLY RESPONSIVE CSS
   Works on Desktop (1200px+), Tablet (768px), Mobile (320px+)
   ═══════════════════════════════════════════════════════ */

/* ── RESET & BASE ──────────────────────────────────────── */
.av-wrap * { box-sizing: border-box; }
.av-wrap {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #111827;
}

/* ── TOP BAR ────────────────────────────────────────────── */
.av-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.av-topbar-l {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.av-topbar-r {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.av-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
    color: #fff;
    flex-shrink: 0;
}

/* ── STATS ROW ──────────────────────────────────────────── */
.av-stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}
.av-stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 14px 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    text-align: center;
    text-decoration: none;
    display: block;
}
.av-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
}
.av-stat-num {
    font-size: 26px;
    font-weight: 900;
    line-height: 1;
}
.av-stat-lbl {
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
    margin-top: 4px;
}

/* ── TABS ───────────────────────────────────────────────── */
.av-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    background: #f9fafb;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}
.av-tab {
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
    white-space: nowrap;
}
.av-tab.on {
    background: #0d1b3e;
    color: #fff;
}
.av-tab.off {
    background: #fff;
    color: #374151;
    border: 1px solid #e5e7eb;
}
.av-tab.off:hover {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}
.av-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 20px;
    padding: 0 5px;
    margin-left: 4px;
}

/* ── CARDS ──────────────────────────────────────────────── */
.av-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
    border: 1px solid #f3f4f6;
    width: 100%;
}
.av-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.av-card-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #0d1b3e;
}

/* ── TABLE ──────────────────────────────────────────────── */
.av-tbl-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.av-tbl {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 13px;
}
.av-tbl thead tr {
    background: #0d1b3e;
    color: #fff;
}
.av-tbl thead th {
    padding: 12px 14px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
}
.av-tbl tbody tr {
    border-bottom: 1px solid #f3f4f6;
    transition: background .1s;
}
.av-tbl tbody tr:hover { background: #f9fafb; }
.av-tbl tbody td {
    padding: 12px 14px;
    vertical-align: middle;
    color: #374151;
}

/* ── ACTION BUTTONS ─────────────────────────────────────── */
.av-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 6px;
    border: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    margin: 2px;
    text-decoration: none;
    transition: opacity .15s;
    white-space: nowrap;
}
.av-act:hover { opacity: .85; }
.av-approve { background: #def7ec; color: #03543f; }
.av-reject  { background: #fde8e8; color: #9b1c1c; }
.av-view    { background: #e0f2fe; color: #0369a1; }

/* ── FILTERS ────────────────────────────────────────────── */
.av-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.av-filter {
    padding: 6px 14px;
    border-radius: 20px;
    border: 2px solid #e5e7eb;
    background: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all .15s;
}
.av-filter.on, .av-filter:hover {
    background: #0d1b3e;
    color: #fff;
    border-color: #0d1b3e;
}

/* ── LOADING & EMPTY ────────────────────────────────────── */
.av-loading {
    text-align: center;
    padding: 24px;
    color: #6b7280;
    font-size: 14px;
    font-weight: 600;
}
.av-loading::before {
    content: '⏳ ';
}
.av-empty {
    text-align: center;
    padding: 32px 16px;
    color: #9ca3af;
    font-size: 14px;
}

/* ── FORM INPUTS ────────────────────────────────────────── */
.av-inp {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    color: #111;
    transition: border-color .15s;
}
.av-inp:focus { border-color: #0d1b3e; }

/* ── AMENITY CHIPS ──────────────────────────────────────── */
.pj-am-chip {
    padding: 7px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    color: #374151;
    transition: all .15s;
    font-family: inherit;
}
.pj-am-chip:hover { border-color: #1a56db; color: #1a56db; background: #eff6ff; }
.pj-am-chip.active-chip { background: #1a56db; color: #fff; border-color: #1a56db; }
.pj-am-chip.active-furnish { background: #f59e0b; color: #fff; border-color: #f59e0b; }

/* ── PROJECT TYPE BUTTONS ───────────────────────────────── */
.pj-type-btn {
    flex: 1;
    min-width: 140px;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    background: #fff;
    color: #374151;
    transition: all .2s;
    font-family: inherit;
}
.pj-type-btn.active {
    background: #0d1b3e;
    color: #fff;
    border-color: #0d1b3e;
}

/* ── NOTIFICATIONS ──────────────────────────────────────── */
#px-ok {
    padding: 12px 16px;
    background: #def7ec;
    color: #03543f;
    border: 1px solid #84e1bc;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    display: none;
}
#px-err {
    padding: 12px 16px;
    background: #fde8e8;
    color: #9b1c1c;
    border: 1px solid #f8b4b4;
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    display: none;
}

/* ── MODAL ──────────────────────────────────────────────── */
#pm-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* ═══════════════════════════════════════════════════════
   DESKTOP (1200px+)
   ═══════════════════════════════════════════════════════ */
@media(min-width:1200px){
    .av-wrap { padding: 24px 32px; }
    .av-stats-row { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
    .av-tbl { font-size: 14px; }
    .av-tbl thead th { font-size: 13px; }
    .av-card { padding: 24px; }
    .av-card-head h3 { font-size: 18px; }
    .av-tab { font-size: 14px; padding: 9px 16px; }
    .av-stat-num { font-size: 30px; }
}

/* ═══════════════════════════════════════════════════════
   TABLET (768px - 1199px)
   ═══════════════════════════════════════════════════════ */
@media(min-width:768px) and (max-width:1199px){
    .av-wrap { padding: 16px 20px; }
    .av-stats-row { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
    .av-tbl { font-size: 13px; min-width: 500px; }
}

/* ═══════════════════════════════════════════════════════
   MOBILE (max 767px)
   ═══════════════════════════════════════════════════════ */
@media(max-width:767px){
    .av-wrap { padding: 10px; }

    /* Topbar stacks on mobile */
    .av-topbar { padding: 12px; border-radius: 10px; }
    .av-topbar-l { gap: 8px; }
    .av-topbar-r a { padding: 6px 10px; font-size: 12px; }
    .av-avatar { width: 38px; height: 38px; font-size: 15px; }

    /* Stats scroll horizontal on mobile */
    .av-stats-row {
        display: flex;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 6px;
        grid-template-columns: none;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .av-stats-row::-webkit-scrollbar { display: none; }
    .av-stat-card {
        min-width: 100px;
        flex-shrink: 0;
        padding: 12px 10px;
    }
    .av-stat-num { font-size: 22px; }
    .av-stat-lbl { font-size: 10px; }

    /* Tabs scroll horizontal */
    .av-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 8px;
        gap: 6px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .av-tabs::-webkit-scrollbar { display: none; }
    .av-tab { font-size: 12px; padding: 7px 12px; flex-shrink: 0; }

    /* Cards full width */
    .av-card { padding: 14px; border-radius: 10px; }
    .av-card-head { flex-direction: column; align-items: flex-start; }
    .av-card-head h3 { font-size: 15px; }

    /* Table horizontal scroll */
    .av-tbl-wrap { border-radius: 6px; }
    .av-tbl { min-width: 500px; font-size: 12px; }
    .av-tbl thead th { padding: 10px 10px; font-size: 11px; }
    .av-tbl tbody td { padding: 10px 10px; }

    /* Action buttons smaller */
    .av-act { font-size: 11px; padding: 4px 8px; }

    /* Filters wrap */
    .av-filters { gap: 5px; }
    .av-filter { font-size: 11px; padding: 5px 10px; }

    /* Project type buttons stack */
    .pj-type-btn { min-width: 100%; flex: none; }

    /* Form grid single column */
    div[style*="grid-template-columns:1fr 1fr"],
    div[style*="grid-template-columns: 1fr 1fr"],
    div[style*="grid-template-columns:1fr 1fr 1fr"],
    div[style*="grid-template-columns: 1fr 1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
    }

    /* Stat cards in post property banner */
    div[style*="display:grid;grid-template-columns:1fr 1fr 1fr"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    /* Amenity chips smaller */
    .pj-am-chip { font-size: 11px; padding: 5px 10px; }
}

/* ═══════════════════════════════════════════════════════
   SMALL MOBILE (max 400px)
   ═══════════════════════════════════════════════════════ */
@media(max-width:400px){
    .av-wrap { padding: 8px; }
    .av-tab { font-size: 11px; padding: 6px 10px; }
    .av-tbl { min-width: 420px; font-size: 11px; }
    .av-card { padding: 12px; }
    .av-stat-card { min-width: 85px; padding: 10px 8px; }
    .av-stat-num { font-size: 20px; }
}

/* ── LOGIN PAGE RESPONSIVE ──────────────────────────────── */
.av-login-wrap {
    max-width: 420px;
    margin: 40px auto;
    padding: 0 16px;
}
.av-login-box {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 8px 32px rgba(0,0,0,.1);
}
@media(max-width:480px){
    .av-login-wrap { margin: 20px auto; }
    .av-login-box { padding: 24px 20px; border-radius: 12px; }
}
