/* ==========================================
   IFTIN PORTAL
========================================== */

:root{
    --portal-bg:#f6f7fb;
    --portal-card:#ffffff;
    --portal-border:#e5e7eb;
    --portal-text:#111827;
    --portal-muted:#6b7280;
    --portal-primary:#111827;
    --portal-shadow:0 10px 30px rgba(0,0,0,.08);

    --sidebar-width:280px;
    --radius:14px;
}

/* ==========================================
   RESET
========================================== */

*{
    box-sizing:border-box;
}

html,
body{
    margin:0;
    padding:0;
}

body.iftin-portal-body{
    background:var(--portal-bg);
    color:var(--portal-text);
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
}

/* ==========================================
   LOGIN
========================================== */

.portal-login-page{
    min-height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
    padding:40px 20px;
}

.portal-login-card{
    width:100%;
    max-width:480px;
    background:#fff;
    border-radius:20px;
    padding:40px;
    box-shadow:var(--portal-shadow);
}

.portal-login-logo{
    margin-bottom:20px;
}

.portal-login-logo span{
    display:block;
    font-size:28px;
    font-weight:700;
}

.portal-login-logo small{
    color:var(--portal-muted);
}

.portal-login-form{
    display:flex;
    flex-direction:column;
    gap:12px;
    margin-top:20px;
}

.portal-login-form label{
    font-weight:600;
}

.portal-login-form input{
    width:100%;
    border:1px solid var(--portal-border);
    border-radius:10px;
    padding:14px;
}

.portal-login-form button{
    margin-top:10px;
    border:none;
    cursor:pointer;
    padding:14px;
    border-radius:10px;
    background:#111827;
    color:#fff;
    font-weight:600;
}

.portal-alert{
    margin-top:20px;
    padding:14px;
    border-radius:10px;
}

.portal-alert.error{
    background:#fef2f2;
    color:#991b1b;
}

.portal-alert.success{
    background:#ecfdf5;
    color:#065f46;
}

/* ==========================================
   LAYOUT
========================================== */

.portal-shell{
    display:flex;
    min-height:100vh;
}

.portal-sidebar{
    width:var(--sidebar-width);
    background:#fff;
    border-right:1px solid var(--portal-border);
    display:flex;
    flex-direction:column;
    position:fixed;
    top:0;
    left:0;
    bottom:0;
    z-index:100;
}

.portal-main{
    margin-left:var(--sidebar-width);
    width:calc(100% - var(--sidebar-width));
    min-height:100vh;
}

.portal-logo{
    text-decoration:none;
    color:inherit;
    padding:30px;
    border-bottom:1px solid var(--portal-border);
}

.portal-logo span{
    display:block;
    font-size:24px;
    font-weight:700;
}

.portal-logo small{
    color:var(--portal-muted);
}

/* ==========================================
   NAVIGATION
========================================== */

.portal-nav{
    padding:20px;
    display:flex;
    flex-direction:column;
    gap:8px;
}

.portal-nav-link{
    display:flex;
    align-items:center;
    gap:12px;
    padding:14px;
    border-radius:10px;
    text-decoration:none;
    color:var(--portal-text);
    transition:.2s;
}

.portal-nav-link:hover{
    background:#f3f4f6;
}

.portal-nav-link.active{
    background:#111827;
    color:#fff;
}

.portal-nav-icon{
    width:20px;
    text-align:center;
}

/* ==========================================
   SIDEBAR FOOTER
========================================== */

.portal-sidebar-footer{
    margin-top:auto;
    padding:20px;
    border-top:1px solid var(--portal-border);
}

.portal-user-card{
    display:flex;
    flex-direction:column;
    gap:4px;
    margin-bottom:16px;
}

.portal-user-card small{
    color:var(--portal-muted);
}

.portal-logout{
    display:block;
    text-decoration:none;
    text-align:center;
    padding:12px;
    border-radius:10px;
    background:#111827;
    color:#fff;
}

/* ==========================================
   TOPBAR
========================================== */

.portal-topbar{
    background:#fff;
    border-bottom:1px solid var(--portal-border);
    padding:20px 30px;
    display:flex;
    align-items:center;
    gap:20px;
}

.portal-topbar-title{
    display:flex;
    flex-direction:column;
}

.portal-topbar-title span{
    color:var(--portal-muted);
    font-size:14px;
}

.portal-menu-toggle{
    display:none;
}

/* ==========================================
   CONTENT
========================================== */

.portal-content{
    padding:30px;
}

.portal-card{
    background:#fff;
    border-radius:var(--radius);
    padding:24px;
    box-shadow:var(--portal-shadow);
}

/* ==========================================
   MOBILE
========================================== */

.portal-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    opacity:0;
    visibility:hidden;
    transition:.25s;
    z-index:90;
}

.portal-overlay.is-visible{
    opacity:1;
    visibility:visible;
}

