/* ============================================================
   Aayina Staff Manager — v1.0.0
   Mobile-first, responsive
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --asm-primary:      #6c3fc5;
    --asm-primary-dark: #5530a3;
    --asm-success:      #27ae60;
    --asm-warning:      #f39c12;
    --asm-error:        #e74c3c;
    --asm-bg:           #f5f3fb;
    --asm-card:         #ffffff;
    --asm-border:       #e0daf5;
    --asm-text:         #2d2d2d;
    --asm-muted:        #7a7a9d;
    --asm-radius:       10px;
    --asm-shadow:       0 4px 24px rgba(108,63,197,.10);
    --asm-font:         'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ============================================================
   v1.1.0 additions — searchable selects, filters, accept/reject,
   registration-type badges. Additive only; nothing above changed.
   ============================================================ */
.asm-form-sublabel {
    display: block;
    font-size: 12px;
    color: var(--asm-muted);
    margin-bottom: 4px;
    font-weight: 600;
}
.asm-form-hint {
    font-size: 12px;
    color: var(--asm-muted);
    margin: 4px 0 0;
}
.asm-input-disabled {
    background: var(--asm-bg);
    color: var(--asm-muted);
    cursor: not-allowed;
}
.asm-searchable-select-group {
    position: relative;
}
.asm-searchable-list {
    display: none;
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 220px;
    overflow-y: auto;
    background: var(--asm-card);
    border: 1px solid var(--asm-border);
    border-radius: 0 0 var(--asm-radius) var(--asm-radius);
    box-shadow: var(--asm-shadow);
}
.asm-searchable-option {
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
}
.asm-searchable-option:hover {
    background: var(--asm-bg);
    color: var(--asm-primary-dark);
}
.asm-btn-outline {
    background: transparent;
    border: 1px solid var(--asm-error);
    color: var(--asm-error);
}
.asm-btn-outline:hover {
    background: var(--asm-error);
    color: #fff;
}
.asm-booking-note-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 3px solid var(--asm-warning);
}
.asm-assign-staff-search {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

/* ── Admin advanced filter grid (All Staff page) ──────────────── */
.asm-admin-filter-form {
    margin: 12px 0;
    padding: 14px;
    background: var(--asm-card);
    border: 1px solid var(--asm-border);
    border-radius: var(--asm-radius);
}
.asm-admin-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}
.asm-admin-filter-grid input,
.asm-admin-filter-grid select {
    width: 100%;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #ccc;
}
.asm-filter-date-label {
    font-size: 12px;
    color: var(--asm-muted);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.asm-admin-filter-actions {
    display: flex;
    gap: 8px;
}

/* ── Base ─────────────────────────────────────── */
.asm-wrap {
    font-family: var(--asm-font);
    color: var(--asm-text);
    max-width: 980px;
    margin: 20px auto;
    padding: 0 12px;
}

/* ── Auth Tabs ────────────────────────────────── */
.asm-tabs {
    display: flex;
    gap: 4px;
    background: var(--asm-border);
    padding: 4px;
    border-radius: var(--asm-radius);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.asm-tab-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--asm-muted);
    transition: all .2s;
    white-space: nowrap;
}
.asm-tab-btn.active,
.asm-tab-btn:hover {
    background: var(--asm-card);
    color: var(--asm-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* ── Panels ───────────────────────────────────── */
.asm-panel { display: none; }
.asm-panel.active { display: block; }

.asm-panel,
.asm-section {
    background: var(--asm-card);
    border-radius: var(--asm-radius);
    padding: 24px 20px;
    box-shadow: var(--asm-shadow);
    border: 1px solid var(--asm-border);
}

.asm-panel-title,
.asm-section-title {
    margin: 0 0 20px;
    font-size: 18px;
    font-weight: 700;
    color: var(--asm-primary);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--asm-border);
}

/* ── Forms ────────────────────────────────────── */
.asm-form { display: flex; flex-direction: column; gap: 14px; }

.asm-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.asm-form-group { display: flex; flex-direction: column; gap: 5px; }
.asm-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--asm-text);
}
.asm-form-group input[type=text],
.asm-form-group input[type=email],
.asm-form-group input[type=tel],
.asm-form-group input[type=password],
.asm-form-group textarea,
.asm-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--asm-border);
    border-radius: 7px;
    font-size: 14px;
    font-family: var(--asm-font);
    color: var(--asm-text);
    background: #fafafa;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
    -webkit-appearance: none;
}
.asm-form-group input:focus,
.asm-form-group textarea:focus,
.asm-form-group select:focus {
    border-color: var(--asm-primary);
    box-shadow: 0 0 0 3px rgba(108,63,197,.12);
    background: #fff;
}
.asm-form-group input[type=file] {
    padding: 6px 0;
    border: none;
    background: none;
    font-size: 13px;
}
.asm-input-disabled { background: #f0f0f0 !important; color: #999 !important; cursor: not-allowed; }
.asm-form-hint  { font-size: 11px; color: var(--asm-muted); margin: 0; }
.asm-form-intro { font-size: 14px; color: var(--asm-muted); margin: 0 0 10px; }
.asm-form-actions { padding-top: 4px; }
.asm-muted { color: var(--asm-muted); }

/* ── Checkboxes ───────────────────────────────── */
.asm-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 7px;
    margin-top: 4px;
}
.asm-checkbox-label {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border: 1.5px solid var(--asm-border);
    border-radius: 7px;
    cursor: pointer;
    font-size: 13px;
    transition: border-color .15s, background .15s;
    user-select: none;
}
.asm-checkbox-label:hover { border-color: var(--asm-primary); background: rgba(108,63,197,.04); }
.asm-checkbox-label input[type=checkbox] { width:15px; height:15px; accent-color: var(--asm-primary); cursor:pointer; flex-shrink:0; }
.asm-checkbox-label input:checked + span { color: var(--asm-primary); font-weight: 600; }
.asm-remember .asm-checkbox-label { border:none; padding:0; font-size:13px; }

