@import 'tailwindcss';

@source '../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php';
@source '../../storage/framework/views/*.php';
@source '../**/*.blade.php';
@source '../**/*.js';

@theme {
    --font-sans: 'Montserrat', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
        'Segoe UI Symbol', 'Noto Color Emoji';
}

:root {
    --afya-sidebar-width: 280px;
    --afya-sidebar-collapsed-width: 78px;
    --afya-primary: #0f5d8f;
    --afya-primary-soft: #eaf4fb;
    --afya-accent: #14b8a6;
    --afya-warning: #f59e0b;
    --afya-danger: #ef4444;
    --afya-surface: #f4f7fb;
    --afya-card: #ffffff;
    --afya-border: rgba(15, 93, 143, 0.12);
    --afya-text: #1f2937;
    --afya-muted: #6b7280;
    --afya-sidebar: #0d1b2a;
    --afya-sidebar-soft: rgba(15, 93, 143, 0.2);
    --afya-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

body {
    font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #edf3f8 0%, #f7fafc 100%);
    color: var(--afya-text);
}

.display-6 {
    font-size: 1.72rem;
}

.adminlte-shell {
    min-height: 100vh;
    background: linear-gradient(135deg, #ecf4fb 0%, #f8fafc 100%);
}

.sidebar-panel {
    position: relative;
    flex: 0 0 var(--afya-sidebar-width);
    width: var(--afya-sidebar-width);
    min-height: 100vh;
    overflow: visible;
    transition: flex-basis 0.25s ease, width 0.25s ease;
}

.sidebar-toggle {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(226, 236, 247, 0.2);
    border-radius: 10px;
    background: transparent;
    color: #e2ecf7;
    transition: background 0.2s ease, transform 0.2s ease;
}

.sidebar-toggle:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }

.sidebar-logo {
    display: block;
    width: 148px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.sidebar-panel .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
}

.sidebar-panel .nav-link i { width: 20px; text-align: center; }

.notifications-popover {
    position: absolute;
    z-index: 30;
    top: 4.5rem;
    right: 8.5rem;
    width: min(340px, calc(100vw - 2rem));
    padding: 1rem;
    border: 1px solid var(--afya-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--afya-shadow);
}

.notification-item { padding: 0.65rem 0; border-top: 1px solid #e2e8f0; }

.icd-suggestions {
    position: absolute;
    z-index: 20;
    left: 0.75rem;
    right: 0.75rem;
    top: 100%;
    background: #ffffff;
    border: 1px solid var(--afya-border);
    border-radius: 10px;
    box-shadow: var(--afya-shadow);
    overflow: hidden;
}

.icd-suggestion {
    display: block;
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 0;
    background: #ffffff;
    text-align: left;
}

.icd-suggestion:hover { background: var(--afya-primary-soft); }

.adminlte-shell.sidebar-collapsed .sidebar-panel {
    flex-basis: var(--afya-sidebar-collapsed-width);
    width: var(--afya-sidebar-collapsed-width);
}

.adminlte-shell.sidebar-collapsed .sidebar-panel > div:first-child { padding-left: 0.75rem !important; padding-right: 0.75rem !important; }
.adminlte-shell.sidebar-collapsed .sidebar-panel > div:first-child > div { justify-content: center !important; }
.adminlte-shell.sidebar-collapsed .sidebar-brand { display: none; }
.adminlte-shell.sidebar-collapsed .sidebar-label { display: none; }
.adminlte-shell.sidebar-collapsed .sidebar-panel .nav { overflow: visible; }
.adminlte-shell.sidebar-collapsed .sidebar-panel .nav-link { justify-content: center; padding-left: 0.5rem; padding-right: 0.5rem; position: relative; }
.adminlte-shell.sidebar-collapsed .sidebar-panel .nav-link i { flex: 0 0 20px; }
.adminlte-shell.sidebar-collapsed .sidebar-panel .nav-link:hover::after { content: attr(data-label); position: absolute; z-index: 40; left: calc(100% + 0.75rem); top: 50%; transform: translateY(-50%); padding: 0.5rem 0.7rem; border-radius: 8px; background: #12283d; color: #fff; white-space: nowrap; box-shadow: var(--afya-shadow); }
.adminlte-shell.sidebar-collapsed .sidebar-toggle i { transform: rotate(180deg); display: inline-block; }

.adminlte-topbar {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--afya-border);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.notification-button {
    position: relative;
    width: 42px;
    height: 42px;
    border: 1px solid var(--afya-border);
    border-radius: 14px;
    background: #ffffff;
    color: var(--afya-primary);
    font-size: 1rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

.notification-button:hover {
    background: var(--afya-primary-soft);
    transform: translateY(-1px);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: var(--afya-danger);
    color: #ffffff;
    font-size: 0.62rem;
    line-height: 14px;
    font-weight: 700;
}

.profile-menu {
    position: relative;
}

.profile-trigger {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--afya-border);
    border-radius: 14px;
    background: #ffffff;
    color: #475569;
    cursor: pointer;
    list-style: none;
    font-size: 0.85rem;
    font-weight: 600;
}

.profile-trigger::-webkit-details-marker {
    display: none;
}

.profile-chevron {
    color: #94a3b8;
    font-size: 0.7rem;
}

.profile-dropdown {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.6rem);
    right: 0;
    width: 220px;
    padding: 0.9rem;
    border: 1px solid var(--afya-border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: var(--afya-shadow);
}

.profile-dropdown-name {
    color: #1e293b;
    font-weight: 700;
}

.profile-dropdown-role {
    margin-top: 0.2rem;
    color: #64748b;
    font-size: 0.75rem;
}

.profile-dropdown-divider {
    height: 1px;
    margin: 0.75rem 0;
    background: #e2e8f0;
}

.profile-logout {
    width: 100%;
    padding: 0.6rem 0.7rem;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #b91c1c;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
}

.profile-logout:hover {
    background: #fef2f2;
}

.sidebar-panel {
    background: linear-gradient(180deg, var(--afya-sidebar) 0%, #12283d 100%);
    color: #e2ecf7;
}

.sidebar-panel .nav-link {
    color: rgba(226, 236, 247, 0.8);
    border-radius: 14px;
    padding: 0.8rem 1rem;
    transition: all 0.2s ease;
}

.sidebar-panel .nav-link:hover,
.sidebar-panel .nav-link.active {
    background: var(--afya-sidebar-soft);
    color: #ffffff;
}

.content-card {
    background: var(--afya-card);
    border: 1px solid var(--afya-border);
    border-radius: 20px;
    box-shadow: var(--afya-shadow);
}

.appointments-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.appointments-stack > .content-card {
    flex: 1 1 0;
    margin-top: 0;
}

.metric-card {
    background: linear-gradient(135deg, #ffffff 0%, #f3f8ff 100%);
    border: 1px solid var(--afya-border);
    border-radius: 18px;
    box-shadow: var(--afya-shadow);
}

.metric-card .metric-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--afya-primary);
    background: var(--afya-primary-soft);
}

.chart-panel {
    position: relative;
    height: 280px;
    padding: 1rem;
    border-radius: 16px;
    background: #f8fafc;
}

.chart-panel canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.alert-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem;
    border: 1px solid transparent;
    border-radius: 14px;
}

.alert-row-warning {
    border-color: rgba(245, 158, 11, 0.22);
    background: rgba(255, 251, 235, 0.8);
}

.alert-row-danger {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(254, 242, 242, 0.8);
}

.alert-row-success {
    border-color: rgba(20, 184, 166, 0.2);
    background: rgba(240, 253, 250, 0.8);
}

.alert-icon {
    display: inline-flex;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #ffffff;
    color: var(--afya-primary);
}

.form-section-title {
    margin-bottom: 1rem;
    color: var(--afya-primary);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.material-btn-light {
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: #f8fafc;
    color: #475569;
}

.material-btn {
    border: none;
    border-radius: 14px;
    padding: 0.8rem 1.25rem;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 8px 18px rgba(15, 93, 143, 0.15);
}

.material-btn:hover {
    transform: translateY(-1px);
}

.material-btn-primary {
    background: linear-gradient(135deg, var(--afya-primary) 0%, #1d7ac0 100%);
    color: #fff;
}

.material-btn-success {
    background: linear-gradient(135deg, var(--afya-accent) 0%, #1ab39a 100%);
    color: #fff;
}

.app-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 93, 143, 0.12);
    border-radius: 18px;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.04);
}

.login-panel {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(15, 93, 143, 0.12);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

.afya-brand {
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--afya-primary);
}

.login-input {
    border: 1px solid rgba(148, 163, 184, 0.45);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.9);
    padding: 0.8rem 0.9rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-input:focus {
    outline: none;
    border-color: rgba(15, 93, 143, 0.85);
    box-shadow: 0 0 0 3px rgba(15, 93, 143, 0.12);
}

.status-pill {
    border-radius: 999px;
    padding: 0.42rem 0.75rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.status-pill.success {
    background: rgba(20, 184, 166, 0.1);
    color: #0f766e;
}

.status-pill.warning {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.status-pill.danger {
    background: rgba(239, 68, 68, 0.1);
    color: #b91c1c;
}

.table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.8rem;
}

.table-modern th {
    color: var(--afya-muted);
    font-size: 0.76rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.table-modern td {
    background: #f9fbfd;
    border-top: 1px solid rgba(148, 163, 184, 0.28);
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
    padding: 1rem 0.8rem;
}

.table-modern td:first-child {
    border-left: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 14px 0 0 14px;
}

.table-modern td:last-child {
    border-right: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0 14px 14px 0;
}

.table-actions { display: inline-flex; align-items: center; gap: 0.4rem; }
.table-actions form { display: inline-flex; }
.icon-action { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 10px; background: #ffffff; font-size: 0.8rem; text-decoration: none; transition: transform 0.2s ease, background 0.2s ease; }
.icon-action:hover { transform: translateY(-1px); }
.icon-action-view { color: #0f5d8f; border-color: rgba(15, 93, 143, 0.18); }
.icon-action-view:hover { background: #eaf4fb; }
.icon-action-edit { color: #b45309; border-color: rgba(180, 83, 9, 0.18); }
.icon-action-edit:hover { background: #fffbeb; }
.icon-action-delete { color: #b91c1c; border-color: rgba(185, 28, 28, 0.18); }
.icon-action-delete:hover { background: #fef2f2; }

@media (max-width: 767.98px) {
    .adminlte-shell > .d-flex {
        display: block !important;
    }

    .sidebar-panel {
        width: 100% !important;
        min-height: auto !important;
    }

    .sidebar-panel > div:first-child {
        padding: 1.25rem 1.5rem !important;
    }

    .sidebar-panel .nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0.75rem 1rem !important;
    }

    .sidebar-panel .mt-auto {
        margin-top: 0 !important;
        padding: 0 1rem 1rem !important;
    }

    .adminlte-topbar {
        padding: 1rem !important;
    }

    .adminlte-topbar h1 {
        font-size: 1.25rem;
    }

    .adminlte-topbar .text-sm {
        font-size: 0.65rem;
    }

    .adminlte-topbar .px-3 {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .content-card,
    .metric-card {
        border-radius: 14px;
    }

    .table-modern {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
