@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --primary: #4368ef;
    --primary-dark: #3155d8;
    --primary-light: #eef2ff;
    --bg: #f5f7fb;
    --white: #ffffff;
    --text: #26344d;
    --muted: #8b98ac;
    --border: #e9edf4;
    --green: #20a46b;
    --orange: #eea143;
    --red: #e45c65;
    --purple: #8a6be8;
    --shadow: 0 5px 20px rgba(36, 53, 88, 0.04);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
}

button, input, select, textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

a {
    color: inherit;
}

/* =========================
   MAIN APP LAYOUT
========================= */

.app-layout {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: 260px;
    min-width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    left: 0;
    background: #fff;
    border-right: 1px solid var(--border);
    padding: 24px 17px 16px;
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.25s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 8px 30px;
}

.brand-icon {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4368ef, #7190ff);
    color: #fff;
    border-radius: 14px;
    font-size: 19px;
    box-shadow: 0 8px 20px rgba(67, 104, 239, 0.22);
}

.brand h2 {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: #25334c;
}

.brand small {
    display: block;
    color: #98a4b7;
    font-size: 10px;
    margin-top: 4px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.menu-label {
    font-size: 10px;
    font-weight: 800;
    color: #a1adbf;
    letter-spacing: 1.3px;
    padding: 0 12px;
    margin: 8px 0 9px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 13px;
    text-decoration: none;
    color: #77849a;
    font-size: 13px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.menu-item i {
    width: 19px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

.menu-item:hover {
    color: var(--primary);
    background: #f5f7ff;
    transform: translateX(2px);
}

.menu-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 700;
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 20px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--border);
    padding: 17px 5px 5px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    background: #eaf0ff;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info strong {
    display: block;
    font-size: 12px;
    color: #35425a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-info small {
    display: block;
    font-size: 10px;
    color: #9ba6b7;
    margin-top: 4px;
}

.logout-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: #9aa5b5;
    border-radius: 9px;
    transition: 0.2s;
}

.logout-btn:hover {
    background: #fff1f2;
    color: var(--red);
}

/* =========================
   MAIN CONTENT
========================= */

.main-content {
    flex: 1;
    min-width: 0;
    width: calc(100% - 260px);
}

.topbar {
    height: 82px;
    min-height: 82px;
    padding: 16px 32px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 13px;
}

.topbar-left h2 {
    font-size: 19px;
    font-weight: 750;
    color: #293750;
    letter-spacing: -0.4px;
}