/* ── Buttons ──────────────────────────────────── */
.asm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    transition: all .2s;
    line-height: 1.3;
    font-family: var(--asm-font);
    white-space: nowrap;
}
.asm-btn-primary {
    background: var(--asm-primary);
    color: #fff !important;
    border-color: var(--asm-primary);
}
.asm-btn-primary:hover {
    background: var(--asm-primary-dark);
    border-color: var(--asm-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(108,63,197,.28);
}
.asm-btn-outline {
    background: transparent;
    color: var(--asm-primary) !important;
    border-color: var(--asm-primary);
}
.asm-btn-outline:hover { background: var(--asm-primary); color: #fff !important; }
.asm-btn-sm { padding: 6px 12px; font-size: 12px; }

/* ── Notices ──────────────────────────────────── */
.asm-notice {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 14px;
    line-height: 1.5;
}
.asm-notice p { margin: 0 0 4px; }
.asm-notice p:last-child { margin-bottom: 0; }
.asm-notice-success { background: #eafaf1; border-left: 4px solid var(--asm-success); color: #1e6640; }
.asm-notice-error   { background: #fdf3f2; border-left: 4px solid var(--asm-error);   color: #7b1a14; }
.asm-notice-warning { background: #fef9ec; border-left: 4px solid var(--asm-warning); color: #7a5000; }
.asm-notice-info    { background: #ebf5fb; border-left: 4px solid #2980b9;            color: #1a4f6e; }

/* ── Dashboard layout ─────────────────────────── */
.asm-dashboard {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 18px;
    align-items: start;
    max-width: 1100px;
}

/* ── Sidebar ──────────────────────────────────── */
.asm-sidebar {
    background: var(--asm-card);
    border-radius: var(--asm-radius);
    padding: 18px 14px;
    box-shadow: var(--asm-shadow);
    border: 1px solid var(--asm-border);
    position: sticky;
    top: 16px;
}
.asm-staff-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--asm-border);
    margin-bottom: 12px;
    gap: 7px;
}
.asm-staff-card small { font-size: 11px; color: var(--asm-muted); }
.asm-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--asm-primary);
    flex-shrink: 0;
}
.asm-staff-info strong { display: block; font-size: 14px; font-weight: 700; }

/* ── Sidebar Stats ────────────────────────────── */
.asm-sidebar-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--asm-border);
}
.asm-stat-full { grid-column: 1 / -1; }
.asm-stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--asm-bg);
    border-radius: 8px;
    padding: 9px 6px;
    gap: 2px;
}
.asm-stat-num   { font-size: 22px; font-weight: 800; color: var(--asm-primary); line-height: 1; }
.asm-stat-label { font-size: 10px; color: var(--asm-muted); text-transform: uppercase; letter-spacing: .04em; text-align:center; }

