/* 
 * Professional Web Application Framework for Gestão de Plantão
 * Designed by WP Masters
 */

@keyframes wamSlideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.1);
    --secondary: #ec4899;
    --dark: #0f172a;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 84px;
    --topbar-height: 70px;
    --text-main: #1e293b;
    --text-light: #64748b;
    --bg-app: #f8fafc;
    --white: #ffffff;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-app);
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

/* App Layout Structure */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    transition: width 0.25s ease;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-header {
    padding: 30px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.sidebar-header i {
    color: var(--primary);
    font-size: 24px;
}

.sidebar-nav {
    flex: 1;
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 5px;
    transition: all 0.2s;
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar-separator {
    padding: 20px 15px 8px;
    font-size: 11px;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* User Menu Dropdown */
#user-menu-dropdown a {
    color: inherit !important;
}

#user-menu-dropdown a:hover {
    text-decoration: none !important;
}


.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.u-name {
    font-size: 14px;
    font-weight: 600;
}

.u-role {
    font-size: 11px;
    color: #94a3b8;
    text-transform: uppercase;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ef4444;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.25s ease;
}

.top-bar {
    height: var(--topbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
}

.sidebar-collapse-toggle {
    height: 38px;
    padding: 0 12px;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
    transition: all 0.2s ease;
    margin-right: 8px;
}

.sidebar-collapse-toggle:hover {
    border-color: #c7d2fe;
    color: #312e81;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.18);
    transform: translateY(-1px);
}

.sidebar-collapse-toggle i {
    font-size: 14px;
}

.sidebar-collapse-toggle .toggle-text {
    letter-spacing: 0.2px;
}

body.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .sidebar-collapse-toggle .toggle-text {
    display: none;
}

body.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding-left: 8px;
    padding-right: 8px;
}

body.sidebar-collapsed .sidebar-header span,
body.sidebar-collapsed .sidebar-separator span,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .user-details,
body.sidebar-collapsed .logout-label {
    display: none;
}

body.sidebar-collapsed .sidebar-separator {
    padding: 16px 0 8px;
    text-align: center;
}

body.sidebar-collapsed .nav-item {
    justify-content: center;
    padding: 12px;
    gap: 0;
}

body.sidebar-collapsed .sidebar-footer {
    padding: 16px 8px;
}

body.sidebar-collapsed .user-info {
    justify-content: center;
    margin-bottom: 12px;
}

body.sidebar-collapsed .logout-btn {
    justify-content: center;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
}

.content-wrapper {
    padding: 30px;
}

/* Layout System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-8 {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
    padding: 0 15px;
}

.col-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 15px;
}

@media (max-width: 1024px) {

    .col-8,
    .col-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}



/* Alert Info / Notice Box */
.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-info i {
    margin-top: 3px;
}

.alert-info p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.admin-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.col-lg-12 {
    width: 100% !important;
}
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    padding: 10px;
}

.card-body {
    padding: 0;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    padding: 0 20px 20px 20px;
}

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

.table.no-padding {
    padding: 0;
}

.table thead th {
    background: var(--bg-app);
    padding: 15px;
    text-align: left;
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
}

.table tbody td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.table-hover tbody tr:hover {
    background: var(--bg-app);
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-light {
    background: var(--white);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-light:hover {
    background: var(--bg-app);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--primary);
    cursor: pointer;
}

/* Badges */
.badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    letter-spacing: 0.3px;
}

.badge-success {
    background: #d1fae5;
    color: #065f46;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-secondary {
    background: #f1f5f9;
    color: #475569;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Modal Styling */
.modal-overlay,
#cp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--white);
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.2s;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* Tables & Forms */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
}

.admin-table th {
    background: var(--bg-app);
    padding: 15px;
    text-align: left;
    font-size: 12px;
    color: var(--text-light);
    text-transform: uppercase;
}

.admin-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border);
}

.wam-input-group {
    margin-bottom: 40px;
}

.wam-input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 13px;
}

.wam-input-group input,
.wam-input-group select,
.wam-input-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-app);
    font-family: inherit;
    min-height: 48px;
}

/* Ensure buttons in search groups have same height */
.mrs-plugin-search-container input,
.mrs-plugin-search-container .btn {
    height: 52px !important;
    display: flex;
    align-items: center;
}

.wam-submit-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

/* Admin Footer (Required) */
#wpm-admin-footer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-size: 12px;
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.5);
    z-index: 9999;
}

#wpm-admin-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
}

/* Dashboard UI */
.page-header-actions {
    display: flex;
    gap: 10px;
}

.btn-secondary {
    background: var(--dark);
    color: white;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
}

/* Public Page Header */
.public-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 30px 20px;
    text-align: center;
    border-radius: 0 0 40px 40px;
    margin-bottom: 60px;
}

/* Notifications */
#notification-container {
    position: fixed !important;
    top: 30px;
    right: 30px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 15px;
    pointer-events: none;
    width: max-content;
    height: max-content;
    max-width: 400px;
    margin: 0;
    padding: 0;
}

#notification-container>* {
    pointer-events: all;
}

