/* ==========================================================================
   Modern Executive Theme & My Office Portal + Redesigned Dashboard
   Palette: Sapphire Blue, Warm Amber, Emerald Teal, Violet Indigo & Slate
   ========================================================================== */

:root {
    --rb-navy-dark: #0f172a;
    --rb-navy: #1e3a8a;
    --rb-blue: #2563eb;
    --rb-blue-soft: #eff6ff;
    --rb-gold: #f59e0b;
    --rb-gold-bright: #fbbf24;
    --rb-bg: #f1f5f9;
}

body {
    background-color: #f1f5f9 !important;
    font-family: 'Sarabun', sans-serif !important;
    color: #1e293b;
}

/* 1. Top Navbar - Modern Sapphire Gradient */
.navbar {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #2563eb 100%) !important;
    border-bottom: 3px solid #fbbf24 !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.22) !important;
}

.navbar .navbar-brand {
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px;
    padding: 8px 15px !important;
}

.navbar .navbar-brand small {
    background: linear-gradient(135deg, #fde047 0%, #f59e0b 100%);
    color: #0f172a !important;
    font-weight: 800;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 12px;
    margin-left: 6px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

/* Topbar Quick Links */
.rb-top-nav {
    display: flex;
    align-items: center;
    gap: 7px;
    list-style: none;
    margin: 0;
    padding: 10px 10px 0 0;
}

.rb-top-nav > li > a {
    color: #f8fafc !important;
    font-size: 13.5px;
    font-weight: 600;
    padding: 6px 13px !important;
    border-radius: 9px;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
}

.rb-top-nav > li > a:hover,
.rb-top-nav > li > a:focus {
    background: #fbbf24 !important;
    color: #0f172a !important;
    border-color: #fde047;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.rb-top-nav > li > a i.material-icons {
    font-size: 18px;
    color: #fde047;
}

.rb-top-nav > li > a:hover i.material-icons {
    color: #0f172a;
}

/* 2. Left Sidebar */
.sidebar {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
    width: 280px;
    box-shadow: 4px 0 24px rgba(15, 23, 42, 0.04) !important;
}

.sidebar .menu {
    height: calc(100vh - 70px) !important;
    overflow-y: auto !important;
}

/* Profile Card on Sidebar */
.rb-profile-card {
    margin: 12px 12px 10px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 0 12px 12px 12px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.rb-profile-cover {
    height: 62px;
    margin: 0 -12px 0 -12px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #2563eb 100%);
    border-bottom: 3px solid #fbbf24;
    padding-top: 8px;
    color: #fde047;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.rb-profile-avatar {
    width: 145px;
    height: 165px;
    margin-top: -32px;
    object-fit: cover;
    border-radius: 14px;
    border: 3.5px solid #fbbf24;
    outline: 3px solid #ffffff;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.22);
    background: #fff;
}

.rb-profile-name {
    margin-top: 8px;
    font-size: 14.5px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.rb-profile-role {
    display: inline-block;
    margin-top: 4px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 11.5px;
    font-weight: 700;
    padding: 2px 11px;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
}

.rb-profile-actions {
    margin-top: 10px;
    padding-top: 9px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.rb-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 11px;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.2s;
}

.rb-profile-btn.btn-edit {
    background: #f8fafc;
    color: #334155 !important;
    border: 1px solid #cbd5e1;
}

.rb-profile-btn.btn-edit:hover {
    background: #eff6ff;
    color: #1d4ed8 !important;
    border-color: #93c5fd;
}

.rb-profile-btn.btn-logout {
    background: #fff1f2;
    color: #e11d48 !important;
    border: 1px solid #fecdd3;
}

.rb-profile-btn.btn-logout:hover {
    background: #ffe4e6;
}

/* Pending Tasks Box on Sidebar */
.rb-pending-box {
    margin: 0 12px 12px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 11px 12px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.rb-pending-title {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 7px;
    margin-bottom: 7px;
    border-bottom: 1px solid #f1f5f9;
}

.rb-pending-title i.material-icons {
    font-size: 18px;
    color: #f59e0b;
}

.rb-pending-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rb-pending-list li {
    margin-bottom: 5px;
}

.rb-pending-list li:last-child {
    margin-bottom: 0;
}

.rb-pending-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.8px;
    font-weight: 600;
    color: #334155 !important;
    padding: 5px 8px;
    border-radius: 8px;
    background: #f8fafc;
    text-decoration: none !important;
    transition: all 0.15s;
}

.rb-pending-list a:hover {
    background: #eff6ff;
    color: #1d4ed8 !important;
}

.rb-pending-badge {
    background: #e11d48;
    color: #ffffff;
    font-weight: 700;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 999px;
}

.rb-pending-badge.badge-gold {
    background: #f59e0b;
}

.rb-pending-badge.badge-blue {
    background: #2563eb;
}

/* Sidebar Quick Menu List */
.sidebar .menu .list li.header {
    background: #f8fafc !important;
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    padding: 8px 16px !important;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar .menu .list li.active > a {
    color: #1d4ed8 !important;
    background-color: #eff6ff !important;
    border-right: 4px solid #2563eb;
    font-weight: 700 !important;
}

/* ==========================================================================
   3. Portal Launchpad (Duotone Gradient Icon Tiles & Category Cards)
   ========================================================================== */

.rb-office-banner {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #1d4ed8 100%);
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 14px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.rb-office-banner-title {
    font-size: 15.5px;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.rb-office-banner-title i.material-icons {
    color: #fde047;
}

.rb-office-banner-sub {
    font-size: 13px;
    color: #f8fafc;
    font-weight: 600;
    background: rgba(15, 23, 42, 0.28);
    padding: 5px 14px;
    border-radius: 999px;
    border: 1px solid rgba(253, 224, 71, 0.4);
}

/* Main Portal Card Container */
.rb-portal-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 6px 24px rgba(15, 23, 42, 0.05);
    margin-bottom: 24px;
    overflow: hidden;
}

.rb-portal-section-head {
    background: #ffffff;
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.rb-portal-section-head h3 {
    margin: 0;
    font-size: 16.5px;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 9px;
}

.rb-portal-section-head h3 i.material-icons {
    color: #2563eb;
    font-size: 22px;
}

/* Big Icon Tiles Grid */
.rb-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 14px;
    padding: 18px 20px;
    background: #f8fafc;
}

.rb-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 18px 12px 15px 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    text-decoration: none !important;
    transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    min-height: 120px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.rb-tile:hover,
.rb-tile:focus {
    transform: translateY(-5px);
    border-color: #93c5fd;
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.13);
}

.rb-tile-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    transition: transform 0.24s ease;
}

.rb-tile:hover .rb-tile-icon {
    transform: scale(1.1) rotate(-3deg);
}

.rb-tile-icon i.material-icons {
    font-size: 28px;
    color: #ffffff !important;
}

/* Distinct Gradient Icon Themes */
.rb-tile-icon.tone-blue {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.32);
}
.rb-tile-icon.tone-emerald {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.32);
}
.rb-tile-icon.tone-amber {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.32);
}
.rb-tile-icon.tone-purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.32);
}
.rb-tile-icon.tone-cyan {
    background: linear-gradient(135deg, #06b6d4 0%, #0284c7 100%);
    box-shadow: 0 6px 16px rgba(6, 182, 212, 0.32);
}
.rb-tile-icon.tone-rose {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    box-shadow: 0 6px 16px rgba(244, 63, 94, 0.28);
}
.rb-tile-icon.tone-slate {
    background: linear-gradient(135deg, #64748b 0%, #334155 100%);
    box-shadow: 0 6px 16px rgba(100, 116, 139, 0.28);
}
.rb-tile-icon.tone-indigo {
    background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.32);
}

.rb-tile-label {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
}

.rb-tile-sub {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 3px;
}

/* Categorized Uncollapsed Menu Groups */
.rb-category-block {
    padding: 18px 20px;
    border-top: 1px solid #f1f5f9;
}

.rb-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 14px;
    padding: 8px 14px;
    border-radius: 10px;
}

