/* Classic Windows Style - No Border Radius, Old Design */

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

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    font-family: 'MS Sans Serif', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #c0c0c0;
    padding: 0px;
    font-size: 11px;
}

/* Window Frame */
.window-frame {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    margin: 0 auto;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Title Bar */
.title-bar {
    background: linear-gradient(to bottom, #0080ff, #0054b4);
    color: white;
    padding: 4px 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 11px;
    user-select: none;
}

.title-bar-text {
    display: flex;
    align-items: center;
    gap: 6px;
}

.title-icon {
    font-size: 14px;
    display: flex;
    align-items: center;
}

.title-icon img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.title-bar-controls {
    display: flex;
    gap: 2px;
}

.title-bar-button {
    width: 20px;
    height: 18px;
    border: 1px outset #c0c0c0;
    background: #c0c0c0;
    color: black;
    font-size: 12px;
    cursor: pointer;
    font-weight: bold;
    padding: 0;
    line-height: 1;
}

.title-bar-button:hover {
    background: #d4d0c8;
}

.title-bar-button:active {
    border: 1px inset #c0c0c0;
}

.close-button:hover {
    background: #ff0000;
    color: white;
}

/* Menu Bar */
.menu-bar {
    background: #c0c0c0;
    border-top: 1px inset #c0c0c0;
    border-bottom: 1px inset #c0c0c0;
    display: flex;
    padding: 2px 0;
    user-select: none;
}

.menu-item {
    position: relative;
    padding: 5px 14px;
    cursor: pointer;
    font-size: 12px;
    color: black;
}

.menu-item:hover {
    background: #000080;
    color: white;
}

.menu-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    min-width: 200px;
    z-index: 9999;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.45);
}

.menu-item.open .menu-dropdown {
    display: block;
}

.menu-item.open {
    background: #000080;
    color: white;
}

.menu-dropdown-item {
    padding: 7px 24px;
    color: black;
    text-decoration: none;
    display: block;
    font-size: 12px;
    white-space: nowrap;
}

.menu-dropdown-item:hover {
    background: #000080;
    color: white;
}

.menu-dropdown-separator {
    height: 1px;
    background: #808080;
    margin: 4px 0;
    border-top: 1px solid #ffffff;
}