.wam-notification {
    background: var(--white);
    padding: 18px 25px;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1);
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 320px;
    transform: translateX(120%);
    transition: all .5s cubic-bezier(.68, -.55, .27, 1.55);
    border-left: 6px solid var(--border);
}

.wam-notification.show {
    transform: translateX(0);
}

.wam-notification.success {
    border-left-color: #10b981;
}

.wam-notification.error {
    border-left-color: #ef4444;
}

.wam-notification.info {
    border-left-color: #3b82f6;
}

.wam-notification i {
    font-size: 20px;
}

.wam-notification.success i {
    color: #10b981;
}

.wam-notification.error i {
    color: #ef4444;
}

.wam-notification.info i {
    color: #3b82f6;
}

.wam-notification-content {
    flex: 1;
}

.wam-notification-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 2px;
}

.wam-notification-message {
    font-size: 13px;
    color: var(--text-light);
}

.version-badge {
    background: var(--primary-light);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tabs */
.tabs-header {
    display: flex;
    gap: 5px;
    margin-bottom: 25px;
    background: #f1f5f9;
    padding: 5px;
    border-radius: 12px;
    width: fit-content;
}

.tab-btn {
    padding: 10px 25px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    color: #64748b;
    background: transparent;
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}


/* Accordion Styles */
.team-accordion {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
}

.team-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
}

.team-header:hover {
    background: #f8fafc;
}

.team-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--text);
    font-size: 15px;
}

.team-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 13px;
    color: var(--text-light);
}

.team-tab-content {
    display: none;
}

.team-tab-content.active {
    display: block;
}

.team-content {
    display: none;
    padding: 15px 20px;
    background: #fcfdfe;
    border-top: 1px solid var(--border);
}

.team-content.active {
    display: block;
}

.gestor-node {
    background: #f0f9ff;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #1e40af;
    font-size: 13px;
    margin-bottom: 10px;
}

.plantonista-node {
    padding: 6px 12px;
    margin-bottom: 5px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    margin-left: 15px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
}

.calendar-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 20px;
}

/* Utils */
.d-flex {
    display: flex;
}

.d-none {
    display: none;
}

.flex-1 {
    flex: 1;
}

.w-100 {
    width: 100%;
}

.min-height-80 {
    min-height: 80px;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 8px;
}
.gap-3{
    gap: 12px;
}
.mb-0 {
    margin-bottom: 0;
}

.mb-4 {
    margin-bottom: 24px;
}

.ml-1 {
    margin-left: 8px;
}

.ml-2 {
    margin-left: 16px;
}

.ml-3 {
    margin-left: 24px;
}

.ml-auto {
    margin-left: auto;
}

.mr-1 {
    margin-right: 8px;
}

.mr-2 {
    margin-right: 5px;
}

.mr-3 {
    margin-right: 24px;
}

.mt-4 {
    margin-top: 32px;
}

.p-0 {
    padding: 0;
}

.p-1 {
    padding: 8px;
}

.p-3 {
    padding: 24px;
}

.px-2 {
    padding-left: 16px;
    padding-right: 16px;
}

.px-3 {
    padding-left: 24px;
    padding-right: 24px;
}

.px-4 {
    padding-right: 32px;
    padding-bottom: 10px;
}

.py-1 {
    padding-top: 8px;
    padding-bottom: 8px;
}

.py-2 {
    padding-top: 16px;
    padding-bottom: 16px;
}

.py-3 {
    padding-top: 24px;
    padding-bottom: 24px;
}

.py-5 {
    padding-top: 40px;
    padding-bottom: 40px;
}

.pt-4 {
    padding-top: 32px;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}
.text-left {
    text-align: left;
}
.text-muted {
    color: var(--text-light);
}

.text-dark {
    color: var(--text-main);
}

.text-danger {
    color: #ef4444;
}

.text-primary {
    color: var(--primary);
}

.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.font-weight-bold {
    font-weight: 700;
}

.font-mono {
    font-family: 'Courier New', monospace;
}

.small {
    font-size: 13px;
}

.x-small {
    font-size: 11px;
}

.bg-light {
    background: var(--bg-app);
}

.bg-dark {
    background: var(--dark);
}

.border {
    border: 1px solid var(--border);
}

.border-top {
    border-top: 1px solid var(--border);
}

.rounded {
    border-radius: 8px;
}

.cursor-pointer {
    cursor: pointer;
}

.flex-wrap {
    flex-wrap: wrap;
}

.align-middle {
    vertical-align: middle;
}

.h4 {
    font-size: 1.5rem;
}

/* Row/Col Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -10px;
    margin-right: -10px;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 10px;
    padding-right: 10px;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-left: 10px;
    padding-right: 10px;
}

@media (max-width: 768px) {
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Modern Toggle Switch */
.wam-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.wam-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.wam-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .4s;
    border-radius: 24px;
}

.wam-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.wam-slider {
    background-color: var(--primary);
}

input:checked+.wam-slider:before {
    transform: translateX(20px);
}



