/* ═══════════════════════════════════════════════════════════════════
   TUSoft (tsf) — theme.css
   Layout shell (header, sidebar drawer, main, footer). Loaded after base.css.
     1. formerly css/layout.php (PHP-generated <style>)
     2. formerly the inline <style> block in views/layouts/main.php
   ═══════════════════════════════════════════════════════════════════ */

/* ───────────────────── 1. formerly css/layout.php ───────────────────── */

body
{
	/* font-family comes from body.tsf-app (system font stack) */
	font-size:14px;
	background-image: linear-gradient(to bottom,#fff,#efefef);
}

.slogan {
	float: right;
	color: #7a9778;
	text-align: right;
	position: relative;
	top: 30px;
	padding-left:20px;
}
.navbar-inner {
	background: teal url(../images/bg-top.jpg) repeat-x;
	min-height:0;
	padding:2px 0;
	border: 0px solid #d4d4d4;
	-webkit-border-radius: 0px;
	-moz-border-radius: 0px;
	border-radius: 0px;
}
.above{
	height:	100px;
	background: teal url(../images/bg-top.jpg) repeat-x;
}
.above .image{
	height:	100px;
	background: url(../images/logo.png) no-repeat left top;
}
#page p{
	text-align:justify;
}
h1 a{
	color:#efefef;
}
#page a,
#page .yiiTab ul.tabs li a
{
	 outline: 0;
}
h1, h2{
	border-bottom: 2px solid teal;
	margin-bottom:10px;
	text-transform:uppercase;
}
h1.no-underline,
h2.no-underline{
	border-bottom: 0;
}
no-background-color{
	background-color:none;
	border:none;
}
.clock {
	float: right;
	width: 100px;
	padding: 10px 1px;
	color: #dee32fd9;
	font-weight:bold;
}
.heading{
	background-color:var(--tsf-navy);
	color:#fff!important;
	text-align:center;
	border:0;
	border-radius:6px;
	margin:7px 0;
	padding:5px 0;
	font-size:150%;
}

/* ───────────────── 2. formerly inline <style> in main.php ───────────────── */

/* ═══════════════════════════════════════════════════════════
   DESIGN TOKENS (kept in the existing navy + green theme)
   ═══════════════════════════════════════════════════════════ */
:root {
    --tsf-navy:            teal;
    --tsf-navy-dark:       #081e3d;
    --tsf-green:           #2e7d32;
    --tsf-green-dark:      #1b5e20;
    --tsf-green-light:     #eef5ef;
    --tsf-bg:              #f4f6f9;
    --tsf-sidebar-bg:      #1a2733;
    --tsf-sidebar-hover:   rgba(46, 125, 50, .18);
    --tsf-drawer-w:        260px;
    --tsf-drawer-rail:     68px;
    --tsf-topbar-h:        58px;
}

/* ═══════════════════════════════════════════════════════════
   BASE
   ═══════════════════════════════════════════════════════════ */
html, body { height: 100%; margin: 0; padding: 0; }
body.tsf-app {
    background: var(--tsf-bg);
    color: #2c3e50;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Helvetica Neue", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    /* Grow with content that cannot shrink (wide tables, fixed-width spans),
       so header and footer stretch to the same width as the main display. */
    min-width: fit-content;
}
#page {
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════════════════════ */
.tsf-topbar {
    top: 0;
    /* Above sidebar/main content, below Bootstrap modals (1040+) */
    z-index: 1030;
    background: #fff;
    border-bottom: 1px solid #e3e6ea;
    min-height: var(--tsf-topbar-h);
    box-shadow: 0 1px 3px rgba(13, 46, 86, .04);
}

.tsf-drawer-toggle {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    color: var(--tsf-navy);
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s ease, color .15s ease;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e3e6ea;
    box-shadow: 0 1px 3px rgba(13, 46, 86, .04);
}
.tsf-drawer-toggle:hover {
    background: rgba(46, 125, 50, .10);
    color: var(--tsf-green);
}

/* Must not clip: navbar drop-downs hang below the header */
.tsf-topbar-inner {
    width: 100%;
    min-width: 0;
    overflow: visible;
}
.tsf-topbar .navbar { margin-bottom: 0; }
.tsf-topbar .dropdown-menu { z-index: 1031; }

/* Toggle as the first item inside the drawer */
.tsf-drawer .tsf-drawer-toggle {
    display: flex;
    margin: 0 0 12px auto;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: none;
    color: #a8b4bf;
}
.tsf-drawer .tsf-drawer-toggle:hover {
    background: var(--tsf-sidebar-hover);
    color: #fff;
}
body.drawer-collapsed .tsf-drawer .tsf-drawer-toggle {
    margin: 0 auto 12px;
}