.topbar-left p {
    font-size: 11px;
    color: #99a5b6;
    margin-top: 5px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.today-date {
    color: #8793a7;
    font-size: 12px;
    white-space: nowrap;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    background: #fff;
    color: #718098;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-btn {
    display: none;
}

/* =========================
   PAGE CONTENT
========================= */

.page-section {
    display: none;
    padding: 28px 32px 35px;
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
}

.page-section.active {
    display: block;
}

/* =========================
   WELCOME BANNER
========================= */

.welcome-banner {
    min-height: 155px;
    padding: 28px 32px;
    border-radius: 17px;
    background: linear-gradient(115deg, #4267ed, #6b88f7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(66, 103, 237, 0.13);
}

.welcome-banner::after {
    content: "";
    position: absolute;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    border: 35px solid rgba(255,255,255,0.07);
    right: 100px;
    top: -120px;
}

.welcome-banner h2 {
    font-size: 23px;
    font-weight: 750;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.welcome-banner p {
    font-size: 12px;
    line-height: 1.7;
    opacity: 0.88;
    position: relative;
    z-index: 1;
}

.welcome-icon {
    font-size: 48px;
    opacity: 0.85;
    padding-right: 22px;
    z-index: 1;
}

/* =========================
   STAT CARDS
========================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 17px;
    margin-top: 23px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 21px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    min-width: 0;
    box-shadow: var(--shadow);
    transition: 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(35, 53, 90, 0.07);
}

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 17px;
}

.stat-icon.blue {
    background: #edf2ff;
    color: #4b6eef;
}

.stat-icon.orange {
    background: #fff4e7;
    color: #e99b3b;
}

.stat-icon.purple {
    background: #f1edff;
    color: #8969e6;
}

.stat-icon.red {
    background: #fff0f1;
    color: #e45d67;
}

.stat-icon.green {
    background: #eaf8f0;
    color: #23a56b;
}

.stat-info {
    min-width: 0;
}

.stat-info span {
    font-size: 11px;
    color: #8693a7;
    font-weight: 600;
}

.stat-info h2 {
    font-size: 28px;
    color: #28364f;
    font-weight: 800;
    margin: 9px 0 4px;
}

.stat-info small {
    font-size: 10px;
    color: #a1acbb;
}

/* =========================
   DASHBOARD GRID
========================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr);
    gap: 20px;
    margin-top: 23px;
    margin-bottom: 22px;
}

.content-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    min-width: 0;
    overflow: hidden;
}

.dashboard-grid .content-card {
    margin-bottom: 0;
}

.card-header {
    padding: 21px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    border-bottom: 1px solid #f0f2f6;
}

.card-header h3 {
    font-size: 14px;
    color: #34415a;
    font-weight: 700;
}

.card-header p {
    font-size: 10px;
    color: #9ba6b7;
    margin-top: 5px;
}

.text-btn {
    border: none;
    background: transparent;
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.text-btn:hover {
    color: var(--primary-dark);
}

/* =========================
   OVERVIEW LIST
========================= */

.overview-list {
    padding: 8px 20px 18px;
}

.overview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 0;
    border-bottom: 1px solid #f1f3f7;
}

.overview-item:last-child {
    border-bottom: none;
}

.overview-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.overview-icon.orange {
    background: #fff4e7;
    color: #e9a041;
}

.overview-icon.blue {
    background: #edf2ff;
    color: #4b6eef;
}

.overview-icon.red {
    background: #fff0f1;
    color: #e45d67;
}

.overview-item div:nth-child(2) {
    flex: 1;
    min-width: 0;
}

.overview-item div:nth-child(2) strong {
    display: block;
    font-size: 11px;
    color: #4b5870;
}

.overview-item small {
    display: block;
    font-size: 10px;
    color: #9ca7b7;
    margin-top: 4px;
}

.overview-item > strong:last-child {
    font-size: 17px;
    color: #2d3b55;
}

/* =========================
   TABLES
========================= */

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

thead {
    background: #fafbfe;
}

th {
    text-align: left;
    padding: 13px 17px;
    color: #8d99ac;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
    border-bottom: 1px solid #edf0f5;
}

td {
    padding: 14px 17px;
    font-size: 11px;
    color: #65738b;
    border-bottom: 1px solid #f0f2f6;
    vertical-align: middle;
    white-space: nowrap;
}

tbody tr {
    transition: background 0.15s;
}

tbody tr:hover {
    background: #fafbff;
}

tbody tr:last-child td {
    border-bottom: none;
}

.document-cell {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 180px;
}

.document-cell > div {
    min-width: 0;
}

.document-cell strong {
    display: block;
    max-width: 240px;
    color: #35425b;
    font-size: 11px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-cell small {
    display: block;
    color: #9ba6b7;
    font-size: 10px;
    margin-top: 4px;
}

.file-icon {
    font-size: 17px;
    color: #8292ad;
    flex-shrink: 0;
}

.file-icon.pdf {
    color: #e45d67;
}

.file-icon.image {
    color: #4c80e9;
}

/* =========================
   BADGES
========================= */

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 9px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 650;
    white-space: nowrap;
}

.badge.success {
    color: #1b9861;
    background: #eaf8f0;
}

.badge.warning {
    color: #c88427;
    background: #fff4e5;
}

.badge.danger {
    color: #d94f59;
    background: #fff0f1;
}

.badge.neutral {
    color: #78859a;
    background: #f0f2f6;
}

.badge.blue-badge {
    color: #4368e8;
    background: #edf2ff;
}

/* =========================
   ACTION BUTTONS
========================= */

.primary-btn,
.secondary-btn {
    min-height: 39px;
    border-radius: 9px;
    padding: 0 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.primary-btn {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
    box-shadow: 0 4px 10px rgba(67, 104, 239, 0.13);
}

.primary-btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
}

.secondary-btn {
    background: white;
    border: 1px solid #e4e9f1;
    color: #697890;
}

.secondary-btn:hover {
    background: #f7f9fc;
    color: var(--primary);
    border-color: #d6def5;
}

/* Generic action buttons generated by JS */
.action-btn,
.table-action,
.btn-icon {
    border: 1px solid #e8edf4;
    background: white;
    color: #78869b;
    padding: 7px 9px;
    border-radius: 7px;
    font-size: 11px;
    transition: 0.2s;
}

.action-btn:hover,
.table-action:hover,
.btn-icon:hover {
    background: #f2f5ff;
    color: var(--primary);
    border-color: #dce4ff;
}

/* =========================
   TOOLBARS / FILTERS
========================= */

.toolbar {
    padding: 20px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 13px;
    flex-wrap: wrap;
    border-bottom: 1px solid #f0f2f6;
}

.toolbar > div:not(.search-box) h3 {
    font-size: 14px;
    color: #34415a;
}

.toolbar > div:not(.search-box) p {
    font-size: 10px;
    color: #9ba6b7;
    margin-top: 5px;
}

.search-box {
    height: 39px;
    min-width: 230px;
    border: 1px solid #e5eaf2;
    background: #fff;
    border-radius: 9px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #a0adbf;
}

.search-box:focus-within {
    border-color: #9db0f8;
    box-shadow: 0 0 0 3px rgba(67, 104, 239, 0.07);
}

.search-box input {
    width: 100%;
    min-width: 0;
    border: none;
    outline: none;
    color: #45536b;
    background: transparent;
    font-size: 11px;
}

.search-box input::placeholder {
    color: #a7b1c0;
}

.toolbar select,
.toolbar > select {
    min-height: 39px;
    border: 1px solid #e5eaf2;
    background: white;
    color: #697890;
    border-radius: 9px;
    padding: 0 12px;
    font-size: 11px;
    outline: none;
}

.toolbar select:focus {
    border-color: #9db0f8;
}

.table-footer {
    padding: 15px 22px;
    border-top: 1px solid #f0f2f6;
    font-size: 10px;
    color: #9ba6b7;
}

/* =========================
   EMPTY STATES
========================= */

.empty-state {
    text-align: center !important;
    padding: 35px 20px !important;
    color: #a0acbd !important;
}

.empty-state i {
    font-size: 24px;
    color: #bdc8dc;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 11px;
    color: #9ca7b7;
    margin-top: 8px;
}

/* =========================
   CALENDAR
========================= */

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 22px;
    border-bottom: 1px solid #edf0f5;
    flex-wrap: wrap;
}

.calendar-toolbar h3 {
    font-size: 16px;
    color: #34415a;
    min-width: 140px;
    text-align: center;
}

.calendar-toolbar button {
    min-width: 38px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0;
    padding: 16px;
}

.calendar-day,
.calendar-cell {
    min-height: 105px;
    padding: 9px;
    border: 1px solid #edf0f5;
    background: #fff;
}

.calendar-day {
    min-height: auto;
    text-align: center;
    background: #fafbfe;
    color: #8d99ac;
    font-size: 10px;
    font-weight: 700;
}

.calendar-cell {
    transition: 0.15s;
}

.calendar-cell:hover {
    background: #f8faff;
}

.calendar-cell.today {
    background: #f1f5ff;
    border-color: #d5e0ff;
}

.calendar-cell.other-month {
    background: #fafbfd;
    color: #c0c8d5;
}

.calendar-date {
    font-size: 11px;
    font-weight: 700;
    color: #53617a;
    margin-bottom: 7px;
}

.calendar-event {
    display: block;
    margin-top: 4px;
    padding: 4px 5px;
    border-radius: 5px;
    font-size: 9px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event.due-soon {
    background: #fff3e3;
    color: #c8842d;
}

.calendar-event.due-normal {
    background: #edf2ff;
    color: #4b6ee9;
}

.calendar-event.expired {
    background: #fff0f1;
    color: #d9535e;
}

.calendar-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 0 20px 23px;
    color: #8794a8;
    font-size: 10px;
    flex-wrap: wrap;
}

.calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.due-soon {
    background: #eca345;
}

.legend-dot.due-normal {
    background: #5274ed;
}

.legend-dot.expired-dot {
    background: #e35b65;
}

/* =========================
   SETTINGS
========================= */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.settings-grid .content-card {
    padding-bottom: 22px;
}

.settings-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: #eaf8f0;
    color: #25a46b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.settings-notice {
    margin: 20px 22px;
    padding: 13px 15px;
    border-radius: 9px;
    background: #f4f7ff;
    border: 1px solid #e7edff;
    color: #7384a3;
    font-size: 11px;
    line-height: 1.7;
    display: flex;
    align-items: flex-start;
    gap: 9px;
}

