@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --agst-pink-primary: #F06292;
    --agst-pink-light: #FCE4EC;
    --agst-pink-soft: #FFF5F7;
    --agst-pink-dark: #C2185B;
    --agst-bg: #FFF9FA;
    --agst-surface: rgba(255, 255, 255, 0.85);
    --agst-glass-bg: rgba(255, 255, 255, 0.7);
    --agst-glass-border: rgba(240, 98, 146, 0.1);
    --agst-text: #2D3436;
    --agst-text-muted: #636E72;
    --agst-border: #FEE2E2;
    --agst-shadow: 0 20px 40px rgba(240, 98, 146, 0.1);
    --agst-radius: 28px;
    --agst-transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.agst-portal-container {
    font-family: 'Outfit', sans-serif;
    display: flex;
    min-height: 85vh;
    background: var(--agst-bg);
    border-radius: var(--agst-radius);
    overflow: hidden;
    box-shadow: var(--agst-shadow);
    color: var(--agst-text);
    position: relative;
}

/* Login Screen */
.agst-portal-login-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, var(--agst-pink-light), var(--agst-bg));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.agst-portal-login-card {
    background: var(--agst-glass-bg);
    backdrop-filter: blur(25px);
    border: 1px solid var(--agst-glass-border);
    padding: 50px;
    border-radius: var(--agst-radius);
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.05);
    animation: slideUp 0.6s ease;
}

.agst-portal-login-logo {
    font-size: 32px;
    color: var(--agst-pink-primary);
    margin-bottom: 30px;
}

/* Sidebar */
.agst-portal-sidebar {
    width: 280px;
    background: var(--agst-glass-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--agst-glass-border);
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
}

.agst-portal-logo {
    font-weight: 700;
    font-size: 22px;
    color: var(--agst-pink-primary);
    margin-bottom: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 15px;
}

.agst-portal-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agst-portal-nav-item {
    padding: 16px 20px;
    border-radius: 20px;
    color: var(--agst-text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: var(--agst-transition);
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.agst-portal-nav-item:hover {
    background: rgba(240, 98, 146, 0.08);
    color: var(--agst-pink-primary);
    transform: translateX(5px);
}

.agst-portal-nav-item.active {
    background: linear-gradient(135deg, var(--agst-pink-primary), var(--agst-pink-dark));
    color: #FFF;
    box-shadow: 0 10px 25px rgba(240, 98, 146, 0.4);
}

/* Content Area */
.agst-portal-main {
    flex: 1;
    padding: 50px;
    overflow-y: auto;
    background: var(--agst-surface);
}

.agst-portal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    /* Fixed overlap */
    margin-bottom: 50px;
}

.agst-portal-header-title h1 {
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.5px;
}

.agst-portal-header-title p {
    color: var(--agst-text-muted);
    margin: 5px 0 0 0;
    font-size: 15px;
}

.agst-portal-user-badge {
    background: var(--agst-pink-light);
    color: var(--agst-pink-dark);
    padding: 8px 18px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 4px 10px rgba(240, 98, 146, 0.1);
}

/* Cards & Grid */
.agst-portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.agst-portal-card {
    background: #FFF;
    border: 1px solid var(--agst-border);
    border-radius: var(--agst-radius);
    padding: 30px;
    transition: var(--agst-transition);
}

.agst-portal-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.03);
}

.agst-clickable-card {
    cursor: pointer;
}

.agst-portal-card-label {
    font-size: 14px;
    color: var(--agst-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.agst-portal-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--agst-pink-primary);
    margin-top: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tables & Badges */
.agst-portal-table-wrapper {
    background: #FFF;
    border: 1px solid var(--agst-border);
    border-radius: var(--agst-radius);
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.02);
}

.agst-portal-badge {
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.agst-portal-tab-content {
    display: none;
}

.agst-portal-tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

/* Utils */
.agst-portal-input {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid var(--agst-border);
    border-radius: 20px;
    background: #FFF;
    font-family: inherit;
    font-size: 15px;
    margin-bottom: 20px;
    transition: var(--agst-transition);
}

.agst-portal-input:focus {
    outline: none;
    border-color: var(--agst-pink-primary);
    box-shadow: 0 0 0 4px var(--agst-pink-light);
}

.agst-portal-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--agst-pink-primary), var(--agst-pink-dark));
    color: #FFF;
    border: none;
    padding: 15px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: var(--agst-transition);
}