/* --- Responsive Mobile Styles --- */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-main);
    cursor: pointer;
    padding: 10px;
    margin-left: -10px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    /* Above sidebar-overlay but below sidebar */
    backdrop-filter: blur(2px);
}

@media (max-width: 1024px) {
    :root {
        --sidebar-width: 0px;
        --topbar-height: 60px;
    }

    .sidebar {
        left: -260px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        width: 260px;
        visibility: hidden;
    }

    .sidebar.open {
        transform: translateX(260px);
        visibility: visible;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .sidebar-collapse-toggle {
        display: none;
    }

    body.sidebar-collapsed .main-content {
        margin-left: 0;
    }

    .sidebar-overlay.show {
        display: block;
        z-index: 999;
    }

    .top-bar {
        padding: 0 15px;
        gap: 10px;
    }

    .page-title {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
    }

    .content-wrapper {
        padding: 15px;
    }

    .top-bar-actions {
        display: none !important;
    }

    /* Grids stacking */
    .admin-grid,
    .calendar-layout {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Tables horizontal scroll */
    .admin-section {
        overflow-x: auto;
    }

    .admin-table {
        min-width: 700px;
    }

    /* Modals */
    .modal-content {
        padding: 20px;
        width: 95%;
        margin: 5% auto;
    }

    /* Target generic flex and grid containers used in settings and reports */
    [style*="grid-template-columns: 1fr 1fr;"] {
        grid-template-columns: 1fr !important;
    }

    [style*="display: flex; gap: 15px; flex-wrap: wrap;"],
    [style*="display: flex; gap: 10px; margin-bottom: 30px;"] {
        flex-direction: column !important;
        align-items: stretch !important;
    }

    [style*="min-width: 250px;"],
    [style*="min-width: 150px;"],
    [style*="min-width: 200px;"] {
        min-width: 100% !important;
    }

    /* Tabs scrollable */
    div[style*="display: flex; border-bottom: 1px solid var(--border); background: #f8fafc;"] {
        overflow-x: auto;
        white-space: nowrap;
        flex-wrap: nowrap;
    }
}

@media (max-width: 480px) {
    .public-header {
        padding: 20px 10px;
        border-radius: 0 0 24px 24px;
    }

    .public-header h1 {
        font-size: 1.5rem;
    }

    .header-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .header-actions .btn,
    .header-actions>div {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* Progress Bar for Remaining Days */
.mrs-progress-container {
    background: #f1f5f9;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    flex-grow: 1;
}

.mrs-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.mrs-progress-bar.success {
    background: #10b981;
}

.mrs-progress-bar.warning {
    background: #f59e0b;
}

.mrs-progress-bar.danger {
    background: #ef4444;
}

/* Base Button Red/Danger Style */
.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* --- GLOBAL PREMIUM CARD SYSTEM --- */
.card-premium {
    border: none !important;
    position: relative;
    overflow: hidden;
    color: white !important;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-premium:hover {
    transform: translateY(-5px);
}

.card-premium.blue {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

.card-premium.purple {
    background: linear-gradient(135deg, #581c87 0%, #a855f7 100%);
}

.card-premium.green {
    background: linear-gradient(135deg, #064e3b 0%, #10b981 100%);
}

.card-premium.orange {
    background: linear-gradient(135deg, #7c2d12 0%, #f97316 100%);
}

.card-premium.dark {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.card-premium.teal {
    background: linear-gradient(135deg, #0d9488 0%, #2dd4bf 100%);
}

.card-premium .card-header-premium {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    position: relative;
    z-index: 2;
}

.card-premium .card-header-premium h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.82) !important;
    margin: 0;
}

.card-premium .card-header-premium i {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.4);
}

.card-premium .card-value-premium {
    font-size: 28px;
    font-weight: 800;
    color: white !important;
    margin: 10px 0 5px;
    position: relative;
    z-index: 2;
}

.card-premium .card-desc-premium {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6) !important;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

/* For cards with horizontal layout like mrs-stat-card */
.card-premium.flex-row-layout {
    flex-direction: row;
    align-items: center;
    gap: 20px;
}

.card-premium .bg-icon-premium {
    position: absolute;
    right: -15px;
    bottom: -15px;
    font-size: 80px;
    color: rgba(255, 255, 255, 0.08);
    z-index: 1;
    transform: rotate(-15deg);
    pointer-events: none;
}

/* Modern & Thin Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 10, 0.1);
    border-radius: 10px;
    transition: all 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 10, 0.2);
}

/* Custom File Input Premium Style */
.custom-file {
    position: relative;
    width: 100%;
    height: 48px;
}

.custom-file-input {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 48px;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.custom-file-label {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
    height: 48px;
    padding: 12px 16px;
    background: var(--bg-app);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    color: var(--text-light);
    font-size: 14px;
    transition: all 0.2s;
}

.custom-file-label::after {
    content: 'Selecionar';
    position: absolute;
    right: 5px;
    top: 5px;
    bottom: 5px;
    background: var(--primary);
    color: white;
    padding: 0 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 12px;
}

.custom-file-input:focus~.custom-file-label {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}