.rb-category-header.cat-blue {
    background: #eff6ff;
    color: #1e40af;
    border-left: 4px solid #2563eb;
}
.rb-category-header.cat-amber {
    background: #fffbeb;
    color: #92400e;
    border-left: 4px solid #f59e0b;
}
.rb-category-header.cat-teal {
    background: #f0fdfa;
    color: #115e59;
    border-left: 4px solid #0d9488;
}
.rb-category-header.cat-indigo {
    background: #eef2ff;
    color: #3730a3;
    border-left: 4px solid #4f46e5;
}

.rb-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
    gap: 10px 14px;
}

.rb-menu-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #1e293b !important;
    font-size: 13.8px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.18s ease;
}

.rb-menu-link:hover,
.rb-menu-link:focus {
    background: #f8fafc;
    border-color: #93c5fd;
    color: #1d4ed8 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.09);
}

.rb-menu-link .rb-link-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #eff6ff;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.cat-amber-links .rb-menu-link .rb-link-icon {
    background: #fef3c7;
    color: #d97706;
}
.cat-teal-links .rb-menu-link .rb-link-icon {
    background: #ccfbf1;
    color: #0d9488;
}
.cat-indigo-links .rb-menu-link .rb-link-icon {
    background: #e0e7ff;
    color: #4f46e5;
}

.rb-menu-link:hover .rb-link-icon {
    background: #2563eb;
    color: #ffffff;
}

.rb-menu-link .rb-link-icon i.material-icons {
    font-size: 19px;
}

/* ==========================================================================
   4. Redesigned Executive Dashboard (KPI Cards & Status Strip)
   ========================================================================== */

.rb-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.rb-kpi-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rb-kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.rb-kpi-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 10px;
}