.agst-portal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(240, 98, 146, 0.3);
}

/* --- Responsive & Mobile Optimization --- */

@media (max-width: 1024px) {
    .agst-portal-sidebar {
        width: 240px;
    }

    .agst-portal-main {
        padding: 30px;
    }

    .agst-portal-grid {
        gap: 20px;
    }
}

@media (max-width: 850px) {
    .agst-portal-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        border-radius: 0;
    }

    .agst-portal-sidebar {
        width: 100%;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid var(--agst-glass-border);
    }

    .agst-portal-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 5px;
        -webkit-overflow-scrolling: touch;
    }

    .agst-portal-nav-item {
        padding: 12px 18px;
        white-space: nowrap;
        font-size: 14px;
    }

    .agst-portal-main {
        padding: 25px 20px 100px;
    }

    /* Space for bottom nav */
    .agst-portal-header {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 30px;
    }
}

/* Mobile App-Like Experience (Under 600px) */
@media (max-width: 600px) {
    :root {
        --agst-radius: 18px;
    }

    /* Hide sidebar, use bottom nav */
    .agst-portal-sidebar {
        display: none;
    }

    /* Dedicated Mobile Nav */
    .agst-mobile-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(15px);
        border-top: 1px solid var(--agst-border);
        justify-content: space-around;
        padding: 10px 5px 25px;
        /* Extra bottom for safe area */
        z-index: 1001;
        box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    }

    .agst-mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        color: var(--agst-text-muted);
        font-size: 10px;
        font-weight: 600;
        cursor: pointer;
        width: 20%;
        transition: var(--agst-transition);
    }

    .agst-mobile-nav-item span.dashicons {
        font-size: 22px;
        width: 22px;
        height: 22px;
    }

    .agst-mobile-nav-item.active {
        color: var(--agst-pink-primary);
    }

    .agst-portal-main {
        padding: 20px 15px 120px;
    }

    .agst-portal-header-title h1 {
        font-size: 24px;
    }

    .agst-portal-user-badge {
        display: none;
    }

    /* Focus on content */

    .agst-portal-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .agst-portal-card {
        padding: 20px;
    }

    .agst-portal-card-value {
        font-size: 28px;
    }

    /* Table to Card Transformation */
    .agst-portal-table thead,
    .agst-portal-pane table.widefat thead {
        display: none;
    }

    .agst-portal-table tr,
    .agst-portal-pane table.widefat tr {
        display: block;
        background: #FFF;
        border: 1px solid var(--agst-border);
        border-radius: 15px;
        margin-bottom: 12px;
        padding: 15px;
    }

    .agst-portal-table td,
    .agst-portal-pane table.widefat td {
        display: flex;
        justify-content: space-between;
        padding: 6px 0 !important;
        border: none !important;
        font-size: 13px;
    }

    .agst-portal-table td:before,
    .agst-portal-pane table.widefat td:before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--agst-text-muted);
    }

    /* Form Adjustments */
    .agst-portal-pane {
        padding: 20px;
        border-radius: 20px;
    }

    .agst-portal-pane .form-table th {
        width: 100%;
        display: block;
        padding: 10px 0 5px;
    }

    .agst-portal-pane .form-table td {
        width: 100%;
        display: block;
        padding: 0 0 15px;
    }

    .agst-portal-pane input,
    .agst-portal-pane select,
    .agst-portal-pane textarea {
        max-width: 100%;
    }

    /* Calendar Mobile */
    .agst-cal-days {
        gap: 4px;
    }

    .agst-cal-day {
        min-height: 80px;
        padding: 5px;
        border-radius: 10px;
    }

    .agst-cal-day-num {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .agst-cal-event {
        padding: 2px 4px;
        font-size: 9px;
    }

    #agst-next-appt-bar {
        margin: 0 10px 20px 10px !important;
        padding: 12px 18px !important;
        border-radius: 15px !important;
    }

    #agst-next-appt-timer {
        font-size: 16px !important;
        padding: 4px 10px !important;
    }

    #agst-next-appt-info {
        font-size: 13px !important;
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

#agst-next-appt-bar {
    animation: slideDown 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Adapted Admin Content Styles */