/* Row at the top of main content: mobile-only drawer opener + logged-in info */
.tsf-main-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}
.tsf-main-toolbar .tsf-logged-info {
    flex: 1 1 auto;
}
.tsf-drawer-toggle-mobile { display: none; }

/* ═══════════════════════════════════════════════════════════
   SHELL — sidebar + main
   ═══════════════════════════════════════════════════════════ */
.tsf-shell {
    display: flex;
    flex: 1 0 auto;
    position: relative;
    min-height: calc(100vh - var(--tsf-topbar-h));
}

/* ═══════════════════════════════════════════════════════════
   DRAWER / SIDEBAR
   ═══════════════════════════════════════════════════════════ */
.tsf-drawer {
    width: var(--tsf-drawer-w);
    flex: 0 0 var(--tsf-drawer-w);
    color: #a8b4bf;
    transition: width .25s ease, flex-basis .25s ease;
    position: sticky;
    top: var(--tsf-topbar-h);
    align-self: flex-start;
    height: calc(100vh - var(--tsf-topbar-h));
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, .04);
    z-index: 900;
	box-shadow: 10px 10px 20px rgba(0.5, 0, 0, 0);
}
.tsf-drawer::-webkit-scrollbar { width: 6px; }
.tsf-drawer::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.15);
    border-radius: 3px;
}

.tsf-drawer-inner {
    padding: 18px 14px;
    min-width: var(--tsf-drawer-w);
    box-sizing: border-box;
	
}

/* Sidebar menu items */
.tsf-drawer .nav,
.tsf-drawer ul { list-style: none; padding: 0; margin: 0; }
.tsf-drawer .nav > li,
.tsf-drawer ul > li { margin: 2px 0; }

.tsf-drawer .nav > li > a,
.tsf-drawer ul > li > a {
    color: #a8b4bf;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: background .15s ease, color .15s ease;
    white-space: nowrap;
    overflow: hidden;
}
.tsf-drawer .nav > li > a i,
.tsf-drawer ul > li > a i {
    color: var(--tsf-green);
    width: 18px;
    text-align: center;
    font-size: 14px;
    flex-shrink: 0;
    transition: color .15s ease;
}
.tsf-drawer .nav > li > a:hover,
.tsf-drawer .nav > li.active > a,
.tsf-drawer ul > li > a:hover,
.tsf-drawer ul > li.active > a {
    background: var(--tsf-sidebar-hover);
    color: #fff;
}
.tsf-drawer .nav > li > a:hover i,
.tsf-drawer .nav > li.active > a i {
    color: #7ed681;
}

/* Sidebar headings */
.tsf-drawer h4,
.tsf-drawer .nav-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #6a8299;
    padding: 18px 14px 8px;
    margin: 0;
    font-weight: 600;
}