@media(max-width:960px){

    .portal-sidebar{
        transform:translateX(-100%);
        transition:.3s;
    }

    .portal-sidebar.is-open{
        transform:translateX(0);
    }

    .portal-main{
        margin-left:0;
        width:100%;
    }

    .portal-menu-toggle{
        display:block;
        border:none;
        background:none;
        font-size:22px;
        cursor:pointer;
    }

}

.portal-page-header{
    margin-bottom:30px;
}

.portal-page-header h1{
    margin:0 0 10px;
    font-size:42px;
}

.portal-page-header p{
    margin:0;
    color:var(--portal-muted);
}

.portal-stats-grid{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:20px;
    margin-bottom:30px;
}

.portal-stat-card{
    background:#fff;
    border-radius:14px;
    padding:24px;
    box-shadow:var(--portal-shadow);
}

.portal-stat-number{
    display:block;
    font-size:40px;
    font-weight:700;
}

.portal-stat-label{
    color:var(--portal-muted);
}

.portal-actions{
    display:flex;
    gap:12px;
    flex-wrap:wrap;
    margin-top:20px;
}

.portal-actions a{
    background:#111827;
    color:#fff;
    text-decoration:none;
    padding:12px 18px;
    border-radius:10px;
}

@media(max-width:960px){

    .portal-stats-grid{
        grid-template-columns:1fr;
    }

}




.portal-toolbar{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:20px;
    margin-bottom:24px;
}

.portal-toolbar h2{
    margin:0 0 8px;
}

.portal-toolbar p{
    margin:0;
    color:var(--portal-muted);
}

.portal-search-form{
    display:flex;
    gap:8px;
    align-items:center;
    flex-wrap:wrap;
}

.portal-search-form input{
    min-width:240px;
    border:1px solid var(--portal-border);
    border-radius:10px;
    padding:11px 12px;
}

.portal-search-form button,
.portal-search-form a{
    border:0;
    background:#111827;
    color:#fff;
    text-decoration:none;
    padding:11px 14px;
    border-radius:10px;
    font-weight:600;
    cursor:pointer;
}

.portal-search-form a{
    background:#f3f4f6;
    color:#111827;
}

.portal-table-wrap{
    width:100%;
    overflow-x:auto;
}

.portal-table{
    width:100%;
    border-collapse:collapse;
}

.portal-table th,
.portal-table td{
    padding:16px 12px;
    text-align:left;
    border-bottom:1px solid var(--portal-border);
    vertical-align:top;
}

.portal-table th{
    font-size:13px;
    text-transform:uppercase;
    letter-spacing:.04em;
    color:var(--portal-muted);
}

.portal-table td small{
    display:block;
    margin-top:4px;
    color:var(--portal-muted);
}

.portal-status-select{
    border:1px solid var(--portal-border);
    border-radius:999px;
    padding:8px 12px;
    background:#fff;
}

.portal-status-select.saved{
    outline:2px solid #22c55e;
}

.portal-details summary{
    cursor:pointer;
    font-weight:700;
}

.portal-enquiry-full{
    margin-top:16px;
    padding:20px;
    background:#f9fafb;
    border:1px solid var(--portal-border);
    border-radius:14px;
    min-width:520px;
}

.portal-detail-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:10px 20px;
    margin:16px 0;
}

.portal-detail-grid p{
    margin:0;
}

.portal-message-box,
.portal-notes-box{
    margin-top:16px;
    padding:16px;
    background:#fff;
    border:1px solid var(--portal-border);
    border-radius:12px;
}

.portal-notes-box label{
    display:block;
    font-weight:700;
    margin-bottom:8px;
}

.portal-notes-field{
    width:100%;
    min-height:110px;
    border:1px solid var(--portal-border);
    border-radius:10px;
    padding:12px;
    resize:vertical;
}

.portal-save-notes,
.portal-btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    margin-top:12px;
    border:0;
    background:#111827;
    color:#fff;
    text-decoration:none;
    padding:11px 16px;
    border-radius:10px;
    font-weight:700;
    cursor:pointer;
}

.portal-btn.whatsapp{
    background:#16a34a;
}

.portal-btn.secondary{
    background:#f3f4f6;
    color:#111827;
}

.portal-action-row{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-top:16px;
}

.portal-stat-link{
    text-decoration:none;
    color:inherit;
}

.portal-stat-link.active{
    outline:2px solid #111827;
}

@media(max-width:960px){
    .portal-toolbar{
        flex-direction:column;
    }

    .portal-detail-grid{
        grid-template-columns:1fr;
    }

    .portal-enquiry-full{
        min-width:0;
    }
}


.portal-status-pill{
    display:inline-flex;
    align-items:center;
    padding:7px 12px;
    border-radius:999px;
    font-size:13px;
    font-weight:700;
    background:#f3f4f6;
    color:#111827;
    text-transform:capitalize;
}

.status-pending{
    background:#fef3c7;
    color:#92400e;
}

