/* AETC WMS Plugin Styles - V2.4.0 */
:root {
  --pink: #E37F91;
  --green: #3CC0C4;
  --mgreen: #114B5F;
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type=number] {
  -moz-appearance: textfield;
}

/* Form Styles */
#aetc-doc-form {
    margin-bottom: 20px;
}

.aetc-forms {
	padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	background-color: #fff8;
}
.aetc-form-actions {
    margin: 15px 0;
}

/* Table Styles - Consistent across all tables */
.aetc-doc-table,
.aetc-list-table,
.aetc-detail-table,
.aetc-items-table {
    table-layout: auto;
    border-collapse: collapse;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
    font-size: 14px;
}

.aetc-items-table {
    width: 100%;
}

.aetc-doc-table th,
.aetc-list-table th,
.aetc-detail-table th,
.aetc-items-table th,
.aetc-list-table .aetc-th,
.aetc-detail-table .aetc-th,
.aetc-items-table .aetc-th {
    background: var(--mgreen);
    color: #fff;
    padding: 10px;
    text-align: center;
    font-weight: 500;
    border: none;
}

.aetc-doc-table td,
.aetc-list-table td,
.aetc-detail-table td,
.aetc-items-table td,
.aetc-list-table .aetc-td,
.aetc-detail-table .aetc-td,
.aetc-items-table .aetc-td {
    border-bottom: 1px solid #ddd;
    padding: 10px;
    vertical-align: middle;
    text-align: center;
    word-wrap: break-word;
}

/* Column Width Controls */
/* aetc-list-table column widths */
.aetc-list-table td:nth-child(1) { /* Serial number */
    width: 50px;
    max-width: 50px;
}

.aetc-list-table td:nth-child(2),
.aetc-list-table td:nth-child(3) { /* Columns 2 & 3 - same width */
    width: 200px;
    min-width: 150px;
    max-width: 225px;
}

.aetc-list-table td:nth-child(4) { /* Items quantity */
    width: 75px;
    min-width: 50px;
    max-width: 125px;
}

/* aetc-detail-table column widths */
.aetc-detail-table td:nth-child(1) { /* Serial number */
    width: 40px;
    max-width: 40px;
}

.aetc-detail-table td:nth-child(2),
.aetc-detail-table td:nth-child(3),
.aetc-detail-table td:nth-child(5) { /* Columns 2, 3 & 5 - same width */
    width: 70px;
    min-width: 60px;
    max-width: 120px;
}

.aetc-detail-table td:nth-child(4) { /* Description */
    width: 150px;
    min-width: 120px;
    max-width: 170px;
    word-wrap: break-word;
}

.aetc-detail-table td:nth-child(6) { /* Quantity */
    width: 80px;
    min-width: 70px;
    max-width: 100px;
}

/* Striped table rows */
.aetc-doc-table tr:nth-child(even),
.aetc-list-table tr:nth-child(even),
.aetc-detail-table tr:nth-child(even),
.aetc-items-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.aetc-doc-table tr:nth-child(odd),
.aetc-list-table tr:nth-child(odd),
.aetc-detail-table tr:nth-child(odd),
.aetc-items-table tr:nth-child(odd) {
    background-color: #fcfeff;
}

/* Add transition to normal state for smooth hover in AND out */
.aetc-doc-table tr,
.aetc-list-table tr,
.aetc-detail-table tr,
.aetc-items-table tr {
    transition: background-color 0.2s ease-in-out;
}

/* Optional: Hover effect for better interactivity */
.aetc-doc-table tr:hover,
.aetc-list-table tr:hover,
.aetc-detail-table tr:hover,
.aetc-items-table tr:hover {
    background-color: #e9ecef;
}

/* Input Styles */
.aetc-input {
    width: 100%;
    font-family: Montserrat, Tahoma, sans-serif;
	font-weight: 400;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

.aetc-input[readonly] {
    background: #f5f5f5;
    color: #666;
}

.aetc-description {
    width: 225px;
}

.aetc-expiry {
    width: 150px;
}

.aetc-sku, .aetc-batch {
    width: 150px;
}

.aetc-quantity {
    max-width: 75px;
}

/* Button Styles - Consistent color scheme */
.aetc-btn {
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    transition: background-color 0.25s;
}

/* Primary Actions (Submit, Create, Search, Back) */
.aetc-btn-submit,
.aetc-btn-create,
.aetc-btn-search,
.aetc-btn-back {
    background: var(--mgreen);
	font-family: Montserrat, Tahoma, sans-serif;
	font-weight: 400;
    color: #fff;
}

.aetc-btn-submit:hover,
.aetc-btn-create:hover,
.aetc-btn-search:hover,
.aetc-btn-back:hover {
    background: #0a3a4a;
}

.aetc-btn-submit:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Add/Success Actions */
.aetc-btn-add {
	font-family: Montserrat, Tahoma, sans-serif;
	font-weight: 400;
    background: #28a745;
    color: #fff;
}

.aetc-btn-add:hover {
    background: #289942;
}

/* Remove/Danger Actions */
.aetc-remove-row {
    background: #dc3545;
    color: #fff;
	font-family: Montserrat, Tahoma, sans-serif;
	font-weight: 400;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.25s;
}

.aetc-remove-row:hover {
    background: #c82333;
}

/* Secondary/Neutral Actions */
.aetc-btn-home {
    background: #6c757d;
    color: #fff;
}

.aetc-btn-home:hover {
    background: #545b62;
}

/* Message Styles */
.aetc-message {
    margin-top: 12px;
    padding: 10px;
    border-radius: 4px;
    font-weight: 500;
}

.aetc-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
	font-size: 14px;
}