.agst-portal-pane {
    background: #FFF;
    border: 1px solid var(--agst-border);
    border-radius: var(--agst-radius);
    padding: 35px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.02);
    animation: slideUp 0.5s ease;
}

.agst-portal-pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--agst-border);
}

.agst-portal-pane-header h2 {
    font-size: 24px;
    margin: 0;
    color: var(--agst-text);
}

/* WP Table Adaptation */
.agst-portal-pane table.widefat {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.agst-portal-pane table.widefat thead th {
    background: var(--agst-pink-soft);
    padding: 15px 20px;
    font-weight: 700;
    color: var(--agst-pink-dark);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    border: none;
}

.agst-portal-pane table.widefat tbody td {
    padding: 15px 20px;
    border-bottom: 1px solid var(--agst-pink-soft);
    font-size: 14px;
    vertical-align: middle;
}

.agst-portal-pane table.widefat tbody tr:hover td {
    background: var(--agst-pink-soft);
}

/* WP Form Adaptation */
.agst-portal-pane .form-table {
    width: 100%;
    margin-top: 10px;
}

.agst-portal-pane .form-table th {
    width: 200px;
    padding: 15px 10px 15px 0;
    font-weight: 600;
    color: var(--agst-text);
    text-align: left;
    vertical-align: top;
}

.agst-portal-pane .form-table td {
    padding: 10px 0;
}

.agst-portal-pane input[type="text"],
.agst-portal-pane input[type="number"],
.agst-portal-pane input[type="email"],
.agst-portal-pane input[type="password"],
.agst-portal-pane select,
.agst-portal-pane textarea {
    width: 100%;
    max-width: 400px;
    padding: 10px 15px;
    border: 1px solid var(--agst-border);
    border-radius: 12px;
    font-size: 14px;
    background: var(--agst-pink-soft);
    transition: var(--agst-transition);
}

.agst-portal-pane input:focus,
.agst-portal-pane select:focus,
.agst-portal-pane textarea:focus {
    outline: none;
    border-color: var(--agst-pink-primary);
    background: #FFF;
}

/* Specific UI Elements */
.agst-portal-pane .agst-service-grid,
.agst-portal-pane .agst-addon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.agst-portal-pane .agst-service-card,
.agst-portal-pane .agst-addon-card {
    background: #FFF;
    border: 1px solid var(--agst-border);
    border-radius: 20px;
    padding: 20px;
    transition: var(--agst-transition);
}

.agst-portal-pane .agst-service-card:hover {
    transform: translateY(-5px);
    border-color: var(--agst-pink-primary);
}

.agst-portal-btn-secondary {
    display: inline-block;
    background: #FFF;
    color: var(--agst-pink-primary);
    border: 1px solid var(--agst-pink-primary);
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: var(--agst-transition);
}

.agst-portal-btn-secondary:hover {
    background: var(--agst-pink-primary);
    color: #FFF;
}

/* Calendar Portal Redesign */
.agst-iphone-calendar-container {
    background: #FFF;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--agst-border);
}

.agst-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.agst-cal-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.agst-cal-nav h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--agst-text);
    margin: 0;
}

.agst-cal-btn {
    text-decoration: none;
    font-size: 24px;
    color: var(--agst-pink-primary);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--agst-pink-soft);
    border-radius: 50%;
    transition: var(--agst-transition);
}

.agst-cal-btn:hover {
    background: var(--agst-pink-primary);
    color: #FFF;
}

.agst-cal-day-labels {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    padding: 15px 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--agst-text-muted);
    text-transform: uppercase;
}

.agst-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    padding-top: 10px;
}

.agst-cal-day {
    min-height: 120px;
    background: var(--agst-pink-soft);
    border-radius: 16px;
    padding: 12px;
    transition: var(--agst-transition);
    border: 1px solid transparent;
}

.agst-cal-day:hover {
    background: #FFF;
    border-color: var(--agst-pink-primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 51, 102, 0.05);
}

.agst-cal-day-num {
    font-size: 14px;
    font-weight: 700;
    color: var(--agst-text);
    margin-bottom: 8px;
    display: inline-block;
}

.agst-cal-today {
    background: var(--agst-pink-primary) !important;
}