.settings-notice i {
    color: #6682ed;
    margin-top: 2px;
}

.settings-notice code {
    background: #e9eefb;
    border-radius: 4px;
    padding: 2px 4px;
}

#whatsappTestForm {
    padding: 0 22px;
}

.form-group {
    margin-bottom: 17px;
}

.form-group label {
    display: block;
    color: #43516a;
    font-size: 11px;
    font-weight: 650;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid #e3e8f0;
    background: #fbfcfe;
    color: #35425b;
    border-radius: 9px;
    padding: 12px 13px;
    outline: none;
    font-size: 12px;
    transition: 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    background: #fff;
    border-color: #90a8f8;
    box-shadow: 0 0 0 3px rgba(67, 104, 239, 0.07);
}

.form-group small {
    display: block;
    color: #9ca7b7;
    font-size: 10px;
    margin-top: 6px;
}

#whatsappTestForm .primary-btn {
    width: 100%;
}

/* =========================
   REMINDER SCHEDULE
========================= */

.schedule-list {
    padding: 8px 22px;
}

.schedule-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 0;
    border-bottom: 1px solid #f0f2f6;
}

.schedule-item:last-child {
    border-bottom: none;
}

.schedule-number {
    width: 40px;
    height: 40px;
    background: #edf2ff;
    color: #4569ed;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
}