.aetc-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Alert Styles */
.aetc-alert {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 14px;
}

.aetc-alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
	font-size: 14px;
}

.aetc-alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
	font-size: 14px;
}

/* Success Page Styles */
.aetc-success-details {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.aetc-success-title {
    margin-top: 0;
    color: var(--mgreen);
}

.aetc-items-title {
    margin-bottom: 15px;
    color: #333;
}

.aetc-details-table {
    width: 100%;
    margin-bottom: 20px;
    font-size: 16px;
}

.aetc-detail-label {
    width: 120px;
    font-weight: 400;
}

.aetc-detail-value {
    padding: 0;
}

.aetc-no-items {
    color: #666;
    font-style: italic;
}

.aetc-success-actions {
    margin-top: 20px;
}

/* List Page Styles */
.aetc-doc-list {
    max-width: 1100px;
    margin: 20px auto;
}

.aetc-list-title {
    margin-top: 0;
    font-size: 18px;
}

.aetc-search-form {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.aetc-search-input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 200px;
    font-family: Montserrat, Tahoma, sans-serif;
	font-weight: 400;
}

.aetc-per-page-label {
    margin-left: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
	font-size: 14px;
}

.aetc-per-page-select {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: Montserrat, Tahoma, sans-serif;
}

.aetc-no-data {
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Pagination Styles */
.aetc-pagination {
    margin-bottom: 15px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.aetc-page-link {
    padding: 4px 8px;
    text-decoration: none;
    color: #0073aa;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

.aetc-page-link:hover {
    background: var(--mgreen);
	color: white;
}

.aetc-page-current {
    font-weight: bold;
    background: var(--mgreen);
    color: #fff;
    border-color: var(--mgreen);
}

/* Single Document View */
.aetc-doc-single {
    max-width: 1100px;
    margin: 20px auto;
}

.aetc-doc-single p {
    max-width: 1100px;
    margin: 20px auto;
    font-size: 16px;
}

.aetc-doc-header {
    margin-top: 0;
}

/* Document Link Styles */
.aetc-doc-link {
    color: var(--mgreen);
    text-decoration: none;
    font-weight: 500;
}

.aetc-doc-link:hover {
    text-decoration: underline;
}

/* Admin Styles */
.aetc-admin-wrap {
    max-width: 1100px;
}

.aetc-admin-title {
    margin-top: 0;
}

.aetc-admin-search {
    margin-bottom: 10px;
}

.aetc-admin-search-input {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 5px;
}

.aetc-admin-per-page {
    display: inline-block;
    margin-bottom: 10px;
}

.aetc-admin-per-page-select {
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 0 5px;
}

.aetc-admin-table {
    width: 100%;
    margin-top: 12px;
}

.aetc-admin-th {
    padding: 8px 10px;
    text-align: left;
}

.aetc-admin-td {
    padding: 8px 10px;
    vertical-align: middle;
}

.aetc-admin-pagination {
    margin-top: 12px;
}

.aetc-admin-pagination a {
    margin-right: 6px;
    text-decoration: none;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.aetc-admin-page-current {
    font-weight: bold;
    background: var(--mgreen);
    color: #fff;
    border-color: var(--mgreen);
}

.aetc-admin-detail-table .aetc-admin-th {
    background: #f7f7f7;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .aetc-wrapper,
    .aetc-doc-list,
    .aetc-doc-single {
        margin: 10px;
        max-width: none;
    }
    
    .aetc-search-form {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .aetc-search-input {
        min-width: 100%;
        margin-bottom: 10px;
    }
    
    .aetc-per-page-label {
        margin-left: 0;
        margin-top: 10px;
		font-size: 12px;
    }
    
    .aetc-doc-table,
    .aetc-list-table,
    .aetc-detail-table,
    .aetc-items-table {
        font-size: 14px;
    }
    
    .aetc-th,
    .aetc-td {
        padding: 8px 6px;
    }
    
    .aetc-form-actions {
        text-align: center;
    }
    
    .aetc-btn-submit {
        margin-left: 0;
        margin-top: 8px;
    }
}

/* GRN Table Styles */
.aetc-grn-table input[readonly] {
    background: #f5f5f5;
    color: #666;
    border-color: #ddd;
}

.aetc-grn-title {
    color: var(--mgreen);
    margin-bottom: 10px;
}

.aetc-grn-subtitle {
    font-size: 16px;
    margin-bottom: 20px;
    color: #555;
}

/* Error state for quantity inputs */
.aetc-quantity-input.error {
    border-color: #dc3545;
    background-color: #f8d7da;
}

/* Status badges */
.aetc-status-badge {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.aetc-status-pending {
    background: #6c757d;
    color: white;
}

.aetc-status-completed {
    background: #28a745;
    color: white;
}

.aetc-status-processing {
    background: #ffc107;
    color: black;
}

/* Document type specific styles */
.aetc-doc-type-indicator {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

.aetc-doc-type-manifest {
    background: #17a2b8;
    color: white;
}

.aetc-doc-type-grn {
    background: #28a745;
    color: white;
}

.aetc-doc-type-gdn {
    background: #ffc107;
    color: black;
}

.aetc-doc-type-sales-order {
    background: #6f42c1;
    color: white;
}

.button-link-delete {
    color: #dc3232 !important;
    border-color: #dc3232 !important;
}

.button-link-delete:hover {
    background: #dc3232 !important;
    color: white !important;
}


/* Stock Log */
.aetc-log-entry {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.4;
}

.aetc-log-entry:last-child {
    border-bottom: none;
}

.aetc-log-positive {
    color: #28a745; /* Green color for positive quantities */
    font-weight: 500;
}

.aetc-log-negative {
    color: #dc3545; /* Red color for negative quantities */
    font-weight: 500;
}

.aetc-log-document {
    color: #6c757d; /* Default gray color for documents */
}

.aetc-log-entry a {
    text-decoration: none;
    font-weight: 500;
    color: inherit;
}

.aetc-log-entry a:hover {
    text-decoration: underline;
}

.aetc-no-logs {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.aetc-load-more-container {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.aetc-log-icon {
    display: inline-block;
    width: 20px;
    text-align: center;
}

.ui-widget {
	font-family: Montserrat, Tahoma, sans-serif !important;
	font-weight: 400 !important;
	font-size: 14px;
}
.ui-widget .ui-widget {
	font-size: 1em;
}
.ui-widget input,
.ui-widget select,
.ui-widget textarea,
.ui-widget button {
	font-family: Montserrat, Tahoma, sans-serif !important;
	font-weight: 400 !important;
	font-size: 14px;
}

#receiving_date {
	width: 250px;
}

.dynamic-row {
    opacity: 0;
    background-color: #f8f9fa;
    transition: opacity 0.4s ease-in-out, background-color 0.3s ease;
}

.dynamic-row.visible {
    opacity: 0.6;
}

.dynamic-row:hover,
.dynamic-row:focus-within {
    opacity: 1;
    background-color: transparent;
}

.dynamic-row input {
    background-color: rgba(248, 249, 250, 0.8);
    border-color: #dee2e6;
    transition: background-color 0.3s ease;
}

.dynamic-row input:focus {
    background-color: white;
    border-color: #80bdff;
}

/* Print Styles */
.aetc-print-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    color: #333;
}

.aetc-print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #114B5F;
}

.aetc-print-title h1 {
    margin: 0 0 5px 0;
    color: #114B5F;
    font-size: 24px;
}

.aetc-doc-id {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.aetc-print-meta {
    text-align: right;
}

.aetc-meta-row {
    margin-bottom: 5px;
}

.aetc-meta-label {
    font-weight: bold;
    color: #666;
}

.aetc-meta-value {
    margin-left: 10px;
}

.aetc-status-completed {
    color: #28a745;
    font-weight: bold;
}

.aetc-status-pending {
    color: #ffc107;
    font-weight: bold;
}

.aetc-status-processing {
    color: #17a2b8;
    font-weight: bold;
}

.aetc-print-summary {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.aetc-summary-item {
    text-align: center;
}

.aetc-summary-label {
    display: block;
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
}

.aetc-summary-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #114B5F;
}

.aetc-print-items h3 {
    margin-bottom: 15px;
    color: #114B5F;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.aetc-print-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.aetc-print-table th {
    background: #114B5F;
    color: white;
    padding: 10px;
    text-align: left;
    font-weight: 500;
}

.aetc-print-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
}

.aetc-print-table tr:nth-child(even) {
    background: #f8f9fa;
}

.aetc-print-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #114B5F;
}

.aetc-footer-section {
    text-align: center;
}

.aetc-print-error {
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 4px;
    text-align: center;
}

.aetc-no-items {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Print-specific styles */
@media print {
    .aetc-print-container {
        padding: 0;
        margin: 0;
    }
    
    .aetc-print-header,
    .aetc-print-summary,
    .aetc-print-items,
    .aetc-print-footer {
        break-inside: avoid;
    }
    
    .aetc-print-table {
        break-inside: avoid;
    }
    
    .aetc-print-table tr {
        break-inside: avoid;
    }
    
    .no-print {
        display: none !important;
    }
}

/* Print button styles */
.aetc-print-button {
    background: #114B5F;
    color: white;
    padding: 6px 12px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    display: inline-block;
}

.aetc-print-button:hover {
    background: #0a3a4a;
    color: white;
}