/* ============================================================
   Dstny / CCC — skin-destiny (AdminLTE-style layout)
   Header: 40px white fixed top bar
   Sidebar: 210px fixed, teal gradient #00727a → #00a5b5
   Content: #ecf0f5 background, margin-left 210px, padding-top 40px
   Login: #d2d6de background, centered 360px card
   ============================================================ */

/* ----- Fonts ----- */
@font-face { font-family: 'Inter'; src: url('/layout/fonts/Inter-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/layout/fonts/Inter-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/layout/fonts/Inter-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/layout/fonts/Inter-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #333;
    overflow-x: hidden;
}

a { color: #008c99; text-decoration: none; }
a:hover { color: #005d66; text-decoration: underline; }

/* ============================================================
   WRAPPER
   ============================================================ */
.wrapper {
    position: relative;
    min-height: 100vh;
}

/* ============================================================
   FIXED TOP HEADER  (height: 40px)
   ============================================================ */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    z-index: 1030;
    display: flex;
    align-items: stretch;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Logo zone — same width as sidebar */
.main-header .logo {
    width: 210px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #00727a;
    border-right: 1px solid rgba(0,0,0,0.15);
    overflow: hidden;
    transition: background 0.2s;
    text-decoration: none;
}
.main-header .logo:hover { background: #53a0a6; }
.main-header .logo .logo-mini { display: none; align-items: center; justify-content: center; }
.main-header .logo .logo-mini img { height: 24px; width: auto; }
.main-header .logo .logo-lg { display: flex; align-items: center; }
.main-header .logo .logo-lg img { height: 26px; width: auto; }

/* Right-side navbar */
.main-header .navbar {
    flex: 1;
    display: flex;
    align-items: center;
    background: #fff;
    padding: 0;
    min-height: 40px;
    border: none;
}

/* Hamburger toggle */
.main-header .sidebar-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
    border-right: 1px solid #f0f0f0;
}
.main-header .sidebar-toggle:hover { background: #f5f5f5; }
.main-header .sidebar-toggle .icon-bar {
    display: block;
    width: 18px;
    height: 2px;
    background: #777;
    border-radius: 1px;
}
.main-header .sidebar-toggle:hover .icon-bar { background: #333; }

/* App title */
.main-header .navbar-app-title {
    flex: 1;
    padding-left: 14px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

/* Right-side nav items */
.main-header .navbar-custom-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-right: 16px;
}
.main-header .navbar-custom-menu a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    height: 30px;
    color: #555;
    font-size: 13px;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
}
.main-header .navbar-custom-menu a:hover { background: #f0f0f0; color: #008c99; text-decoration: none; }

/* ============================================================
   FIXED LEFT SIDEBAR  (210px, teal gradient)
   ============================================================ */
.main-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 210px;
    height: 100vh;
    z-index: 841;
    background: linear-gradient(180deg, #00727a 60%, #00a5b5 100%);
    padding-top: 40px;
    overflow: hidden;
    transition: width 0.3s ease;
}

.main-sidebar .sidebar {
    height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 20px;
}

.main-sidebar .sidebar::-webkit-scrollbar { width: 3px; }
.main-sidebar .sidebar::-webkit-scrollbar-track { background: transparent; }
.main-sidebar .sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 2px; }

/* ----- Sidebar menu ----- */
.sidebar-menu {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}

/* Section header divider */
.sidebar-menu > li.header {
    padding: 8px 16px 5px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.5);
    background: #005d66;
    overflow: hidden;
    white-space: nowrap;
}

/* Top-level links */
.sidebar-menu > li > a {
    display: flex;
    align-items: center;
    height: 40px;
    padding: 0;
    color: #fff;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}
.sidebar-menu > li > a:hover,
.sidebar-menu > li.active > a {
    background: rgba(0,0,0,0.12);
    border-left-color: rgba(255,255,255,0.4);
    color: #fff;
    text-decoration: none;
}
.sidebar-menu > li.active > a { border-left-color: #fff; font-weight: 500; }

.sidebar-menu > li > a > .menu-icon {
    width: 50px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
    opacity: 0.85;
}
.sidebar-menu > li > a > .menu-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.sidebar-menu > li > a > .fa-angle-left {
    margin-right: 8px;
    font-size: 13px;
    opacity: 0.6;
    transition: transform 0.2s;
    flex-shrink: 0;
}
.sidebar-menu > li.active > a > .fa-angle-left { transform: rotate(-90deg); }

/* ----- Treeview submenu ----- */
.sidebar-menu .treeview-menu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 4px 0;
    background: #00727a;
}
.sidebar-menu li.active > .treeview-menu { display: block; }

.sidebar-menu .treeview-menu > li > a {
    display: flex;
    align-items: center;
    padding: 8px 10px 8px 50px;
    color: rgba(255,255,255,0.82);
    font-size: 13px;
    text-decoration: none;
    transition: color 0.1s, background 0.1s;
}
.sidebar-menu .treeview-menu > li > a::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    margin-right: 8px;
    flex-shrink: 0;
}
.sidebar-menu .treeview-menu > li > a:hover,
.sidebar-menu .treeview-menu > li.active > a {
    color: #fff;
    background: rgba(0,0,0,0.1);
    text-decoration: none;
}
.sidebar-menu .treeview-menu > li.active > a::before { background: #fff; }

/* ============================================================
   CONTENT WRAPPER
   ============================================================ */
.content-wrapper {
    margin-left: 210px;
    padding-top: 40px;
    min-height: 100vh;
    background: #ecf0f5;
    transition: margin-left 0.3s ease;
}

#content {
    padding: 20px;
}

#main {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.07);
    padding: 20px;
}

#main h1 {
    color: #008c99;
    font-size: 17px;
    font-weight: 600;
    margin: 0 0 6px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0ecee;
}
#main h2 {
    color: #008c99;
    font-size: 14px;
    font-weight: 600;
    clear: left;
    margin-top: 16px;
}