.schedule-number.today {
    background: #eaf8f0;
    color: #21a46a;
}

.schedule-item strong {
    display: block;
    font-size: 11px;
    color: #46536b;
}

.schedule-item small {
    display: block;
    font-size: 10px;
    color: #9ba6b7;
    margin-top: 4px;
}

/* =========================
   MODALS
========================= */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 28, 49, 0.50);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 17px;
    padding: 25px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.18);
    animation: modalIn 0.2s ease;
}

.modal-large {
    max-width: 720px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    padding-bottom: 20px;
    margin-bottom: 22px;
    border-bottom: 1px solid #edf0f5;
}

.modal-header h2 {
    font-size: 19px;
    color: #293750;
    font-weight: 750;
}

.modal-header p {
    color: #99a4b6;
    font-size: 11px;
    margin-top: 6px;
}

.modal-close {
    width: 35px;
    height: 35px;
    border: none;
    border-radius: 9px;
    background: #f2f4f8;
    color: #78859a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: 0.2s;
}

.modal-close:hover {
    background: #fff0f1;
    color: #df5661;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.form-grid .form-group {
    min-width: 0;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

.required {
    color: #e25b65;
}

.file-info {
    margin-top: 8px;
    color: #4d70e9;
    font-size: 11px;
    word-break: break-word;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 19px;
    margin-top: 22px;
    border-top: 1px solid #edf0f5;
}

/* =========================
   DOCUMENT DETAILS
========================= */

#documentDetailsContent {
    color: #52617a;
    font-size: 12px;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.detail-item {
    padding: 14px;
    border: 1px solid #edf0f5;
    background: #fafbfe;
    border-radius: 10px;
    min-width: 0;
}

.detail-item label {
    display: block;
    font-size: 10px;
    color: #9ba6b7;
    margin-bottom: 7px;
}

.detail-item strong {
    display: block;
    color: #36435c;
    font-size: 12px;
    word-break: break-word;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.details-actions {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    margin-top: 20px;
}

/* =========================
   TOAST NOTIFICATIONS
========================= */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 260px;
    max-width: 380px;
    padding: 14px 17px;
    background: #fff;
    border: 1px solid #edf0f5;
    border-radius: 11px;
    box-shadow: 0 10px 35px rgba(31, 48, 83, 0.12);
    font-size: 12px;
    color: #48566f;
    animation: toastIn 0.25s ease;
    transition: 0.3s;
}

.toast.success i {
    color: #20a46b;
}

.toast.error i {
    color: #e25a64;
}

.toast.info i {
    color: #4d70e9;
}

.toast.hide {
    opacity: 0;
    transform: translateX(20px);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* =========================
   GENERAL REMINDERS (ADDED FIX)
========================= */

#generalRemindersSection {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

/* Toolbar */
.general-reminder-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background: #fff;
    padding: 20px;
    border-radius: 14px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.general-reminder-toolbar h2 {
    margin: 0 0 5px 0;
    font-size: 19px;
    font-weight: 750;
    color: #293750;
}

.general-reminder-toolbar p {
    margin: 0;
    color: #99a5b6;
    font-size: 11px;
}

/* Stats */
.general-reminder-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 15px;
}

.gr-stat {
    background: #fff;
    padding: 15px;
    border-radius: 14px;
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: var(--shadow);
}

.gr-stat small {
    display: block;
    color: #8693a7;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 5px;
}

.gr-stat strong {
    font-size: 22px;
    color: #28364f;
    font-weight: 800;
}

/* Filters */
.general-reminder-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 20px;
    background: #fafbfe;
    border-bottom: 1px solid var(--border);
}

