/* ==========================================================================
   OptiBlood System / AdminLTE Dashboard Theme CSS
   ========================================================================== */

:root {
    --header-bg: #3c8dbc;
    --header-color: #ffffff;
    /* Sidebar Modern Indigo Theme */
    --sidebar-bg: #3730a3; /* Indigo 800 */
    --sidebar-active-bg: #4338ca; /* Indigo 700 */
    --sidebar-text: #c7d2fe; /* Indigo 200 */
    --sidebar-hover-text: #ffffff;
    --sidebar-active-text: #ffffff;
    --sidebar-width: 230px;
    --sidebar-collapsed-width: 50px;
    --content-bg: #ecf0f5;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-color: #dee2e6;
    
    /* KPI Card Colors */
    --kpi-cyan: #38bdf8; /* Modern Sky Blue */
    --kpi-green: #4ade80; /* Modern Green */
    --kpi-orange: #fbbf24; /* Modern Amber */
    --kpi-red: #f87171; /* Modern Red/Rose */
    --kpi-purple: #a78bfa; /* Modern Violet */
    --kpi-teal: #2dd4bf; /* Modern Teal */
}

/* Dark Mode Theme Overrides */
.dark-mode {
    --header-bg: #1e293b;
    --header-color: #ffffff;
    /* Dark Mode Indigo Sidebar */
    --sidebar-bg: #1e1b4b; /* Indigo 950 */
    --sidebar-active-bg: #312e81; /* Indigo 900 */
    --sidebar-text: #a5b4fc; /* Indigo 300 */
    --content-bg: #181f24;
    --card-bg: #222b31;
    --text-color: #e2e8f0;
    --border-color: #33414a;
}