.status-confirmed{
    background:#dcfce7;
    color:#166534;
}

.status-completed{
    background:#e0e7ff;
    color:#3730a3;
}

.status-cancelled{
    background:#fee2e2;
    color:#991b1b;
}




.portal-booking-status-select{
    border:1px solid var(--portal-border);
    border-radius:999px;
    padding:8px 12px;
    background:#fff;
    font-weight:700;
}

.portal-booking-status-select.saved{
    outline:2px solid #22c55e;
}


.portal-calendar-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    margin-bottom:24px;
}

.portal-calendar-header h2{
    margin:0;
}

.calendar-month{
    display:grid;
    grid-template-columns:repeat(7,1fr);
    gap:1px;
    background:var(--portal-border);
    border:1px solid var(--portal-border);
    border-radius:14px;
    overflow:hidden;
}

.portal-calendar-day-name{
    background:#f9fafb;
    padding:14px;
    font-weight:800;
    font-size:13px;
    text-transform:uppercase;
    color:var(--portal-muted);
}

.portal-calendar-cell{
    min-height:140px;
    background:#fff;
    padding:12px;
}

.portal-calendar-cell.empty{
    background:#f9fafb;
}

.portal-calendar-date{
    display:block;
    margin-bottom:10px;
}

.portal-calendar-cell.has-booking{
    background:#fffef7;
}

.portal-calendar-event{
    padding:10px;
    border-radius:10px;
    margin-top:8px;
    background:#f3f4f6;
    font-size:13px;
}

.portal-calendar-event strong,
.portal-calendar-event span,
.portal-calendar-event small{
    display:block;
}

.portal-calendar-event span,
.portal-calendar-event small{
    color:var(--portal-muted);
    margin-top:3px;
}

.portal-calendar-event.status-pending{
    background:#fef3c7;
}

.portal-calendar-event.status-confirmed{
    background:#dcfce7;
}

.portal-calendar-event.status-completed{
    background:#e0e7ff;
}

.portal-calendar-event.status-cancelled{
    background:#fee2e2;
}

@media(max-width:960px){
    .calendar-month{
        grid-template-columns:1fr;
    }

    .portal-calendar-day-name{
        display:none;
    }

    .portal-calendar-cell.empty{
        display:none;
    }
}


.portal-date-status{
    width:100%;
    margin-top:8px;
    margin-bottom:10px;
    border:1px solid var(--portal-border);
    border-radius:8px;
    padding:6px;
    font-size:12px;
}

.has-status-available{
    background:#ffffff;
}

.has-status-tentative{
    background:#fff7ed;
}

.has-status-booked{
    background:#f0fdf4;
}

.has-status-blocked{
    background:#fef2f2;
}


.portal-invoice-status-select{
    border:1px solid var(--portal-border);
    border-radius:999px;
    padding:8px 12px;
    background:#fff;
    font-weight:700;
}

.portal-invoice-status-select.saved{
    outline:2px solid #22c55e;
}


.portal-invoice-edit-form input,
.portal-invoice-edit-form textarea{
    width:100%;
    border:1px solid var(--portal-border);
    border-radius:10px;
    padding:10px 12px;
    margin-top:6px;
}

.portal-invoice-edit-form label{
    display:block;
    font-weight:700;
}

.portal-line-items{
    display:flex;
    flex-direction:column;
    gap:10px;
    margin-top:14px;
}

.portal-line-item-row{
    display:grid;
    grid-template-columns:1fr 160px;
    gap:10px;
}

@media(max-width:700px){
    .portal-line-item-row{
        grid-template-columns:1fr;
    }
}



.portal-email-reply-form{
    width:100%;
    margin-top:16px;
    padding:16px;
    background:#fff;
    border:1px solid var(--portal-border);
    border-radius:12px;
}

.portal-email-reply-form label{
    display:block;
    margin-bottom:8px;
}

.portal-email-reply-form textarea{
    width:100%;
    min-height:140px;
    border:1px solid var(--portal-border);
    border-radius:10px;
    padding:12px;
    resize:vertical;
}


.portal-create-panel{
    margin-bottom:24px;
}

.portal-create-panel summary{
    cursor:pointer;
    font-size:20px;
    font-weight:800;
}

.portal-create-enquiry-form{
    margin-top:20px;
}

.portal-create-enquiry-form input,
.portal-create-enquiry-form textarea{
    width:100%;
    border:1px solid var(--portal-border);
    border-radius:10px;
    padding:11px 12px;
    margin-top:6px;
}

.portal-create-enquiry-form label{
    font-weight:700;
}





.portal-payment-form{
    margin-top:16px;
}

.portal-payment-form input,
.portal-payment-form select{
    width:100%;
    border:1px solid var(--portal-border);
    border-radius:10px;
    padding:10px 12px;
    margin-top:6px;
}

.portal-payment-form label{
    display:block;
    font-weight:700;
}

.portal-payment-history{
    margin-top:24px;
}