.general-reminder-filters input,
.general-reminder-filters select {
    padding: 10px 14px;
    border: 1px solid #e5eaf2;
    border-radius: 9px;
    font-size: 11px;
    color: #45536b;
    background: #fff;
    outline: none;
    flex: 1;
    min-width: 180px;
}

.general-reminder-filters input:focus,
.general-reminder-filters select:focus {
    border-color: #9db0f8;
    box-shadow: 0 0 0 3px rgba(67, 104, 239, 0.07);
}

/* List & Items */
.general-reminder-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
}

.gr-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: box-shadow 0.2s;
}

.gr-item:hover {
    box-shadow: 0 4px 15px rgba(36, 53, 88, 0.06);
}

.gr-item-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gr-title-line {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.gr-title-line strong {
    font-size: 14px;
    color: #293750;
}

.gr-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gr-pending { background: #fff4e5; color: #c88427; }
.gr-due { background: #fff0f1; color: #d94f59; }
.gr-completed { background: #eaf8f0; color: #1b9861; }
.gr-cancelled { background: #f0f2f6; color: #78859a; }

.gr-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 11px;
    color: #8693a7;
}

.gr-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.gr-desc {
    margin: 0;
    font-size: 11px;
    color: #65738b;
    line-height: 1.5;
}

.gr-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.gr-actions button {
    padding: 8px 12px;
    font-size: 11px;
}

.btn-primary, .btn-secondary {
    padding: 10px 18px;
    border-radius: 9px;
    border: none;
    font-weight: 650;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: 1px solid var(--primary);
    box-shadow: 0 4px 10px rgba(67, 104, 239, 0.13);
}

.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }

.btn-secondary {
    background: #fff;
    color: #697890;
    border: 1px solid #e4e9f1;
}

.btn-secondary:hover { background: #f7f9fc; color: var(--primary); border-color: #d6def5; }

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1250px) {
    .page-section {
        padding: 25px;
    }

    .sidebar {
        width: 240px;
        min-width: 240px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        width: calc(100% - 240px);
    }
}

@media (max-width: 900px) {
    .sidebar {
        width: 225px;
        min-width: 225px;
        padding-left: 12px;
        padding-right: 12px;
    }

    .main-content {
        width: calc(100% - 225px);
    }

    .topbar {
        padding: 15px 20px;
    }

    .page-section {
        padding: 20px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .welcome-banner {
        padding: 25px;
    }

    .welcome-banner h2 {
        font-size: 20px;
    }
}

@media (max-width: 680px) {
    .app-layout {
        display: block;
    }

    .sidebar {
        position: fixed;
        width: 270px;
        min-width: 270px;
        height: 100vh;
        transform: translateX(-100%);
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 15px 0 40px rgba(30, 45, 75, 0.12);
    }

    .main-content {
        width: 100%;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .topbar {
        height: auto;
        min-height: 72px;
        padding: 13px 15px;
        gap: 10px;
    }

    .topbar-left {
        gap: 10px;
    }

    .topbar-left h2 {
        font-size: 16px;
    }

    .topbar-left p {
        font-size: 10px;
    }

    .topbar-actions {
        gap: 8px;
    }

    .today-date {
        display: none;
    }

    .topbar-actions .primary-btn {
        padding: 0 11px;
        font-size: 10px;
        min-height: 36px;
    }

    .page-section {
        padding: 15px;
    }

    .welcome-banner {
        min-height: 135px;
        padding: 22px;
        border-radius: 14px;
    }

    .welcome-banner h2 {
        font-size: 18px;
    }

    .welcome-banner p {
        font-size: 11px;
    }

    .welcome-icon {
        font-size: 34px;
        padding: 0;
    }

    .stats-grid {
        gap: 12px;
    }

    .stat-card {
        padding: 15px;
        gap: 10px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
        border-radius: 10px;
    }

    .stat-info span {
        font-size: 10px;
    }

    .stat-info h2 {
        font-size: 23px;
        margin-top: 7px;
    }

    .stat-info small {
        font-size: 9px;
    }

    .dashboard-grid {
        gap: 15px;
        margin-top: 15px;
    }

    .card-header {
        padding: 17px;
    }

    .toolbar {
        padding: 16px;
        align-items: stretch;
    }

    .toolbar > * {
        max-width: 100%;
    }

    .search-box {
        min-width: 100%;
    }

    .toolbar select {
        flex: 1;
        min-width: 0;
    }

    .calendar-grid {
        padding: 8px;
    }

    .calendar-day,
    .calendar-cell {
        padding: 5px;
        min-height: 75px;
    }

    .calendar-date {
        font-size: 10px;
    }

    .calendar-event {
        font-size: 8px;
        padding: 3px;
    }

    .calendar-toolbar {
        padding: 16px 10px;
        gap: 8px;
    }

    .calendar-toolbar h3 {
        font-size: 14px;
        min-width: 120px;
    }

    .calendar-legend {
        gap: 10px;
        font-size: 9px;
    }

    .modal-overlay {
        padding: 10px;
    }

    .modal {
        padding: 19px;
        border-radius: 14px;
        max-height: 95vh;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .form-grid .full-width {
        grid-column: auto;
    }

    .modal-footer {
        gap: 8px;
    }

    .modal-footer button {
        flex: 1;
    }

    .details-grid {
        grid-template-columns: 1fr;
    }

    .detail-item.full-width {
        grid-column: auto;
    }

    .toast-container {
        top: 12px;
        right: 12px;
        left: 12px;
    }

    .toast {
        min-width: 0;
        max-width: none;
        width: 100%;
    }

    /* General Reminders Mobile Responsive */
    .general-reminder-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .general-reminder-toolbar .btn-primary {
        width: 100%;
    }

    .general-reminder-filters {
        flex-direction: column;
    }

    .general-reminder-filters input,
    .general-reminder-filters select {
        width: 100%;
        min-width: 100%;
    }

    .gr-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .gr-actions {
        width: 100%;
        margin-top: 10px;
        justify-content: flex-start;
    }

    .gr-actions button {
        flex: 1;
    }
}

@media (max-width: 400px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .welcome-icon {
        display: none;
    }

    .topbar-left p {
        display: none;
    }

    .topbar-left h2 {
        font-size: 15px;
    }

    .calendar-grid {
        padding: 4px;
    }

    .calendar-cell,
    .calendar-day {
        min-height: 60px;
        padding: 3px;
    }
    
    .general-reminder-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gr-actions {
        flex-direction: column;
    }
    
    .gr-actions button {
        width: 100%;
    }
}

/* Extra Safety Fix */
#generalRemindersSection {
    display: none !important;
}
#generalRemindersSection.active {
    display: flex !important;
    flex-direction: column;
    gap: 20px;
}