/* ============================================================
   MAIN FOOTER
   ============================================================ */
.main-footer {
    margin-left: 210px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 10px 20px;
    font-size: 12px;
    color: #aaa;
    transition: margin-left 0.3s ease;
}
.main-footer p { margin: 2px 0; }
.main-footer abbr { border-bottom: 1px dotted #bbb; cursor: help; }

/* legacy IDs — kept as hidden no-ops */
#top_bar, #content_footer, #footer { display: none; }

/* login page: #content is just a structural wrapper, strip its padding */
body.login-page #content {
    padding: 0;
    background: transparent;
}

/* ============================================================
   ADMIN LOGIN PAGE  (shares footer_admin.inc.php with sidebar layout)
   ============================================================ */
body.admin-login-page {
    background: #d2d6de;
}
body.admin-login-page .main-header,
body.admin-login-page .main-sidebar { display: none; }

body.admin-login-page .wrapper {
    background: #d2d6de;
}
body.admin-login-page .content-wrapper {
    margin-left: 0;
    padding-top: 0;
    background: #d2d6de;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}
body.admin-login-page .login-logo {
    margin-top: 7%;
    margin-bottom: 20px;
}
body.admin-login-page .login-box {
    width: 360px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 28px;
}
body.admin-login-page .main-footer {
    margin-left: 0;
    background: transparent;
    border-top: none;
    color: #999;
    text-align: center;
}

/* ============================================================
   SIDEBAR COLLAPSED  (body.sidebar-collapse)
   ============================================================ */
body.sidebar-collapse .main-sidebar { width: 50px; }
body.sidebar-collapse .content-wrapper,
body.sidebar-collapse .main-footer { margin-left: 50px; }
body.sidebar-collapse .main-header .logo { width: 50px; }
body.sidebar-collapse .main-header .logo .logo-mini { display: flex; }
body.sidebar-collapse .main-header .logo .logo-lg { display: none; }

body.sidebar-collapse .sidebar-menu > li > a > .menu-label,
body.sidebar-collapse .sidebar-menu > li > a > .fa-angle-left,
body.sidebar-collapse .sidebar-menu > li.header { display: none; }

body.sidebar-collapse .sidebar-menu > li { position: relative; }

body.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu {
    display: block;
    position: absolute;
    left: 50px;
    top: 0;
    min-width: 180px;
    background: #00727a;
    box-shadow: 3px 3px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    border-left: 2px solid rgba(255,255,255,0.2);
}

/* ============================================================
   LOGIN PAGE  (AdminLTE skin-destiny login)
   ============================================================ */
body.login-page {
    background: #d2d6de;
}

.login-box {
    width: 360px;
    margin: 7% auto 0;
}

@media (max-width: 480px) {
    .login-box { width: 90%; margin-top: 20px; }
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}
.login-logo a { display: inline-block; text-decoration: none; }
.login-logo img { height: 42px; width: auto; }

.login-box-body {
    background: #fff;
    padding: 28px 28px 24px;
    border-radius: 4px;
    color: #666;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-box-msg {
    margin: 0 0 20px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

/* login form table override */
#main_login table { width: 100%; border-collapse: collapse; }
#main_login table td { padding: 5px 0; vertical-align: top; }
#main_login table td:first-child {
    padding-right: 10px;
    color: #555;
    font-weight: 500;
    white-space: nowrap;
    padding-top: 9px;
    font-size: 13px;
}

#main_login input[type="text"],
#main_login input[type="password"],
#main_login input[type="email"] {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
    background: #fff;
    transition: border-color 0.15s;
}
#main_login input[type="text"]:focus,
#main_login input[type="password"]:focus {
    border-color: #008c99;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.06), 0 0 0 2px rgba(0,140,153,0.12);
}

