/* ======= BUTTONS ======= */
.btn,
button {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-weight: 600;
    border-radius: 6px;
    padding: 10px 24px;
    font-size: 1rem;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    border: none;
    outline: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102,126,234,0.08);
}

.btn-primary,
button.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-primary:hover,
button.btn-primary:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    color: #fff;
}

.btn-secondary,
button.btn-secondary {
    background: #6c757d;
    color: #fff;
}

.btn-secondary:hover,
button.btn-secondary:hover {
    background: #495057;
    color: #fff;
}

.btn-danger,
button.btn-danger {
    background: #dc3545;
    color: #fff;
}

.btn-danger:hover,
button.btn-danger:hover {
    background: #c82333;
    color: #fff;
}

.btn-info,
button.btn-info {
    background: #17a2b8;
    color: #fff;
}

.btn-info:hover,
button.btn-info:hover {
    background: #138496;
    color: #fff;
}

/* ======= INPUTS & TEXTAREAS ======= */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
    font-family: 'Segoe UI', Arial, sans-serif;
    font-size: 1rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 12px 15px;
    margin-bottom: 12px;
    background: #f8f9fa;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    box-shadow: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102,126,234,0.15);
    background: #fff;
}

input[disabled],
select[disabled],
textarea[disabled] {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
}

/* ======= LABELS ======= */
label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: block;
    font-size: 0.97rem;
}

/* ======= FORM GROUPS ======= */
.form-group {
    margin-bottom: 20px;
}

/* ======= BADGES ======= */
.badge {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 12px;
    background: #667eea;
    color: #fff;
    margin-left: 8px;
}

.badge-success { background: #28a745; }
.badge-danger { background: #dc3545; }
.badge-secondary { background: #6c757d; }
.badge-info { background: #17a2b8; }
.badge-primary { background: #667eea; }

/* ======= GENERAL ======= */
body {
    background: #f4f6f9;
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #212529;
}

.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(102,126,234,0.08);
    padding: 30px;
    margin-bottom: 30px;
}

/* ======= LINKS ======= */
a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Uniform font for all text elements */
body,
h1, h2, h3, h4, h5, h6,
th, td,
label,
input, select, textarea,
button,
.card,
.page-header,
.info-row,
.comment-item,
.activity-item,
.attachment-item,
.timeline-content {
    font-family: 'Segoe UI', Arial, sans-serif !important;
    font-size: 15px;
    color: #212529;
    letter-spacing: 0.01em;
}

/* Optional: headings slightly larger */
h1 { font-size: 2.0rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
h4, h5, h6 { font-size: 1.1rem; }



/* Inputs and buttons */
input, select, textarea, button {
    font-size: 15px;
    font-family: 'Segoe UI', Arial, sans-serif !important;
}

/* EXCEPTIONS: Do NOT override datagrid styles */
.datagrid-view, .datagrid-row, .datagrid-cell, .datagrid-header, .datagrid-body,
.datagrid-cell-c1-action, .datagrid-row-selected, .datagrid-row-checked {
    font-family: inherit !important;
    font-size: inherit !important;
    background: inherit !important;
    color: inherit !important;
    box-shadow: none !important;
    /* Do NOT use all: unset; */
}

/* Fix for EasyUI datagrid rows being hidden by theme.css */
.datagrid-row, .datagrid-cell, .datagrid-header, .datagrid-body {
    background: inherit !important;
    color: inherit !important;
    font-size: inherit !important;
    font-family: inherit !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Attachment section styling */
.attachments-card {
    max-width: 420px;
    margin: 0 0 24px 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(102,126,234,0.08);
    padding: 28px 28px 18px 28px;
}

.attachments-card label {
    font-weight: 600;
    font-size: 1.08rem;
    margin-bottom: 12px;
    color: #495057;
}

.attachments-list {
    margin-top: 16px;
}

.attachments-list ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.attachments-list li {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 10px;
    padding: 8px 14px;
    box-shadow: 0 1px 3px rgba(102,126,234,0.04);
    transition: background 0.2s;
}

.attachments-list li:hover {
    background: #e7eaf3;
}

.attachments-list .file-name {
    flex: 1;
    font-size: 15px;
    color: #333;
    font-weight: 500;
    word-break: break-all;
}

.attachments-list .btn-delete {
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 4px 14px;
    font-size: 14px;
    font-weight: 600;
    margin-left: 16px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.attachments-list .btn-delete:hover {
    background: #b71c1c;
}

/* ======= MAIN LAYOUT STYLES ======= */

/* Remove scrollbar from body and html */
html, body {
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Header Banner Styles */
.header-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    box-sizing: border-box;
}

/* Fix north region to prevent scrollbar */
.layout-panel-north {
    overflow: hidden !important;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.header-logo img {
    height: 50px;
    width: auto;
    vertical-align: middle;
    display: block;
}

.header-title {
    color: white;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

.header-title h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 3px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.header-title p {
    font-size: 11px;
    margin: 0;
    opacity: 0.9;
    font-weight: 300;
    white-space: nowrap;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.user-info-box {
    color: white;
    text-align: right;
    white-space: nowrap;
}

.user-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 3px;
}

.user-role {
    font-size: 11px;
    opacity: 0.85;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    padding: 8px 18px;
    border: 2px solid white;
    border-radius: 25px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.logout-btn:hover {
    background: white;
    color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Purple Theme for Menu */
#cssmenu {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    overflow: hidden;
    margin: 5px;
}

#cssmenu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#cssmenu ul li {
    position: relative;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

#cssmenu ul li:last-child {
    border-bottom: none;
}

#cssmenu ul li a {
    display: block;
    padding: 12px 15px;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

#cssmenu ul li > a:hover {
    background: rgba(255,255,255,0.15);
}

#cssmenu ul li a span {
    display: inline-block;
}

/* Parent menu item with submenu - add arrow indicator */
#cssmenu ul li:has(.submenu) > a::after {
    content: '▼';
    float: right;
    font-size: 10px;
    transition: transform 0.3s;
    margin-top: 2px;
}

#cssmenu ul li:has(.submenu).open > a::after {
    transform: rotate(180deg);
}

/* Submenu Styles - Hidden by default, shown on code change */
#cssmenu ul li .submenu {
    display: none;
    background: rgba(0,0,0,0.2);
    margin: 0;
    padding: 0;
    list-style: none;
}

#cssmenu ul li.open .submenu {
    display: block;
}

#cssmenu ul li .submenu li {
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

#cssmenu ul li .submenu li:last-child {
    border-bottom: none;
}

#cssmenu ul li .submenu li a {
    padding: 10px 15px 10px 35px;
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    background: transparent;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

#cssmenu ul li .submenu li a:hover {
    background: rgba(255,255,255,0.15);
    padding-left: 40px;
    border-left-color: white;
    color: white;
}

/* Active submenu item */
#cssmenu ul li .submenu li a.active {
    background: rgba(255,255,255,0.2);
    border-left-color: #ffd700;
    font-weight: 600;
}