.agst-cal-today .agst-cal-day-num {
    color: #FFF;
}

.agst-cal-event {
    background: #FFF;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11px;
    margin-top: 6px;
    border-left: 3px solid var(--agst-pink-primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.agst-cal-event-time {
    font-weight: 700;
    color: var(--agst-pink-primary);
    display: block;
}

.agst-cal-event-name {
    color: var(--agst-text);
    font-weight: 600;
}

/* Day View Enhancements — Portal Overrides */
/* Use the same flexbox model as admin.css to ensure time labels align with grid lines */
.agst-timeline-container {
    display: flex !important;
    height: 780px;
    overflow-y: auto;
    position: relative;
    background: #fff;
    padding: 20px 0 !important; /* Reset the padding-left from any prior override */
    margin-top: 20px;
}

.agst-time-gutter {
    position: static !important; /* Override the absolute positioning */
    width: 80px !important;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding-top: 10px;
}

.agst-time-label {
    height: 60px;
    font-size: 12px;
    font-weight: 700;
    color: var(--agst-pink-primary);
    text-align: right;
    padding-right: 16px;
    box-sizing: border-box;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    opacity: 0.75;
}

.agst-timeline-grid {
    flex-grow: 1;
    position: relative;
    border-left: 1px solid var(--agst-border);
    margin-right: 20px;
    background-image: linear-gradient(var(--agst-border) 1px, transparent 1px);
    background-size: 100% 60px;
}

/* Now indicator: match the 80px gutter width */
.agst-now-indicator {
    left: 80px !important;
}

.agst-timeline-event {
    position: absolute;
    left: 10px;
    right: 10px;
    border-radius: 12px;
    padding: 10px 15px;
    background: #FFF;
    border-left: 4px solid var(--agst-pink-primary);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    cursor: pointer;
    transition: var(--agst-transition);
}

.agst-timeline-event:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.agst-event-content {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.event-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--agst-text);
}

.event-service {
    font-size: 12px;
    color: var(--agst-text-muted);
}

/* ── Action Buttons (Edit / Delete) ─────────────────────────── */
.agst-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--agst-border);
    border-radius: 6px;
    padding: 5px 8px;
    cursor: pointer;
    color: var(--agst-text-muted);
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    line-height: 1;
}

.agst-action-btn svg {
    display: block;
    stroke: currentColor;
}

.agst-action-btn:hover {
    background: var(--agst-pink-light);
    border-color: var(--agst-pink-primary);
    color: var(--agst-pink-dark);
}

.agst-action-delete:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