#main_login button,
#main_login input[type="submit"] {
    width: 100%;
    padding: 8px 18px;
    background: #008c99;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 6px;
}
#main_login button:hover { background: #005d66; }

.login-page-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 12px;
    color: #999;
    padding-bottom: 20px;
}

/* ============================================================
   TABLES & DATAGRIDS
   ============================================================ */
table { width: 100%; border-collapse: collapse; }

.datagrid { border-collapse: collapse; width: 100%; }
.datagrid th {
    background: #008c99;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    padding: 9px 12px;
    text-align: left;
    white-space: nowrap;
}
.datagrid th a { color: #dff5f7; text-decoration: none; }
.datagrid th a:hover { text-decoration: underline; }
.datagrid td { border-bottom: 1px solid #eee; padding: 8px 12px; font-size: 13px; }
.datagrid tr:hover td { background: #f5fbfc; }
.datagrid caption { padding: 5px 0; overflow: hidden; position: relative; }
.datagrid .paginator-control { float: right; }
.datagrid .paginator-results { float: left; }
.paginator .arrow { color: #aaa; font-style: italic; }
.paginator .arrow a { font-style: normal; color: #008c99; }
.paginator .break { color: #ddd; padding: 4px; }
.paginator .page { color: #888; display: inline-block; padding: 0 5px; }
.paginator .selected { background: #008c99; border-radius: 3px; color: #fff; display: inline-block; padding: 1px 7px; }

.datagrid th.sortable div { display: flex; align-items: center; gap: 4px; }

/* ============================================================
   FORMS
   ============================================================ */
.renderWithName { padding: 5px 0; position: relative; }
.renderWithName .form-name { overflow: hidden; }

.form-field input[type=text],
.form-field input[type=password],
.form-field textarea {
    max-width: 340px;
    width: 99%;
    padding: 6px 9px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.15s;
}
.form-field input:focus, .form-field textarea:focus {
    border-color: #008c99;
    box-shadow: 0 0 0 2px rgba(0,140,153,0.1);
}

.form-actions {
    background: #f4f4f4;
    border-radius: 4px;
    padding: 10px 14px;
    margin: 12px auto;
    border: 1px solid #e0e0e0;
}
.form-save, .form-cancel, .form-delete { display: inline; }
.form-name { padding-right: 10px; font-weight: 500; color: #555; }
.form-delete { padding-left: 20px; }

button, input[type="submit"] {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    background: #008c99;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s;
}
button:hover, input[type="submit"]:hover { background: #005d66; }
button[disabled] { background: #aacdd0; color: #fff; cursor: not-allowed; }
button[disabled]:hover { background: #aacdd0; }
.form-delete button { background: transparent; color: #c0392b; border: 1px solid #e0b0aa; font-weight: 600; padding: 5px 10px; }
.form-delete button:hover { background: #fdf0ef; }

input.textbox {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    width: 220px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 8px;
}
select.listbox {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    width: 228px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 6px;
}

div#formControls { padding-left: 0 !important; }
div#formActions { background: #fff; }

/* ============================================================
   STATUS / ALERTS
   ============================================================ */
.warning, .error { color: #c0392b; }
.success { color: #27ae60; }

/* ============================================================
   CUSTOMER NAV TABS
   ============================================================ */
div#customernav ul {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    border-bottom: 2px solid #dde8ea;
}
div#customernav ul li a {
    display: block;
    padding: 6px 14px;
    color: #555;
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
    border-radius: 4px 4px 0 0;
    border: 1px solid transparent;
    position: relative;
    bottom: -2px;
}
div#customernav ul li a:hover { background: #f0f8f9; color: #008c99; text-decoration: none; }
div#customernav ul li.active a {
    background: #fff;
    color: #008c99;
    border-color: #dde8ea;
    border-bottom-color: #fff;
}

/* ============================================================
   MONITORING TABLE
   ============================================================ */
TABLE.moniavail { font-family: 'Inter', sans-serif; font-size: 13px; background: #fff; width: 60%; margin: 0 auto; }
TH.moniavail { background: #008c99; color: #fff; text-align: left; padding: 7px 10px; }
.moniavailODD { background: #f7fafb; }
.moniavailEVEN { background: #eef5f6; }
.moniavailOK { background: #27ae60; color: #fff; font-weight: bold; padding: 3px 6px; }
.moniavailWARNING { background: #f39c12; color: #fff; font-weight: bold; padding: 3px 6px; }
.moniavailUNKNOWN { background: #e67e22; color: #fff; font-weight: bold; padding: 3px 6px; }
.moniavailCRITICAL { background: #c0392b; color: #fff; font-weight: bold; padding: 3px 6px; }

/* ============================================================
   LOOKING GLASS
   ============================================================ */
option.box1 { background: #e8f8e8; }
option.box2 { background: #e8e8f8; }
option.box3 { background: #f8e8e8; }

/* ============================================================
   UTILITY / QCUBED
   ============================================================ */
.qc-table { display: table; }
.qc-tableRow { display: table-row; }
.qc-tableCell { display: table-cell; }
.clickable-rows tr td, .clickable-rows th { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; cursor: default; }
.clickable-rows tr:hover { background: #f5fbfc; }
.link-list li { margin-top: 7px; }
.calendar { position: relative !important; z-index: 5 !important; top: -5px !important; left: 250px !important; }
.qDbProfile { background: #fff; padding: 8px; z-index: 5000; border: 1px solid #ccc; border-radius: 4px; font-size: 12px; }
.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: none !important; text-align: right; }
.ui-button-left { float: left; }
.ui-dialog-title { float: none !important; width: auto !important; }
.ui-dialog-titlebar .ui-icon { display: inline-block; margin-right: .3em; vertical-align: middle; }