/* EasyUI Panel Purple Theme Override */
.layout-panel-west {
    background: #f8f9fc !important;
    border-right: 2px solid #667eea !important;
}

.panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border-color: #764ba2 !important;
}

.panel-title {
    color: white !important;
    font-weight: 600 !important;
}

.layout-panel-center .panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
}

/* Responsive adjustments for screens */
/* Large screens - default width */
@media screen and (min-width: 1400px) {
    .layout-panel-west {
        width: 280px !important;
    }
}

/* Medium-large screens */
@media screen and (min-width: 1200px) and (max-width: 1399px) {
    .layout-panel-west {
        width: 260px !important;
    }
}

/* Medium screens */
@media screen and (min-width: 1024px) and (max-width: 1199px) {
    .layout-panel-west {
        width: 240px !important;
    }
    #cssmenu ul li a {
        font-size: 14px;
        padding: 10px 12px;
    }
    #cssmenu ul li .submenu li a {
        font-size: 12px;
        padding: 8px 12px 8px 30px;
    }
    .header-title h1 {
        font-size: 18px;
    }
    .header-title p {
        font-size: 10px;
    }
}

/* Tablets */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .layout-panel-west {
        width: 220px !important;
    }
    #cssmenu ul li a {
        font-size: 12px;
        padding: 9px 10px;
    }
    #cssmenu ul li .submenu li a {
        font-size: 11px;
        padding: 7px 10px 7px 25px;
    }
    #cssmenu ul li .submenu li a:hover {
        padding-left: 30px;
    }
    .header-title h1 {
        font-size: 16px;
    }
    .header-title p {
        font-size: 9px;
    }
    .user-name {
        font-size: 14px;
    }
    .logout-btn {
        padding: 6px 15px;
        font-size: 12px;
    }
}

/* Small tablets and large phones */
@media screen and (min-width: 600px) and (max-width: 767px) {
    .layout-panel-west {
        width: 200px !important;
    }
    #cssmenu {
        margin: 3px;
    }
    #cssmenu ul li a {
        font-size: 11px;
        padding: 8px 8px;
    }
    #cssmenu ul li .submenu li a {
        font-size: 10px;
        padding: 6px 8px 6px 20px;
    }
    #cssmenu ul li .submenu li a:hover {
        padding-left: 25px;
    }
    .header-banner {
        padding: 5px 10px;
        height: 60px;
    }
    .header-logo img {
        height: 40px;
    }
    .header-title h1 {
        font-size: 14px;
    }
    .header-title p {
        font-size: 8px;
    }
    .user-name {
        font-size: 12px;
    }
    .logout-btn {
        padding: 5px 12px;
        font-size: 11px;
    }
}

/* Mobile phones */
@media screen and (max-width: 599px) {
    .layout-panel-west {
        width: 180px !important;
    }
    #cssmenu {
        margin: 2px;
        border-radius: 5px;
    }
    #cssmenu ul li a {
        font-size: 10px;
        padding: 7px 6px;
        white-space: normal;
        line-height: 1.3;
    }
    #cssmenu ul li .submenu li a {
        font-size: 9px;
        padding: 5px 6px 5px 18px;
    }
    #cssmenu ul li .submenu li a:hover {
        padding-left: 22px;
    }
    #cssmenu ul li:has(.submenu) > a::after {
        font-size: 8px;
    }
    .header-banner {
        padding: 5px 8px;
        height: 55px;
    }
    .header-logo img {
        height: 35px;
    }
    .header-title h1 {
        font-size: 12px;
    }
    .header-title p {
        display: none;
    }
    .user-info-box {
        display: none;
    }
    .logout-btn {
        padding: 4px 10px;
        font-size: 10px;
    }
}