.agst-actions {
    white-space: nowrap;
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ══════════════════════════════════════════════════════════════
   MOBILE REDESIGN — Hamburger + Left Drawer
   ══════════════════════════════════════════════════════════════ */

/* Hide hamburger on desktop */
.agst-hamburger {
    display: none;
}

/* Hide drawer elements on desktop */
.agst-drawer-overlay,
.agst-drawer-sidebar {
    display: none;
}

/* Hide floating social buttons when portal page is loaded */
body:has(.agst-portal-container) .agst-floating-socials,
body:has(.agst-portal-container) .agst-float-btn,
body:has(.agst-portal-container) .agst-float-wa,
body:has(.agst-portal-container) .agst-float-ig {
    display: none !important;
}


@media (max-width: 768px) {

    /* ── Root overflow fix — stops ALL horizontal scrolling ── */
    html,
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Override WordPress admin min-widths that cause overflow */
    body {
        min-width: 0 !important;
    }

    /* Constrain the plugin's form wrap that admin.css sets to 1200px */
    .agst-wrap {
        max-width: 100% !important;
        width: 100% !important;
        overflow-x: hidden;
    }

    /* ── Layout ─────────────────────────────────────────────── */
    .agst-portal-container {
        flex-direction: column;
        min-height: 100dvh;
        border-radius: 0;
        overflow-x: hidden;
    }

    /* Hide desktop sidebar */
    .agst-portal-sidebar {
        display: none !important;
    }

    /* Main content full-width with comfortable padding */
    .agst-portal-main {
        padding: 0 0 32px 0;
        width: 100%;
        overflow-x: hidden;
    }

    /* ── Header ──────────────────────────────────────────────── */
    .agst-portal-header {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px 18px;
        margin-bottom: 24px;
        background: #fff;
        border-bottom: 1px solid var(--agst-border);
        position: sticky;
        top: 0;
        z-index: 100;
        box-shadow: 0 2px 8px rgba(240, 98, 146, 0.08);
    }

    .agst-portal-header-title {
        flex: 1;
        min-width: 0;
    }

    .agst-portal-header-title h1 {
        font-size: 20px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }

    .agst-portal-header-title p {
        display: none; /* hide subtitle on mobile for space */
    }

    .agst-portal-user-badge {
        font-size: 11px;
        padding: 6px 12px;
        white-space: nowrap;
    }

    /* ── Hamburger Button ────────────────────────────────────── */
    .agst-hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 6px;
        flex-shrink: 0;
        border-radius: 10px;
        transition: background 0.2s;
    }

    .agst-hamburger:hover {
        background: var(--agst-pink-light);
    }

    .agst-hamburger span {
        display: block;
        width: 22px;
        height: 2.5px;
        background: var(--agst-pink-primary);
        border-radius: 2px;
        transition: all 0.25s;
    }

    /* ── Drawer Overlay (dark backdrop) ─────────────────────── */
    .agst-drawer-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 998;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .agst-drawer-overlay.open {
        opacity: 1;
        pointer-events: auto;
    }

    /* ── Left Drawer Sidebar ────────────────────────────────── */
    .agst-drawer-sidebar {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        background: #fff;
        z-index: 999;
        padding: 0;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
    }

    .agst-drawer-sidebar.open {
        transform: translateX(0);
    }

    /* Drawer header with logo + close button */
    .agst-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 20px 20px 10px 20px;
        border-bottom: 1px solid var(--agst-border);
    }

    .agst-drawer-close {
        background: none;
        border: none;
        cursor: pointer;
        padding: 6px;
        border-radius: 8px;
        color: var(--agst-text-muted);
        display: flex;
        align-items: center;
        transition: background 0.2s, color 0.2s;
    }

    .agst-drawer-close:hover {
        background: var(--agst-pink-light);
        color: var(--agst-pink-primary);
    }

    /* Nav inside drawer — always vertical */
    .agst-drawer-nav {
        display: flex;
        flex-direction: column;
        padding: 16px 12px;
        gap: 6px;
    }

    .agst-drawer-nav .agst-portal-nav-item {
        border-radius: 14px;
        font-size: 15px;
        padding: 14px 16px;
    }

    /* lock body scroll when drawer is open */
    body.agst-drawer-open {
        overflow: hidden;
    }

    /* ── Dashboard Cards ─────────────────────────────────────── */
    .agst-portal-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 16px;
        margin-bottom: 28px;
    }

    .agst-portal-card {
        padding: 20px;
        border-radius: 18px;
    }

    .agst-portal-card-value {
        font-size: 28px;
    }

    /* ── Section / Tables ────────────────────────────────────── */
    .agst-portal-section {
        padding: 0 16px;
    }

    .agst-portal-table-wrapper {
        border-radius: 16px;
        overflow: scroll;
    }

    /* ── Tab content — allow children to scroll, body handles page overflow */
    .agst-portal-tab-content {
        padding: 0 10px;
        overflow-x: visible;
        box-sizing: border-box;
        width: 100%;
    }

    /* Tables and their wrappers scroll horizontally */
    .agst-portal-tab-content .agst-portal-table-wrapper,
    .agst-portal-tab-content .agst-table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
    }

    /* ── Responsive Tables: transform rows into cards ───────── */

    /* Hide table header on mobile */
    .agst-portal-tab-content .agst-table thead {
        display: none;
    }

    /* Each row becomes a card */
    .agst-portal-tab-content .agst-table,
    .agst-portal-tab-content .agst-table tbody,
    .agst-portal-tab-content .agst-table tr {
        display: block;
        width: 100%;
    }

    .agst-portal-tab-content .agst-table tr {
        background: #fff;
        border: 1px solid var(--agst-border);
        border-radius: 14px;
        margin-bottom: 12px;
        padding: 12px 14px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        box-shadow: 0 1px 6px rgba(240,98,146,0.06);
    }

    /* Each cell is displayed as a labelled flex item */
    .agst-portal-tab-content .agst-table td {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13px;
        border: none;
        padding: 0;
        width: auto;
    }

    /* Show the column label before each value */
    .agst-portal-tab-content .agst-table td[data-label]::before {
        content: attr(data-label) ": ";
        font-weight: 700;
        font-size: 11px;
        text-transform: uppercase;
        color: var(--agst-text-muted);
        letter-spacing: 0.04em;
        white-space: nowrap;
    }

    /* FOTO & COR cells — no label needed */
    .agst-portal-tab-content .agst-table td:first-child::before,
    .agst-portal-tab-content .agst-table td:nth-child(2)::before {
        content: none;
    }

    /* First cell (foto) takes full row width and acts as header */
    .agst-portal-tab-content .agst-table td:first-child {
        width: 100%;
    }

    /* AÇÕES cell — push to end */
    .agst-portal-tab-content .agst-table td.agst-actions {
        margin-left: auto;
    }

    /* Remove rounded corners from card wrapper (row IS the card now) */
    .agst-portal-tab-content .agst-card,
    .agst-portal-tab-content .agst-list-card {
        background: transparent;
        box-shadow: none;
        border: none;
        padding: 0;
        overflow: visible;
    }

    /* Keep agst-wrap as normal block */
    .agst-portal-tab-content .agst-wrap {
        max-width: 100%;
        overflow: visible;
    }


    /* Keep the iphone-style grid at a comfortable minimum */
    .agst-portal-tab-content .agst-iphone-grid {
        min-width: 310px;
        margin: 0 auto;
    }

    /* Day labels row — compact and legible */
    .agst-portal-tab-content .agst-cal-day-labels {
        max-width: none !important;
        padding: 8px 0;
        font-size: 0.65rem;
        letter-spacing: 0.03em;
    }

    /* Calendar grid cells — square, compact */
    .agst-portal-tab-content .agst-cal-days {
        max-width: none !important;
        gap: 2px;
    }

    .agst-portal-tab-content .agst-cal-day {
        min-height: 48px !important;
        max-width: none !important;
        padding: 5px 4px;
        border-radius: 0;
        display: flex;
        flex-wrap: wrap;
        align-content: flex-start;
        justify-content: center;
        gap: 2px;
    }

    /* Date number — takes full width to stay on top */
    .agst-portal-tab-content .agst-cal-date {
        font-size: 0.75rem;
        width: 100%;
        height: 20px;
        line-height: 20px;
        margin-bottom: 2px;
    }

    /* Events inside cells — show as small colored dots instead of full cards */
    .agst-portal-tab-content .agst-cal-event {
        font-size: 0;        /* hide text */
        width: 6px;
        height: 6px;
        border-radius: 50%;
        padding: 0;
        margin: 0;
        display: block;
        min-height: 0;
        line-height: 0;
        flex-shrink: 0;
    }

    /* Calendar navigation header — compact */
    .agst-portal-tab-content .agst-calendar-header {
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 12px;
        padding: 0 4px;
    }

    .agst-portal-tab-content .agst-cal-nav h2 {
        font-size: 1rem;
    }

    /* View toggle buttons (Mês / Dia) */
    .agst-portal-tab-content .agst-view-toggle {
        font-size: 12px;
        padding: 5px 10px;
    }

    /* Upcoming appointments list — full width stacked cards */
    .agst-portal-tab-content .agst-upcoming-list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .agst-portal-tab-content .agst-upcoming-item {
        border-radius: 12px;
        padding: 12px;
        font-size: 13px;
    }


    /* Tables — horizontal scroll */
    .agst-portal-tab-content .agst-portal-table-wrapper {
        overflow-x: auto;
        max-width: 100%;
    }

    /* Forms inside tabs — prevent inputs from overflowing */
    .agst-portal-tab-content input,
    .agst-portal-tab-content select,
    .agst-portal-tab-content textarea,
    .agst-portal-tab-content .agst-portal-input {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        font-size: 16px; /* prevents iOS zoom */
    }

    /* Image previews */
    .agst-portal-tab-content img {
        max-width: 100% !important;
        height: auto !important;
    }



    /* Hide floating social buttons on all screens when inside portal */
    .agst-floating-socials,
    .agst-float-btn,
    .agst-float-wa,
    .agst-float-ig {
        display: none !important;
    }
}
