/* ==========================================================================
   DinsorWorks / DinsorConnect Backoffice Official Design System
   Pixel-perfect match for: dinsorconnect.com/backoffice
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Thai:wght@100;200;300;400;500;600;700&family=IBM+Plex+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@200;300;400;500;600;700&display=swap');

:root {
    --theme-font: 'IBM Plex Sans Thai', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --theme-color: #ff6600;
    --brand-orange: #ff6600;
    --brand-cyan: #22a7f0;
    --brand-green: #10c469;
    --brand-yellow: #f9c851;
    --brand-red: #ff5b5b;
    --brand-dark: #333333;
    --brand-muted: #6c757d;
    --brand-border: #eaedf1;
    --brand-bg: #f8f9fa;
}

html, body,
h1, h2, h3, h4, h5, h6, p, span, a, input, select, button {
    font-family: var(--theme-font), sans-serif !important;
}

html, body {
    font-weight: 300;
    font-size: 15px;
    background-color: var(--brand-bg) !important;
    color: var(--brand-muted);
}

/* ==========================================
   LEFT STRIP LINE (Official Signature)
   ========================================== */
body::before {
    content: '';
    border-left: 7px solid var(--theme-color);
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    z-index: 99999;
}

body.login-page::before,
body.maintenance-page::before {
    display: none;
}

/* Utilities */
.center-align { text-align: center !important; }
.left-align { text-align: left !important; }
.right-align { text-align: right !important; }
.theme-text-color { color: var(--theme-color) !important; }
.text-nowrap { text-wrap: nowrap; }

/* ==========================================
   Topbar (Navbar Custom)
   ========================================== */
.navbar-custom {
    background-color: #ffffff !important;
    box-shadow: none !important;
    min-height: 70px !important;
    height: 70px !important;
    border-bottom: 1px solid var(--brand-border) !important;
    padding: 0 !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
}

.navbar-custom .page-title-main {
    font-size: 1.2rem;
    margin: 0;
    line-height: 70px !important;
    color: #333333 !important;
    font-weight: 600 !important;
    display: inline-block;
    padding-left: 20px;
}

.navbar-custom .topnav-menu .nav-link {
    color: var(--brand-muted) !important;
    height: 70px !important;
    line-height: 70px !important;
    padding: 0 14px;
}

.navbar-custom .topnav-menu .nav-link:hover {
    color: var(--brand-orange) !important;
}

.nav-user img {
    height: 32px;
    width: 32px;
}

/* ==========================================
   LOGO BOX & APP LOGOS
   ========================================== */
.logo-box {
    background-color: #ffffff !important;
    width: 240px !important;
    height: 70px !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 20px !important;
    border-bottom: 1px solid var(--brand-border) !important;
    float: left;
    box-sizing: border-box;
}

.logo-box .logo {
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    line-height: normal !important;
}

.logo-box .logo-lg {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
}

.logo-box .logo-dinsorworks {
    height: 13px !important;
    width: auto !important;
    display: block !important;
    margin-bottom: 3px !important;
    object-fit: contain;
}

.logo-box .logo-brand {
    height: 22px !important;
    width: auto !important;
    display: block !important;
    margin-left: 0 !important;
    object-fit: contain;
}

/* ==========================================
   Left Sidebar Menu
   ========================================== */
.left-side-menu {
    width: 240px !important;
    background: #ffffff !important;
    box-shadow: none !important;
    border-right: 1px solid var(--brand-border) !important;
    top: 70px !important;
    bottom: 0;
    position: fixed;
    z-index: 1000;
}

#sidebar-menu .menu-title {
    padding: 18px 20px 8px 20px;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
    text-transform: uppercase;
    color: #a0aec0;
    font-weight: 700;
}

#sidebar-menu > ul > li {
    position: relative;
}

#sidebar-menu > ul > li > a {
    color: #4a5568 !important;
    font-size: 0.92rem;
    font-weight: 400;
    padding: 11px 36px 11px 20px !important;
    display: block;
    position: relative;
    white-space: nowrap !important;
    transition: color 0.15s ease;
    background-color: transparent !important;
}

#sidebar-menu > ul > li > a i.menu-icon,
#sidebar-menu > ul > li > a > i {
    font-size: 1.15rem;
    margin-right: 10px;
    vertical-align: middle;
    color: var(--brand-orange) !important;
}

#sidebar-menu > ul > li > a > span:not(.menu-arrow) {
    vertical-align: middle;
    white-space: nowrap !important;
}