/* Toolbar */
.toolbar {
    background: #dcdcdc;
    border-top: 1px inset #dcdcdc;
    border-bottom: 1px inset #dcdcdc;
    padding: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

/* Disable toolbar buttons while a menu dropdown is open */
body.menu-open .toolbar-button {
    pointer-events: none;
    opacity: 0.45;
    cursor: default;
}

.toolbar-button {
    border: 1px outset #dcdcdc;
    background: #dcdcdc;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: black;
}

.toolbar-button:hover {
    background: #d4d0c8;
}

.toolbar-button:active {
    border: 1px inset #dcdcdc;
}

.toolbar-icon {
    font-size: 12px;
}

.toolbar-separator {
    width: 1px;
    height: 20px;
    background: #808080;
    border-left: 1px solid #ffffff;
    margin: 0 2px;
}

/* Content Area */
.content-area {
    background: white;
    padding: 12px;
    flex: 1;
    overflow-y: auto;
    min-height: 400px;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #c0c0c0;
}

.content-header h2 {
    font-size: 14px;
    font-weight: bold;
    color: black;
}

.header-button {
    border: 1px outset #c0c0c0;
    background: #c0c0c0;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 11px;
    margin-left: 4px;
}

.header-button:hover {
    background: #d4d0c8;
}

.header-button:active {
    border: 1px inset #c0c0c0;
}

/* Stats Container */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.stat-box {
    border: 1px inset #c0c0c0;
    background: #c0c0c0;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.stat-box:hover {
    background: #d4d0c8;
}

.stat-icon {
    font-size: 32px;
    width: 50px;
    text-align: center;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: black;
}

.stat-label {
    font-size: 11px;
    color: #404040;
}

/* Panel */
.panel {
    border: 1px inset #c0c0c0;
    background: white;
    margin-bottom: 12px;
}

.panel-header {
    background: #c0c0c0;
    padding: 4px 8px;
    font-weight: bold;
    font-size: 11px;
    border-bottom: 1px inset #c0c0c0;
    color: black;
}

.panel-body {
    padding: 12px;
}

.panel-footer {
    background: #c0c0c0;
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px inset #c0c0c0;
    font-size: 11px;
}

.footer-left {
    color: black;
}

.footer-right {
    display: flex;
    gap: 2px;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-button {
    border: 1px outset #c0c0c0;
    background: #c0c0c0;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-button:hover {
    background: #d4d0c8;
}

.action-button:active {
    border: 1px inset #c0c0c0;
}

.action-icon {
    font-size: 14px;
}

/* Data Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.data-table thead {
    background: #c0c0c0;
}

.data-table th {
    padding: 4px 8px;
    text-align: left;
    font-weight: bold;
    border: 1px inset #c0c0c0;
    color: black;
}

.data-table td {
    padding: 4px 8px;
    border: 1px inset #c0c0c0;
    background: white;
	vertical-align:top;
}

.data-table tbody tr:hover {
    background: #e8e8e8;
}

.text-center {
    text-align: center !important;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.text-right {
    text-align: right;
}

/* Form Elements */
.filter-bar {
    background: #dcdcdc;
    padding: 8px;
    margin-bottom: 12px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border: 1px inset #dcdcdc;
}

.filter-input,
.filter-array,
.filter-select {
    border: 1px inset #c0c0c0;
    background: white;
    padding: 4px 6px;
    font-size: 11px;
    color: black;
}

.filter-button {
    border: 1px outset #dcdcdc;
    background: #dcdcdc;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 11px;
}

.filter-button:hover {
    background: #d4d0c8;
}

.filter-button:active {
    border: 1px inset #c0c0c0;
}

.form-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group {
    margin-bottom: 8px;
}

.form-label {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    color: black;
    font-weight: normal;
}

.form-label .required {
    color: red;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    border: 1px inset #c0c0c0;
    background: white;
    padding: 4px 6px;
    font-size: 11px;
    color: black;
    font-family: inherit;
}

.form-textarea {
    resize: vertical;
}

.form-input[readonly],
.form-textarea[readonly],
.form-select[disabled] {
    background-color: #e0e0e0;
    color: #404040;
    cursor: default;
    border-style: inset;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    cursor: pointer;
}

.checkbox-input {
    width: 13px;
    height: 13px;
    cursor: pointer;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 4px 0;
}

.form-checkbox {
    width: 13px;
    height: 13px;
    cursor: pointer;
}

/* Buttons */
.table-button {
    border: 1px outset #c0c0c0;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 10px;
    margin: 0 2px;
}

.table-button:hover {
    background: #d4d0c8;
}

.table-button:active {
    border: 1px inset #c0c0c0;
}

.delete-button:hover {
    background: #ff6b6b;
    color: white;
}

.pagination-button {
    border: 1px outset #c0c0c0;
    background: #c0c0c0;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 10px;
}

.pagination-button:hover {
    background: #d4d0c8;
}

.pagination-button:active {
    border: 1px inset #c0c0c0;
}

.pagination-button.active {
    background: #000080;
    color: white;
}

.pagination-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Badges */
.badge {
    background: #c0c0c0;
    border: 1px inset #c0c0c0;
    padding: 2px 6px;
    font-size: 10px;
    color: black;
}

.status-badge {
    padding: 4px 6px;
    font-size: 10px;
    border: 1px inset #c0c0c0;
}

.status-badge.active {
    background: #90ee90;
    color: black;
}

.status-badge.inactive {
    background: #d3d3d3;
    color: black;
}

.status-badge.approved {
    background: #90ee90;
    color: black;
}

.status-badge.pending {
    background: gold;
    color: black;
}

.status-badge.rejected {
    background: #d3d3d3;
    color: black;
}

.status-badge.urgency {
    background: gold;
    color: black;
}

.status-badge.expired {
    background: #F88379;
    color: black;
}

.status-badge.closed {
    background: #d3d3d3;
    color: black;
}

/* Status Bar */
.status-bar {
    background: #c0c0c0;
    border-top: 1px inset #c0c0c0;
    padding: 4px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: black;
}

.status-bar-left,
.status-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-separator {
    color: #808080;
}

/* Dialog */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.dialog {
    background: #c0c0c0;
    border: 2px outset #c0c0c0;
    min-width: 300px;
    box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.dialog-header {
    background: #000080;
    color: white;
    padding: 6px 12px;
    font-weight: bold;
    font-size: 11px;
}

.dialog-body {
    padding: 12px;
    background: white;
    font-size: 11px;
    color: black;
    overflow-y: auto;
    flex: 1;
}

.dialog-footer {
    padding: 8px;
    background: #c0c0c0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    border-top: 1px inset #c0c0c0;
}

.dialog-button {
    border: 1px outset #c0c0c0;
    background: #c0c0c0;
    padding: 4px 16px;
    cursor: pointer;
    font-size: 11px;
    min-width: 60px;
}

.dialog-button:hover {
    background: #d4d0c8;
}

.dialog-button:active {
    border: 1px inset #c0c0c0;
}

.dialog-button.primary-button {
    background: #000080;
    color: white;
}

.dialog-button.primary-button:hover {
    background: #0000ff;
}

/* Detail Panel */
.detail-panel {
    border: 1px inset #c0c0c0;
    background: white;
    margin-bottom: 12px;
}

.detail-panel-header {
    display: flex;
	justify-content: space-between; 
	align-items: center;
	background: #000080;
    padding: 6px 10px;
    font-weight: bold;
    font-size: 11px;
    color: white;
}

.detail-panel-header .close-button{
	color: white; 
	border-color: white;
}

.detail-panel-body {
    padding: 12px;
}

.detail-grid {
	display: grid;
	grid-template-columns: 100px 1fr;
	gap: 10px;
	border: 1px solid black;
	/*margin-bottom: 5px;*/	
}

.detail-label {
	font-weight: bold;
	color: #404040;
	padding: 5px;
	background: #dcdcdc; 
}

.detail-value {
	color: black;
	padding: 5px;
}

.detail-panel-body .form-column {
    gap: 3px;
}

.detail-previous-value{
	color: #d9534f; 
	background: #fde8e7; 
	padding: 2px 4px;
}

.detail-new-value{
	color: #28a745; 
	background: #dff0d8; 
	padding: 2px 4px;
}
		
/* Detail Tabs */
.detail-tabs {
    display: flex;
    background: #c0c0c0;
    border-bottom: 1px inset #c0c0c0;
    gap: 2px;
    padding: 4px 4px 0 4px;
}

.detail-tab {
    border: 1px outset #c0c0c0;
    background: #c0c0c0;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 11px;
    color: black;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: none;
    position: relative;
    top: 1px;
}

.detail-tab:hover {
    background: #d4d0c8;
}

.detail-tab.active {
    background: white;
    border-bottom: 1px solid white;
    font-weight: bold;
}

.tab-icon {
    font-size: 14px;
}

.tab-content {
    display: none;
	padding: 12px;
}

.tab-content.active {
    display: block;
}

/* AutoComplete */
.autocomplete-wrapper {
	position: relative;
}

.autocomplete-dropdown {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	max-height: 200px;
	overflow-y: auto;
	background: white;
	border: 2px solid #808080;
	border-top: 1px solid #c0c0c0;
	box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
	z-index: 1000;
	margin-top: 1px;
}

.autocomplete-dropdown.show {
	display: block;
}

.autocomplete-item {
	padding: 6px 8px;
	cursor: pointer;
	font-size: 11px;
	border-bottom: 1px solid #e0e0e0;
}

.autocomplete-item:last-child {
	border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
	background: #000080;
	color: white;
}

.autocomplete-item-name {
	font-weight: bold;
	display: block;
}

.autocomplete-item-details {
	font-size: 10px;
	color: #666;
	margin-top: 2px;
}

.autocomplete-item:hover .autocomplete-item-details,
.autocomplete-item.active .autocomplete-item-details {
	color: #ddd;
}

.no-results {
	padding: 8px;
	text-align: center;
	color: #666;
	font-size: 11px;
	font-style: italic;
}
		
.header-button.active-filter {
	background: #000080;
	color: #ffffff;
	border-color: #808080 #ffffff #ffffff #808080;
}
		
/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.category-card {
    border: 1px inset #c0c0c0;
    background: white;
}

.category-card-header {
    background: #c0c0c0;
    padding: 6px 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px inset #c0c0c0;
}

.category-card-header h3 {
    font-size: 12px;
    font-weight: bold;
    color: black;
    margin: 0;
}

.category-card-body {
    padding: 12px;
}

.category-info {
    font-size: 11px;
    color: black;
    margin-bottom: 8px;
}

.category-description {
    font-size: 10px;
    color: #404040;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .form-layout {
        grid-template-columns: 1fr;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .toolbar {
        flex-wrap: wrap;
    }
}