body.dark-mode .content-wrapper,
body.dark-mode .box-widget,
body.dark-mode .card-view {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .content-header h1,
body.dark-mode .box-header,
body.dark-mode .box-title {
    color: var(--text-color) !important;
}

body.dark-mode .table,
body.dark-mode .table td,
body.dark-mode .table th {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
    border-color: var(--border-color) !important;
}

body.dark-mode .input,
body.dark-mode .select select,
body.dark-mode .textarea {
    background-color: #1a2226 !important;
    color: #ffffff !important;
    border-color: var(--border-color) !important;
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Source Sans 3', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--content-bg);
    color: var(--text-color);
}

/* --------------------------------------------------------------------------
   Layout Structure
   -------------------------------------------------------------------------- */
.admin-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-header {
    height: 50px;
    background-color: var(--header-bg);
    color: var(--header-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.logo-container {
    width: var(--sidebar-width);
    height: 50px;
    background-color: #367fa9;
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    transition: width 0.3s ease-in-out;
}

.logo-container i {
    color: #f39c12;
    margin-right: 8px;
    font-size: 20px;
}

.header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    padding: 0 15px;
}

.sidebar-toggle-btn, .dark-mode-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.sidebar-toggle-btn:hover, .dark-mode-btn:hover {
    background-color: rgba(0, 0, 0, 0.15);
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-nav .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #ffffff;
    color: var(--header-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.user-nav .user-name {
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
}

/* --------------------------------------------------------------------------
   Sidebar Component & Treeview Submenus
   -------------------------------------------------------------------------- */
.main-sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    position: fixed;
    top: 50px;
    bottom: 0;
    left: 0;
    z-index: 1020;
    overflow-y: auto;
    transition: width 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.sidebar-menu > li > a .menu-content {
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: none;
}

.sidebar-menu > li > a i.menu-icon {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-menu > li:hover > a,
.sidebar-menu > li.active > a {
    color: var(--sidebar-hover-text);
    background-color: var(--sidebar-active-bg);
    border-left-color: var(--header-bg);
}

.tree-arrow {
    transition: transform 0.3s ease;
    font-size: 12px;
    pointer-events: none;
}

.sidebar-menu > li.open > a .tree-arrow {
    transform: rotate(-90deg);
}

.sidebar-treeview {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #1a2226;
    display: none;
}

.sidebar-menu > li.open > .sidebar-treeview {
    display: block;
}

.sidebar-treeview li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 15px 9px 42px;
    color: #8aa4af;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s, background-color 0.2s;
}

.sidebar-treeview li a:hover,
.sidebar-treeview li.active a {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.05);
}

/* Sidebar Toggle State */
.sidebar-collapsed .main-sidebar {
    width: 0;
    transform: translateX(-100%);
}

.sidebar-collapsed .logo-container {
    width: 60px;
}

.sidebar-collapsed .logo-text {
    display: none;
}

.sidebar-collapsed .content-wrapper {
    margin-left: 0;
}

/* --------------------------------------------------------------------------
   Content Wrapper
   -------------------------------------------------------------------------- */
.content-wrapper {
    margin-left: var(--sidebar-width);
    margin-top: 50px;
    padding: 20px;
    min-height: calc(100vh - 50px);
    transition: margin-left 0.3s ease-in-out;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.content-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.content-header h1 small {
    font-size: 15px;
    font-weight: 300;
    color: #777777;
    margin-left: 8px;
}

.breadcrumb-nav {
    font-size: 12px;
    color: #777777;
}

.breadcrumb-nav a {
    color: #444444;
    text-decoration: none;
}

.breadcrumb-nav a:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   KPI Stat Cards (Small Boxes)
   -------------------------------------------------------------------------- */
.small-box-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.small-box {
    border-radius: 6px;
    position: relative;
    display: block;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    color: #ffffff;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.small-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.small-box .inner {
    padding: 16px 18px;
    position: relative;
    z-index: 2;
}

.small-box h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 4px 0;
    white-space: nowrap;
}

.small-box p {
    font-size: 13px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.small-box .icon-watermark {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 1;
    font-size: 60px;
    color: rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.small-box:hover .icon-watermark {
    transform: scale(1.1);
}

.small-box-footer {
    position: relative;
    text-align: center;
    padding: 6px 0;
    color: rgba(255, 255, 255, 0.9);
    display: block;
    z-index: 2;
    background: rgba(0, 0, 0, 0.15);
    text-decoration: none;
    font-size: 12px;
    transition: background 0.2s, color 0.2s;
}

.small-box-footer:hover {
    color: #ffffff;
    background: rgba(0, 0, 0, 0.25);
}

/* Background Color Modifiers */
.bg-aqua, .bg-cyan { background-color: var(--kpi-cyan) !important; }
.bg-green, .bg-success { background-color: var(--kpi-green) !important; }
.bg-yellow, .bg-orange { background-color: var(--kpi-orange) !important; }
.bg-red, .bg-danger { background-color: var(--kpi-red) !important; }
.bg-purple { background-color: var(--kpi-purple) !important; }
.bg-teal { background-color: var(--kpi-teal) !important; }

/* --------------------------------------------------------------------------
   Dashboard Widgets & Cards
   -------------------------------------------------------------------------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.box-widget {
    background: var(--card-bg);
    border-radius: 6px;
    border-top: 3px solid #d2d6de;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.box-widget.box-primary { border-top-color: #3c8dbc; }
.box-widget.box-info { border-top-color: #00c0ef; }
.box-widget.box-success { border-top-color: #00a65a; }
.box-widget.box-warning { border-top-color: #f39c12; }
.box-widget.box-danger { border-top-color: #dd4b39; }
.box-widget.box-purple { border-top-color: #605ca8; }

.box-header {
    color: var(--text-color);
    padding: 12px 15px;
    position: relative;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.box-header .box-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.box-body {
    padding: 15px;
}

/* --------------------------------------------------------------------------
   Modern Glassmorphism Premium Login Design
   -------------------------------------------------------------------------- */
.login-page-bg {
    min-height: 100vh;
    width: 100%;
    margin: 0;
    background: radial-gradient(circle at 20% 20%, #1a2b3c 0%, #0d151c 100%);
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
}

.login-page-bg::before {
    content: '';
    position: absolute;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(0, 192, 239, 0.25) 0%, rgba(0,0,0,0) 70%);
    top: -100px;
    left: -100px;
    border-radius: 50%;
    animation: pulseGlow 8s infinite alternate;
}

.login-page-bg::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 166, 90, 0.2) 0%, rgba(0,0,0,0) 70%);
    bottom: -150px;
    right: -150px;
    border-radius: 50%;
    animation: pulseGlow 10s infinite alternate-reverse;
}

@keyframes pulseGlow {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.2); opacity: 1; }
}

.login-box-card {
    width: 100%;
    max-width: 440px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    overflow: hidden;
    z-index: 10;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-box-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.login-logo-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    padding: 30px 25px;
    text-align: center;
    position: relative;
}

.login-logo-header h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    letter-spacing: 0.5px;
}

.login-logo-header h2 i {
    color: #00c0ef;
    animation: heartbeat 2s infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.login-box-body {
    padding: 32px 30px;
}

.login-demo-box {
    background-color: #f0f7ff;
    border: 1px solid #cce3ff;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 24px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-demo-box:hover {
    background-color: #e0f0ff;
}

.toggle-password-btn {
    cursor: pointer;
    pointer-events: auto !important;
}

/* Print Styles */
@media print {
    .main-sidebar, .main-header, .btn-no-print {
        display: none !important;
    }
    .content-wrapper {
        margin-left: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
    }
}