/* ── Nav ──────────────────────────────────────── */
.asm-nav { display: flex; flex-direction: column; gap: 2px; }
.asm-nav-link {
    display: block;
    padding: 9px 11px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    color: var(--asm-text);
    text-decoration: none;
    transition: all .15s;
}
.asm-nav-link:hover { background: rgba(108,63,197,.07); color: var(--asm-primary); }
.asm-nav-link.active { background: var(--asm-primary); color: #fff !important; font-weight: 600; }
.asm-nav-logout {
    margin-top: 10px;
    border-top: 1px solid var(--asm-border);
    padding-top: 11px;
    color: var(--asm-error) !important;
}
.asm-nav-logout:hover { background: #fdf3f2 !important; }

/* ── Main ─────────────────────────────────────── */
.asm-main { min-width: 0; }

/* ── Booking Cards ────────────────────────────── */
.asm-booking-card {
    background: var(--asm-card);
    border: 1px solid var(--asm-border);
    border-radius: var(--asm-radius);
    box-shadow: 0 2px 12px rgba(108,63,197,.06);
    margin-bottom: 16px;
    overflow: hidden;
    transition: box-shadow .2s;
}
.asm-booking-card:hover {
    box-shadow: 0 4px 20px rgba(108,63,197,.13);
}

.asm-booking-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f9f7ff 0%, #f0ebff 100%);
    border-bottom: 1px solid var(--asm-border);
    flex-wrap: wrap;
    gap: 8px;
}
.asm-booking-id {
    font-size: 12px;
    color: var(--asm-muted);
    display: block;
    margin-bottom: 2px;
}
.asm-booking-svc {
    font-size: 15px;
    font-weight: 700;
    color: var(--asm-primary);
    display: block;
}

.asm-booking-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0;
}
.asm-detail-col {
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.asm-detail-col:first-child {
    border-right: 1px solid var(--asm-border);
}

.asm-detail-group { display: flex; flex-direction: column; gap: 2px; }
.asm-detail-label {
    font-size: 11px;
    color: var(--asm-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.asm-detail-val {
    font-size: 13px;
    color: var(--asm-text);
    font-weight: 500;
}
.asm-text-sm { font-size: 12px; }
.asm-phone-link {
    color: var(--asm-primary);
    text-decoration: none;
    font-weight: 600;
}
.asm-phone-link:hover { text-decoration: underline; }

.asm-booking-note {
    padding: 10px 18px;
    background: #fafafa;
    border-top: 1px solid var(--asm-border);
    font-size: 13px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.asm-booking-note-warning {
    background: #fffae6;
    color: #7a5000;
    font-size: 12px;
}

.asm-booking-card-footer {
    padding: 12px 18px;
    background: var(--asm-bg);
    border-top: 1px solid var(--asm-border);
}

/* ── Inline Form ──────────────────────────────── */
.asm-inline-form {
    display: flex;
    gap: 7px;
    align-items: center;
    flex-wrap: wrap;
}
.asm-select-sm {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1.5px solid var(--asm-border);
    font-size: 12px;
    color: var(--asm-text);
    background: #fff;
    font-family: var(--asm-font);
    -webkit-appearance: none;
}

/* ── Badges ───────────────────────────────────── */
.asm-badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    white-space: nowrap;
}
.asm-badge-pending,
.asm-badge-assigned           { background:#fef3cd; color:#856404; }
.asm-badge-approved,
.asm-badge-completed          { background:#d1f2e8; color:#155724; }
.asm-badge-rejected,
.asm-badge-cancelled          { background:#fddede; color:#721c24; }
.asm-badge-suspended          { background:#e2e3e5; color:#383d41; }
.asm-badge-accepted,
.asm-badge-started            { background:#cfe2ff; color:#084298; }
.asm-badge-on_the_way         { background:#e0d6fa; color:#5530a3; }
.asm-badge-pending_completion { background:#fff3cd; color:#664d03; }

/* ── Profile photo ────────────────────────────── */
.asm-current-photo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}
.asm-profile-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--asm-primary);
    flex-shrink: 0;
}

/* ── Empty State ──────────────────────────────── */
.asm-empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--asm-muted);
    font-size: 15px;
}

/* ── Table (legacy, used in history) ─────────────*/
.asm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.asm-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.asm-table th {
    padding: 9px 12px;
    background: var(--asm-bg);
    text-align: left;
    font-weight: 700;
    color: var(--asm-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
    white-space: nowrap;
    border-bottom: 2px solid var(--asm-border);
}
.asm-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--asm-border);
    vertical-align: middle;
}
.asm-table tbody tr:hover { background: rgba(108,63,197,.025); }

/* ── Mobile Responsive ────────────────────────── */
@media (max-width: 768px) {
    .asm-dashboard {
        grid-template-columns: 1fr;
    }
    .asm-sidebar {
        position: static;
    }
    .asm-sidebar-stats {
        grid-template-columns: repeat(3, 1fr);
    }
    .asm-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .asm-nav-link { flex: 0 0 auto; font-size: 12px; padding: 8px 10px; }
    .asm-nav-logout { margin-top: 0; border-top: none; padding-top: 8px; }
    .asm-booking-details {
        grid-template-columns: 1fr;
    }
    .asm-detail-col:first-child {
        border-right: none;
        border-bottom: 1px solid var(--asm-border);
    }
}

@media (max-width: 540px) {
    .asm-panel, .asm-section { padding: 16px 12px; }
    .asm-tabs { flex-direction: column; }
    .asm-tab-btn { text-align: center; }
    .asm-form-row { grid-template-columns: 1fr; }
    .asm-booking-card-header { flex-direction: column; align-items: flex-start; }
    .asm-checkbox-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
    .asm-sidebar-stats { grid-template-columns: 1fr 1fr; }
}

/* ===========================================================================
   1.2.0 additions — table theming, status history, live search, pagination,
   customer account block. Purely additive — no existing rules changed.
   =========================================================================== */

/* Location / Google Maps link */
.asm-map-link {
    color: #2271b1;
    text-decoration: underline;
    font-size: 13px;
}

/* Status history timeline */
.asm-history-block { flex-direction: column; align-items: flex-start; gap: 8px; }
.asm-history-timeline,
.asm-history-row td { margin-top: 6px; }
.asm-timeline {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    border-left: 2px solid var(--asm-border, #e3d9f7);
}
.asm-timeline-item {
    position: relative;
    padding: 4px 0 10px 16px;
    font-size: 12px;
    line-height: 1.4;
}
.asm-timeline-item::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6c3fc5;
}
.asm-timeline-by { color: #666; margin-left: 4px; }
.asm-timeline-time { color: #999; font-size: 11px; }
.asm-history-empty { color: #999; font-size: 12px; }

/* Admin: staff table theming by registration type */
.asm-admin-staff-table.asm-theme-blue tbody tr,
.asm-admin-staff-table .asm-row-staff {
    background-color: #eaf4fc;
}
.asm-admin-staff-table.asm-theme-pink tbody tr,
.asm-admin-staff-table .asm-row-salon_partner {
    background-color: #fdeaf1;
}
.wp-list-table .asm-row-staff td { background-color: #eaf4fc; }
.wp-list-table .asm-row-salon_partner td { background-color: #fdeaf1; }
.wp-list-table.striped > tbody > tr.asm-row-staff:nth-child(odd) td { background-color: #dcedfa; }
.wp-list-table.striped > tbody > tr.asm-row-salon_partner:nth-child(odd) td { background-color: #fbdcea; }

/* Admin: live search box */
.asm-live-search-wrap {
    margin: 12px 0;
    position: relative;
    max-width: 560px;
}
.asm-live-search-input {
    width: 100%;
    padding: 8px 32px 8px 10px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    font-size: 13px;
}
.asm-live-search-spinner {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* Admin: pagination */
.asm-admin-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
    padding: 8px 2px;
}
.asm-pagination-summary { font-size: 12px; color: #666; }
.asm-pagination-links { display: flex; gap: 4px; flex-wrap: wrap; }
.asm-page-link {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    font-size: 12px;
    text-decoration: none;
    color: #2271b1;
    background: #fff;
}
.asm-page-link.current {
    background: #6c3fc5;
    border-color: #6c3fc5;
    color: #fff;
}
.asm-filter-pp-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

/* Customer My Account booking details */
.asm-customer-booking-details {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e3d9f7;
}
.asm-customer-staff-table {
    margin-bottom: 16px;
}
.asm-customer-staff-table th {
    width: 180px;
    text-align: left;
    vertical-align: top;
    padding: 8px 10px;
}
.asm-customer-staff-table td {
    padding: 8px 10px;
}