.rb-kpi-label {
    font-size: 13.5px;
    font-weight: 700;
    color: #64748b;
}

.rb-kpi-value {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin-top: 4px;
}

.rb-kpi-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rb-kpi-icon i.material-icons {
    font-size: 26px;
    color: #ffffff;
}

.rb-kpi-progress {
    height: 7px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 12px;
}

.rb-kpi-progress-bar {
    height: 100%;
    border-radius: 999px;
    transition: width 0.6s ease;
}

.rb-kpi-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
    margin-top: 8px;
    font-weight: 600;
}

/* Status Strip (4 Activity States) */
.rb-status-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.rb-status-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
}

.rb-status-dot {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rb-status-dot i.material-icons {
    font-size: 22px;
}

.rb-status-num {
    font-size: 20px;
    font-weight: 800;
    line-height: 1.1;
    color: #0f172a;
}

.rb-status-text {
    font-size: 12.5px;
    font-weight: 600;
    color: #64748b;
}

/* Global Card & Whole-System Cohesive Theme Enhancements */
.card {
    border-radius: 14px !important;
    border: 1px solid #e2e8f0 !important;
    border-top: 3px solid #2563eb !important;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04) !important;
    background: #ffffff !important;
}

.card .header {
    border-bottom: 1px solid #f1f5f9 !important;
    padding: 16px 20px !important;
}

.card .header h2 {
    color: #0f172a !important;
    font-weight: 800 !important;
    font-size: 16.5px !important;
}

.card .header[class*="bg-"] h2,
.card .header[style*="background"] h2 {
    color: #ffffff !important;
}

.block-header h2 {
    color: #0f172a !important;
    font-weight: 800 !important;
    font-size: 18px !important;
}

/* Tables & DataTables across the system */
.table > thead > tr > th,
table.dataTable thead > tr > th {
    background: linear-gradient(180deg, #f8fafc 0%, #eff6ff 100%) !important;
    color: #1e3a8a !important;
    font-weight: 800 !important;
    border-bottom: 2px solid #93c5fd !important;
    vertical-align: middle !important;
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: #f8fafc !important;
}

.table-hover > tbody > tr:hover {
    background-color: #eff6ff !important;
}

.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover,
.pagination > .active > a:focus,
.pagination > .active > span:focus {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
    border-radius: 6px;
}

/* Buttons & Modals */
.btn:not(.btn-link):not(.btn-circle) {
    border-radius: 8px !important;
    font-weight: 700 !important;
}

.bg-indigo,
.btn-primary,
.bg-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%) !important;
    color: #ffffff !important;
}

.modal-content {
    border-radius: 16px !important;
    border: none !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3) !important;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
    color: #ffffff !important;
    border-bottom: 3px solid #fbbf24 !important;
    padding: 15px 20px !important;
}

.modal-header .modal-title,
.modal-header h4 {
    color: #ffffff !important;
    font-weight: 800 !important;
}

.modal-header .close {
    color: #ffffff !important;
    opacity: 0.9 !important;
    text-shadow: none !important;
}

/* Form Focus Line */
.form-group .form-line:after {
    border-bottom: 2px solid #2563eb !important;
}

/* Fix Bootstrap-Select alignment & searchbox width (e.g. Project selector in add_activity.php) */
.bootstrap-select.btn-group:not(.input-group-btn),
.bootstrap-select.btn-group[class*="col-"],
.bootstrap-select.form-control {
    display: block !important;
    width: 100% !important;
    text-align: left !important;
}

.bootstrap-select > .dropdown-toggle {
    width: 100% !important;
    text-align: left !important;
    padding-left: 10px !important;
    padding-right: 28px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
}

.bootstrap-select.btn-group .dropdown-toggle .filter-option {
    float: none !important;
    display: block !important;
    width: 100% !important;
    text-align: left !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bootstrap-select > select {
    left: 0 !important;
    pointer-events: none !important;
}

.bootstrap-select .dropdown-menu {
    left: 0 !important;
    right: auto !important;
    width: 100% !important;
    min-width: 100% !important;
    text-align: left !important;
}

.bootstrap-select .bs-searchbox {
    padding: 6px 10px !important;
}

.bootstrap-select .bs-searchbox .form-control {
    margin-left: 0 !important;
    padding-left: 32px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
}

.bootstrap-select .bs-searchbox:after {
    left: 16px !important;
    top: 8px !important;
    font-size: 20px !important;
    color: #64748b !important;
}

.bootstrap-select.btn-group .dropdown-menu li,
.bootstrap-select.btn-group .dropdown-menu li a {
    text-align: left !important;
    padding-left: 14px !important;
    padding-right: 34px !important;
    white-space: normal !important;
}

.bootstrap-select.btn-group .dropdown-menu li a span.text {
    display: block !important;
    text-align: left !important;
    margin-left: 0 !important;
    margin-right: 24px !important;
}