#sidebar-menu > ul > li > a span.menu-arrow {
    position: absolute !important;
    right: 18px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: inline-block !important;
    font-family: "Material Design Icons" !important;
    font-size: 1.15rem !important;
    line-height: 1 !important;
    color: #a0aec0 !important;
    transition: transform 0.2s ease, color 0.15s ease !important;
    pointer-events: none;
}

#sidebar-menu > ul > li > a span.menu-arrow:before {
    content: "\f0142" !important; /* mdi-chevron-right */
}

#sidebar-menu > ul > li > a[aria-expanded="true"] span.menu-arrow,
#sidebar-menu > ul > li.menuitem-active > a:not(.collapsed) span.menu-arrow {
    transform: translateY(-50%) rotate(90deg) !important;
    color: var(--brand-orange) !important;
}

#sidebar-menu > ul > li > a:hover,
#sidebar-menu > ul > li > a:focus,
#sidebar-menu .menuitem-active > a,
#sidebar-menu .menuitem-active .active,
.nav-second-level li a:focus,
.nav-second-level li a:hover {
    color: var(--brand-orange) !important;
}

#sidebar-menu .menuitem-active > a {
    font-weight: 600;
}

#sidebar-menu .nav-second-level {
    padding-left: 0;
    list-style: none;
    background-color: #ffffff;
}

#sidebar-menu .nav-second-level li a {
    padding: 7px 20px 7px 46px !important;
    color: #718096;
    font-size: 0.88rem;
    display: block;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    transition: color 0.15s ease;
}

#sidebar-menu .nav-second-level li a.active {
    color: var(--brand-orange) !important;
    font-weight: 600 !important;
}

/* Sidebar Footer */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    font-size: 0.75rem;
    color: #a0aec0;
    border-top: 1px solid var(--brand-border);
    background-color: #ffffff;
}

.sidebar-footer .justify-content-space-between {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}

/* ==========================================
   Content Page & Cards
   ========================================== */
.content-page {
    margin-left: 240px;
    margin-top: 70px;
    padding-top: 0px !important;
    padding-left: 0px !important;
    padding-right: 15px !important;
    padding-bottom: 60px !important;
    background-color: var(--brand-bg) !important;
    min-height: calc(100vh - 70px);
}

.content-page .content {
    padding-top: 18px !important;
    padding-left: 15px !important;
    padding-right: 0px !important;
}

.content-page .container-fluid {
    padding-left: 0px !important;
    padding-right: 0px !important;
}

.card {
    background-color: #ffffff;
    border: 1px solid var(--brand-border);
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    margin-bottom: 18px !important;
}

.card-body {
    padding: 1.25rem 1.5rem !important;
}

.header-title {
    font-size: 1.12rem;
    margin: 0 0 6px 0;
    font-weight: 600;
    color: var(--brand-dark);
}

/* Button & Action */
.btn-info {
    background-color: #23b7e5 !important;
    border-color: #23b7e5 !important;
    color: #ffffff !important;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 7px 16px;
    border-radius: 4px;
}

.btn-info .btn-label {
    margin-right: 6px;
}

/* Table */
.table {
    color: #4a5568;
    vertical-align: middle;
}

.table-hover > tbody > tr:hover {
    background-color: #fcfdfe;
}

.table thead.table-light th {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
    font-size: 0.9rem;
    border-top: 1px solid var(--brand-border);
    border-bottom: 2px solid var(--brand-border);
    padding: 12px 16px;
}

.table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f3f5;
    font-size: 0.9rem;
}

/* Badges */
.badge.rounded-pill {
    padding: 4px 12px;
    font-weight: 500;
    font-size: 0.75rem;
    border-radius: 30px !important;
}

.badge.bg-success {
    background-color: #10c469 !important;
    color: #ffffff !important;
}

/* Action Buttons (Pill / Circular) */
.btn-sm.rounded-pill {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
}

.btn-warning {
    background-color: #f9c851 !important;
    border-color: #f9c851 !important;
    color: #ffffff !important;
}

.btn-danger {
    background-color: #ff5b5b !important;
    border-color: #ff5b5b !important;
    color: #ffffff !important;
}

/* Footer */
.footer {
    left: 240px;
    background-color: transparent;
    border-top: 1px solid var(--brand-border);
    padding: 18px 24px;
    color: #a0aec0;
    font-size: 0.825rem;
}