/* Nested dropdowns inside drawer — always visible */
.tsf-drawer .dropdown-menu {
    position: static !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 0 0 14px !important;
    margin: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
}
.tsf-drawer .dropdown-menu li > a {
    color: #8fafc4;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    display: block;
    text-decoration: none;
    white-space: normal;
    transition: background .15s ease, color .15s ease;
}
.tsf-drawer .dropdown-menu li > a:hover {
    background: var(--tsf-sidebar-hover);
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════
   COLLAPSED / HIDDEN STATES (desktop)
   ═══════════════════════════════════════════════════════════ */
body.drawer-collapsed .tsf-drawer {
    width: var(--tsf-drawer-rail);
    flex-basis: var(--tsf-drawer-rail);
}
body.drawer-collapsed .tsf-drawer-inner {
    padding: 18px 6px;
    min-width: var(--tsf-drawer-rail);
}
body.drawer-collapsed .tsf-drawer-inner a > span,
body.drawer-collapsed .tsf-drawer-inner h4,
body.drawer-collapsed .tsf-drawer-inner .nav-header {
    display: none;
}
body.drawer-collapsed .tsf-drawer-inner a {
    justify-content: center;
    padding: 10px 0;
}
body.drawer-collapsed .tsf-drawer-inner a i {
    margin: 0;
}
body.drawer-collapsed .tsf-drawer .dropdown-menu {
    display: none !important;
}

body.drawer-hidden .tsf-drawer {
    width: 0;
    flex-basis: 0;
    box-shadow: none;
}
body.drawer-hidden .tsf-drawer-inner { display: none; }

/* ═══════════════════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════════════════ */
.tsf-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 22px;
    box-sizing: border-box;
    background: linear-gradient(to bottom, #f4f6f9 0%, #fff 100%);
}
.tsf-main-inner { max-width: 100%; }

/* Page content: shrinks to the width of what it holds and is centered, so
   short pages no longer hug the left edge. Wide content (text, full-width
   grids) still fills the area. min-width keeps a sensible column for pages
   whose content sizes to its container (charts, empty grids); on phones it
   is simply 100%. flow-root contains floated Bootstrap spans. */
.tsf-content {
    display: flow-root;
    width: fit-content;
    min-width: min(100%, 720px);
    margin: 0 auto;
}

/* Top-level page titles span the whole main area while the content below
   stays centered. main.php measures the gaps (--tsf-gl / --tsf-gr) on each
   heading; matching padding cancels the negative margins so the heading
   never changes the centered column's width, and keeps the text centered
   over the content. */
.tsf-content > h1, .tsf-content > h2,
.tsf-content > div > h1, .tsf-content > div > h2 {
    margin-left: calc(-1 * var(--tsf-gl, 0px));
    margin-right: calc(-1 * var(--tsf-gr, 0px));
    padding-left: var(--tsf-gl, 0px);
    padding-right: var(--tsf-gr, 0px);
}

/* All headings in the main area have centered text */
.tsf-main h1, .tsf-main h2, .tsf-main h3,
.tsf-main h4, .tsf-main h5, .tsf-main h6 {
    text-align: center;
}

/* "You have logged in as ..." — plain centred text, no panel */
.tsf-logged-info {
    margin-bottom: 18px;
    color: #474a4a;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
}
.tsf-logged-info i { color: var(--tsf-green); font-size: 15px; }

/* Readable text in Yii widgets (they shrink cells to 0.9em, the pager to 11px) */
.tsf-content .grid-view table.items th,
.tsf-content .grid-view table.items td,
.tsf-content table.detail-view th,
.tsf-content table.detail-view td,
.tsf-content .list-view .sorter,
.tsf-content .summary,
.tsf-content ul.yiiPager,
.tsf-content ul.yiiPager a {
    font-size: 13px;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   (merges the old #footer rule from responsive.css with .tsf-footer;
   values are the ones that actually won the cascade before)
   ═══════════════════════════════════════════════════════════ */
.tsf-footer {
    color: #869b82;
    background-color: transparent;
    background-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), transparent), url('../images/bg-footer-noise.jpg');
    background-repeat: repeat-x, repeat;
    padding: 0 0 25px 0;
    margin-top: 0;
    font-size: 14px;
    line-height: 1.65;
    text-align: center;
    flex-shrink: 0;
}

.tsf-iso-mark {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed rgba(255,255,255,.1);
    text-align: center;
}
.tsf-iso-mark img {
    max-width: 100%;
    max-height: 64px;
    width: auto;
    height: auto;
    display: inline-block;
}

/* ═══════════════════════════════════════════════════════════
   MOBILE OVERLAY (used only on phones)
   ═══════════════════════════════════════════════════════════ */
.tsf-drawer-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(13, 46, 86, .5);
    z-index: 890;
    opacity: 0;
    transition: opacity .2s ease;
}

