* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #0755a5;
    --primary2: #0b6fd3;
    --dark: #102b46;
    --dark2: #173e60;
    --bg: #f3f6fa;
    --border: #d9e1ea;
    --text: #172033;
    --muted: #667085;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}

/* form wrappers (logout, etc.) should not disturb flex/grid layout */
.toolbar form,
.submenu form {
    display: contents;
}

/* =====================================================
   APP
===================================================== */

.app {
    height: 100vh;
    display: flex;
    flex-direction: column;
}


/* =====================================================
   TOP APPLICATION BAR
===================================================== */

.topbar {
    height: 58px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #06498d, #0b70d4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    box-shadow: 0 2px 7px rgba(0,0,0,.18);
    z-index: 20;
}

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

.logo {
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
}

.brand-title {
    font-size: 17px;
    font-weight: 600;
}

.brand-subtitle {
    font-size: 10px;
    opacity: .75;
    margin-top: 2px;
}

.system-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.system-date {
    font-size: 11px;
    opacity: .85;
}

.user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 14px;
    border-left: 1px solid rgba(255,255,255,.25);
}

.avatar {
    width: 31px;
    height: 31px;
    background: white;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.user-text strong {
    display: block;
    font-size: 11px;
}

.user-text span {
    display: block;
    font-size: 9px;
    opacity: .7;
}


/* =====================================================
   TOOLBAR
===================================================== */

.toolbar {
    min-height: 73px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 8px 12px;
    overflow-x: auto;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    z-index: 15;
}

.tool-group {
    display: flex;
    align-items: center;
    gap: 5px;
    padding-right: 10px;
    margin-right: 9px;
    border-right: 1px solid #e3e8ee;
}

.tool-group:last-child {
    border-right: none;
}

.tool {
    width: 60px;
    min-width: 60px;
    height: 58px;
    background: white;
    border: 1px solid transparent;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    color: #425466;
    text-decoration: none;
    font-family: inherit;
    transition: .15s;
}

.tool:hover {
    background: #eef6ff;
    border-color: #bcd6f2;
    color: var(--primary);
}

.tool.active {
    background: #e7f2ff;
    border-color: #a8caed;
    color: var(--primary);
}

.tool-icon {
    width: 27px;
    height: 27px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.tool-text {
    font-size: 9px;
    white-space: nowrap;
    max-width: 57px;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =====================================================
   BODY
===================================================== */

.body {
    flex: 1;
    min-height: 0;
    display: flex;
}


/* =====================================================
   SIDEBAR
===================================================== */

.sidebar {
    width: 245px;
    flex-shrink: 0;
    background: var(--dark);
    color: white;
    overflow-y: auto;
    border-right: 1px solid #0b2135;
}

.sidebar-header {
    height: 45px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    color: #b9cee2;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}


/* MENU */

.menu-section {
    border-bottom: 1px solid rgba(255,255,255,.055);
}

.menu-title {
    height: 43px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 12px;
    color: #e5edf5;
    transition: .15s;
}

.menu-title:hover {
    background: var(--dark2);
}

.menu-arrow {
    margin-left: auto;
    font-size: 9px;
    transition: .2s;
}

.menu-section.open .menu-arrow {
    transform: rotate(90deg);
}

.submenu {
    display: none;
    padding-bottom: 5px;
}

.menu-section.open .submenu {
    display: block;
}

.submenu-item {
    width: 100%;
    min-height: 34px;
    padding: 7px 10px 7px 40px;
    color: #aebfd0;
    display: flex;
    align-items: center;
    font-size: 11px;
    cursor: pointer;
    text-decoration: none;
    background: none;
    border: none;
    font-family: inherit;
    text-align: left;
    border-left: 3px solid transparent;
    transition: .15s;
}

.submenu-item:hover {
    background: #183f60;
    color: white;
}

.submenu-item.active {
    background: #1a4e76;
    color: white;
    border-left-color: #4ba6ff;
}


/* =====================================================
   WORKSPACE
===================================================== */

.workspace {
    flex: 1;
    min-width: 0;
    overflow: auto;
    background:
        radial-gradient(circle at 70% 20%, rgba(11,111,211,.06), transparent 30%),
        #f4f7fa;
    position: relative;
}


/* =====================================================
   DASHBOARD / PAGE WRAPPER
===================================================== */

.dashboard {
    max-width: 1450px;
    margin: auto;
    padding: 24px;
}

.hero {
    background: white;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 25px;
    box-shadow: 0 2px 7px rgba(0,0,0,.04);
    margin-bottom: 18px;
}

.hero h1 {
    color: #153d67;
    font-size: 25px;
    font-weight: 600;
}

.hero p {
    color: var(--muted);
    font-size: 12px;
    margin-top: 7px;
}


/* =====================================================
   SUMMARY
===================================================== */

.summary {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 14px;
    margin-bottom: 18px;
}

.summary-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,.03);
}

.summary-icon {
    width: 43px;
    height: 43px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.blue-icon { background: #e8f2ff; color: #1269c9; }
.green-icon { background: #e8f7ed; color: #159447; }
.orange-icon { background: #fff4dd; color: #bd7b00; }
.purple-icon { background: #f0eaff; color: #7052c7; }

.summary-card small {
    display: block;
    color: #7b8794;
    font-size: 10px;
}

.summary-card strong {
    display: block;
    color: #1d344e;
    font-size: 18px;
    margin-top: 3px;
}


/* =====================================================
   MODULE CARDS / SECTIONS
===================================================== */

.section {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 18px;
    overflow: hidden;
}

.section-header {
    height: 48px;
    padding: 0 17px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section-header h2 {
    font-size: 14px;
    color: #164875;
}

.section-header span {
    font-size: 10px;
    color: #8a96a5;
}

.section-body {
    padding: 16px;
}

.modules {
    display: grid;
    grid-template-columns: repeat(4,1fr);
    gap: 10px;
}

.module {
    min-height: 72px;
    border: 1px solid #d8e0e8;
    background: white;
    border-radius: 7px;
    padding: 11px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    font-family: inherit;
    transition: .18s;
}

.module:hover {
    background: #f4f9ff;
    border-color: #91bde9;
    transform: translateY(-1px);
}

.module-icon {
    width: 39px;
    height: 39px;
    flex-shrink: 0;
    background: #edf5ff;
    color: var(--primary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.module strong {
    display: block;
    font-size: 11px;
    color: #253b53;
}

.module span {
    display: block;
    font-size: 9px;
    color: #8995a3;
    margin-top: 3px;
}


/* =====================================================
   REPORT GRID
===================================================== */

.report-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 8px;
}

.report {
    min-height: 48px;
    border: 1px solid #e0e6ed;
    border-radius: 6px;
    padding: 8px 11px;
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    transition: .15s;
}

.report:hover {
    background: #f4f9ff;
    border-color: #9fc4e9;
}

.report-icon {
    width: 29px;
    height: 29px;
    border-radius: 5px;
    background: #edf5ff;
    color: #1269c9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.report span {
    font-size: 10px;
    color: #344054;
}


/* =====================================================
   LOWER
===================================================== */

.lower {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 18px;
}

.activity-row {
    min-height: 46px;
    border-bottom: 1px solid #edf0f3;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.activity-row:last-child {
    border-bottom: none;
}

.activity-left {
    display: flex;
    align-items: center;
    gap: 9px;
}

.activity-icon {
    width: 30px;
    height: 30px;
    background: #edf5ff;
    color: #1269c9;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-name {
    font-size: 11px;
    font-weight: 600;
}

.activity-time {
    color: #98a2b3;
    font-size: 9px;
    margin-top: 2px;
}

.status {
    font-size: 9px;
    padding: 4px 7px;
    border-radius: 10px;
}

.completed { color: #087a35; background: #e7f7ed; }
.pending { color: #a86b00; background: #fff3d8; }
.empty-row { color: #98a2b3; font-size: 11px; padding: 10px 0; }


/* =====================================================
   STATUS BAR
===================================================== */

.statusbar {
    height: 27px;
    flex-shrink: 0;
    background: white;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    color: #8a96a5;
    font-size: 9px;
}


/* =====================================================
   MOBILE
===================================================== */

.mobile-toggle {
    display: none;
}

@media(max-width:1100px) {
    .summary { grid-template-columns: repeat(2,1fr); }
    .modules { grid-template-columns: repeat(2,1fr); }
}

@media(max-width:750px) {
    body { overflow: auto; }
    .topbar { height: 58px; }
    .brand-title { font-size: 14px; }
    .system-date { display: none; }

    .mobile-toggle {
        display: block;
        width: 36px;
        height: 34px;
        border: none;
        border-radius: 5px;
        background: rgba(255,255,255,.15);
        color: white;
        font-size: 19px;
        cursor: pointer;
    }

    .sidebar {
        position: fixed;
        left: -250px;
        top: 58px;
        bottom: 0;
        z-index: 100;
        transition: .25s;
    }

    .sidebar.show { left: 0; }

    .toolbar { min-height: 62px; }

    .tool { height: 49px; width: 52px; min-width: 52px; }
    .tool-text { font-size: 8px; }

    .dashboard { padding: 12px; }
    .summary { grid-template-columns: 1fr; }
    .modules { grid-template-columns: 1fr; }
    .report-grid { grid-template-columns: 1fr; }
    .lower { grid-template-columns: 1fr; }
    .user-text { display: none; }
}


/* =====================================================
   LOGIN PAGE
===================================================== */

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 20% 20%, rgba(255,255,255,.08), transparent 40%),
        linear-gradient(135deg, #06498d, #0b70d4 60%, #102b46);
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(6,30,60,.35);
    padding: 32px 30px;
}

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 22px;
}

.login-brand .logo {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #06498d, #0b70d4);
    border: none;
    color: white;
    font-size: 24px;
    margin-bottom: 10px;
}

.login-brand h1 {
    font-size: 16px;
    color: #153d67;
    font-weight: 700;
}

.login-brand p {
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
}

.login-field {
    margin-bottom: 16px;
}

.login-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #344054;
    margin-bottom: 6px;
}

.login-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: .15s;
}

.login-field input:focus {
    border-color: var(--primary2);
    box-shadow: 0 0 0 3px rgba(11,111,211,.15);
}

.login-error {
    background: #fdecec;
    color: #b42318;
    border: 1px solid #f3c6c6;
    border-radius: 7px;
    padding: 9px 12px;
    font-size: 11px;
    margin-bottom: 16px;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 20px;
    font-size: 11px;
    color: #475467;
}

.login-submit {
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 7px;
    background: linear-gradient(135deg, #06498d, #0b70d4);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: .15s;
}

.login-submit:hover {
    filter: brightness(1.08);
}


/* =====================================================
   MODULE STUB PAGE
===================================================== */

.stub-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 60px 30px;
    text-align: center;
    box-shadow: 0 2px 7px rgba(0,0,0,.04);
}

.stub-icon {
    font-size: 40px;
    width: 78px;
    height: 78px;
    border-radius: 16px;
    background: #edf5ff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}

.stub-card h1 {
    font-size: 19px;
    color: #153d67;
}

.stub-card p {
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
}