/* ═══════════════════════════════════════════════════════════
   COLLAPSED NAVBAR DROPDOWNS — show ALL items
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 979px) {
    .navbar .nav-collapse.collapse.in,
    .navbar .nav-collapse.in {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
    .navbar .nav > li > .dropdown-menu {
        position: static !important;
        float: none !important;
        width: auto !important;
        margin: 4px 0 8px 0 !important;
        padding: 6px !important;
        background: var(--tsf-green-light) !important;
        border: 1px solid #d2e3d4 !important;
        border-radius: 8px !important;
        box-shadow: none !important;
        max-height: none !important;
        overflow: visible !important;
    }
    .navbar .nav > li.open > .dropdown-menu {
        display: block !important;
        max-height: none !important;
        overflow: visible !important;
    }
    .navbar .nav > li > .dropdown-menu > li > a {
        padding: 9px 14px 9px 30px !important;
        color: var(--tsf-green) !important;
        font-weight: 500;
        white-space: normal !important;
        line-height: 1.4;
        border-radius: 6px;
        margin: 2px 0;
        background: #f5faf5;
        border-left: 3px solid #b5d4b8;
        transition: background .15s ease, color .15s ease;
    }
    .navbar .nav > li > .dropdown-menu > li > a:hover,
    .navbar .nav > li > .dropdown-menu > li > a:focus {
        background: var(--tsf-green) !important;
        color: #fff !important;
        border-left-color: var(--tsf-green-dark);
    }
    .navbar .nav > li > .dropdown-menu > li.divider {
        background: #d2e3d4 !important;
        margin: 4px 6px !important;
    }
    .navbar .nav > li > .dropdown-menu::before,
    .navbar .nav > li > .dropdown-menu::after {
        display: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE — sidebar becomes off-canvas drawer
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
    .tsf-drawer {
        position: fixed;
        top: var(--tsf-topbar-h);
        left: 0;
        height: calc(100vh - var(--tsf-topbar-h));
        width: var(--tsf-drawer-w) !important;
        flex-basis: auto !important;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 920;
    }
    .tsf-drawer-inner {
        padding: 18px 14px !important;
        min-width: var(--tsf-drawer-w) !important;
    }
    /* Never collapse or hide on mobile — full drawer only */
    body.drawer-collapsed .tsf-drawer,
    body.drawer-hidden .tsf-drawer {
        width: var(--tsf-drawer-w) !important;
        transform: translateX(-100%);
    }
    body.drawer-collapsed .tsf-drawer-inner,
    body.drawer-hidden .tsf-drawer-inner {
        padding: 18px 14px !important;
        min-width: var(--tsf-drawer-w) !important;
        display: block !important;
    }
    body.drawer-collapsed .tsf-drawer-inner a > span,
    body.drawer-collapsed .tsf-drawer-inner h4 { display: inline; }

    body.drawer-mobile-open .tsf-drawer {
        transform: translateX(0);
    }
    body.drawer-mobile-open .tsf-drawer-overlay {
        display: block;
        opacity: 1;
    }

    .tsf-main { padding: 14px; }
    .tsf-logged-info { font-size: 13px; }
    .tsf-drawer-toggle-mobile { display: inline-flex; margin-bottom: 18px; }
}

/* ═══════════════════════════════════════════════════════════
   SMALL SCREENS
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .tsf-main { padding: 10px; }
}

/* ═══════════════════════════════════════════════════════════
   KEYBOARD FOCUS
   base.css removes outlines (#page a { outline: 0 }); restore a
   visible ring for keyboard users only.
   ═══════════════════════════════════════════════════════════ */
#page a:focus-visible,
#page button:focus-visible,
#page .btn:focus-visible,
#page [tabindex]:focus-visible {
    outline: 2px solid var(--tsf-green);
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════
   DATA GRIDS (CGridView / TbGridView)
   ═══════════════════════════════════════════════════════════ */
#page .grid-view table.items td { padding: 6px; }
#page .grid-view table.items tbody tr:nth-child(even) td {
    background-color: var(--tsf-green-light);
}
#page .grid-view table.items tbody tr:hover td {
    background-color: #e3efe4;
}
#page .grid-view table.items tbody tr.selected td {
    background-color: #cfe8c9;
}

/* ═══════════════════════════════════════════════════════════
   CARDS — grids and forms sit on white panels
   (background-color only, so .grid-view-loading keeps its spinner)
   ═══════════════════════════════════════════════════════════ */
.tsf-main .grid-view,
.tsf-main div.form,
.tsf-main form.form-horizontal,
.tsf-main form.form-vertical {
   
    border-radius: 8px;
    padding: 14px 16px;
    border: 1px solid teal;
	box-shadow: 10px 10px 20px rgba(0, 0, 0, 0.5);
   
}
/* no card inside a card */
.tsf-main div.form form,
.tsf-main div.form .grid-view,
.tsf-main form .grid-view,
.tsf-main .grid-view form {
    background-color: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    box-shadow: none;
}
@media (max-width: 480px) {
    .tsf-main .grid-view,
    .tsf-main div.form,
    .tsf-main form.form-horizontal,
    .tsf-main form.form-vertical { padding: 10px; }
}

/* ═══════════════════════════════════════════════════════════
   PRINT — content only
   ═══════════════════════════════════════════════════════════ */
@media print {
    .tsf-topbar,
    .tsf-drawer,
    .tsf-drawer-overlay,
    .tsf-main-toolbar,
    .tsf-footer { display: none !important; }
    body.tsf-app { background: #fff; min-width: 0; }
    .tsf-main { padding: 0; }
    .tsf-main .grid-view,
    .tsf-main div.form,
    .tsf-main form.form-horizontal,
    .tsf-main form.form-vertical { border: 0; box-shadow: none; padding: 0; }
}
