/* custom app styles to extend styles.css with form layouts, cards, and file upload fields */

html, body {
    width: 100%;
    overflow-x: hidden;
}

/* Header Navigation Bar */
.main-header {
    width: 100%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(46, 122, 106, 0.08);
    border-bottom: 1px solid rgba(79, 209, 139, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
}

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

.brand-logo-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2e7a6a;
    letter-spacing: 0.5px;
}

.brand-subtitle {
    font-size: 0.75rem;
    color: #4fd18b;
    display: block;
    font-weight: 400;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    align-items: center;
}

.nav-link {
    color: #557a70;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link:hover, .nav-link.active {
    color: #2e7a6a;
    background-color: rgba(79, 209, 139, 0.15);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #2e7a6a;
    cursor: pointer;
}

/* Form Container & Layout */
.app-container {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto 8rem auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 5;
}

.page-header {
    margin-bottom: 2rem;
    text-align: center;
}

.page-title {
    color: #2e7a6a;
    font-size: 2.2rem;
    font-weight: 700;
    position: relative;
    margin-bottom: 0.5rem;
}

.page-desc {
    color: #557a70;
    font-size: 1rem;
}

/* Dashboard Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 2rem;
    width: 100%;
}

/* Glassmorphism Cards */
.glass-card {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px rgba(46, 122, 106, 0.05);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 12px 40px rgba(46, 122, 106, 0.09);
    border: 1px solid rgba(79, 209, 139, 0.25);
}

.card-title {
    color: #2e7a6a;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid rgba(79, 209, 139, 0.2);
    padding-bottom: 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Form Styling */
.form-section-title {
    color: #2e7a6a;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px dashed rgba(79, 209, 139, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

.form-group label {
    font-size: 0.9rem;
    color: #2e7a6a;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.field-desc-trigger {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 16px;
    height: 16px;
    background: #eefbf3;
    border: 1px solid #4fd18b;
    border-radius: 50%;
    font-size: 0.7rem;
    color: #2e7a6a;
    cursor: help;
    font-weight: 700;
}

/* Input Fields Styling */
.form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(79, 209, 139, 0.4);
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-size: 0.95rem;
    font-family: 'Kanit', sans-serif;
    outline: none;
    transition: all 0.3s ease;
}

.form-input:focus {
    border-color: #2e7a6a;
    box-shadow: 0 0 0 3px rgba(79, 209, 139, 0.25);
    background: #fff;
}

.input-with-unit {
    display: flex;
    align-items: center;
    position: relative;
}

.input-with-unit .form-input {
    padding-right: 3.5rem;
}

.unit-label {
    position: absolute;
    right: 12px;
    font-size: 0.85rem;
    color: #557a70;
    font-weight: 500;
    pointer-events: none;
    background: rgba(238, 251, 243, 0.85);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid rgba(79, 209, 139, 0.2);
}

/* PASS / FAIL Switches */
.pass-fail-container {
    display: flex;
    gap: 0.5rem;
}

.pass-fail-btn {
    flex: 1;
    padding: 0.7rem;
    border-radius: 10px;
    border: 1px solid #ddd;
    background: #fdfdfd;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
}

.pass-fail-btn.btn-pass {
    color: #aaa;
}

.pass-fail-btn.btn-pass.selected {
    background-color: #e8f7ee;
    border-color: #4fd18b;
    color: #2e7a6a;
    box-shadow: 0 3px 8px rgba(79, 209, 139, 0.2);
}

.pass-fail-btn.btn-fail {
    color: #aaa;
}

.pass-fail-btn.btn-fail.selected {
    background-color: #fde8e8;
    border-color: #f87171;
    color: #dc2626;
    box-shadow: 0 3px 8px rgba(248, 113, 113, 0.2);
}

/* Image Upload Slots */
.image-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.image-slot {
    border: 2px dashed rgba(255, 255, 255, 0.4);
    background: rgba(46, 122, 106, 0.9);
    color: #ffffff;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.image-slot:hover {
    border-color: #ffffff;
    background: #236557;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.image-slot input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.slot-svg-icon {
    width: 32px;
    height: 32px;
    color: #ffffff;
    margin-bottom: 10px;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.image-slot:hover .slot-svg-icon {
    opacity: 1;
}

.slot-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.slot-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.slot-preview {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    object-fit: cover;
    z-index: 10;
}

.slot-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s ease;
}

.slot-remove-btn:hover {
    transform: scale(1.15);
    background: #dc2626;
}

/* Tooltip Styling */
.tooltip-box {
    display: none;
    position: absolute;
    background: #2e7a6a;
    color: white;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.8rem;
    width: 250px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 1000;
    line-height: 1.4;
    font-weight: 300;
    pointer-events: none;
}

.tooltip-box::after {
    content: '';
    position: absolute;
    border-width: 6px;
    border-style: solid;
}

.tooltip-box.bottom {
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
}

.tooltip-box.bottom::after {
    bottom: 100%;
    left: 50%;
    margin-left: -6px;
    border-color: transparent transparent #2e7a6a transparent;
}

/* Footer elements */
.app-footer {
    width: 100%;
    text-align: center;
    padding: 3rem 0;
    margin-top: auto;
    color: #557a70;
    font-size: 0.85rem;
    position: relative;
    z-index: 10;
}

/* Table Style for T/S Parameters */
.ts-table-container {
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(79, 209, 139, 0.25);
}

.ts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.ts-table th, .ts-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(79, 209, 139, 0.15);
}

.ts-table th {
    background-color: rgba(238, 251, 243, 0.7);
    color: #2e7a6a;
    font-weight: 600;
}

.ts-table tr:hover {
    background-color: rgba(238, 251, 243, 0.3);
}

.ts-table td .form-input {
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
    border-radius: 8px;
}

.ts-table td.parameter-name {
    font-weight: 600;
    color: #2e7a6a;
    width: 15%;
}

.ts-table td.parameter-desc {
    font-size: 0.8rem;
    color: #557a70;
    width: 50%;
}

.ts-table td.parameter-input {
    width: 15%;
}

.ts-table td.parameter-target {
    width: 10%;
    font-weight: 500;
    color: #2e7a6a;
}

.ts-table td.parameter-unit {
    width: 10%;
    font-size: 0.85rem;
    color: #557a70;
}

/* Saved Records List Styles */
.records-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.records-table th, .records-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(79, 209, 139, 0.15);
}

.records-table th {
    color: #2e7a6a;
    font-weight: 600;
}

.record-row {
    cursor: pointer;
    transition: background 0.2s ease;
}

.record-row:hover {
    background: rgba(79, 209, 139, 0.08);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.status-badge.pass {
    background-color: #d1fae5;
    color: #065f46;
}

.status-badge.fail {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.pending {
    background-color: #fef3c7;
    color: #92400e;
}

.action-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: #557a70;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.action-icon-btn:hover {
    color: #2e7a6a;
    background-color: rgba(79, 209, 139, 0.15);
}

.action-icon-btn.delete:hover {
    color: #dc2626;
    background-color: #fee2e2;
}

/* Floating Actions in Forms */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2.5rem;
}

.btn-secondary {
    background: #eefbf3;
    border: 2px solid rgba(79, 209, 139, 0.4);
    color: #2e7a6a;
}

.btn-secondary:hover {
    background: #dcf7e6;
    border-color: #2e7a6a;
    transform: translateY(-2px);
}

.btn-app {
    padding: 0.75rem 1.2rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: 'Kanit', sans-serif;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    white-space: nowrap;
}

/* Vector Monochrome Icons Styling */
.nav-icon, .btn-icon, .card-title-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}
.nav-link .nav-icon {
    margin-right: 2px;
}
.btn-app .btn-icon {
    width: 16px;
    height: 16px;
}
.card-title .card-title-icon {
    width: 20px;
    height: 20px;
    margin-right: 6px;
}

.btn-app:active {
    transform: translateY(0);
}

.btn-primary-app {
    background: linear-gradient(135deg, #4fd18b 0%, #2e7a6a 100%);
    color: white;
}

.btn-primary-app:hover {
    background: linear-gradient(135deg, #3ab776 0%, #226456 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(46, 122, 106, 0.2);
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #779c90;
}

.empty-state-icon {
    font-size: 3rem;
    color: rgba(79, 209, 139, 0.3);
    margin-bottom: 1rem;
}

/* Guideline Cards */
.guideline-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(285px, 1fr));
    gap: 2rem;
}

.guideline-card {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(79, 209, 139, 0.2);
    box-shadow: 0 8px 30px rgba(0,0,0,0.02);
}

.guideline-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
    color: #2e7a6a;
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 2px solid rgba(79, 209, 139, 0.2);
    padding-bottom: 0.5rem;
}

.guideline-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guideline-item {
    position: relative;
    padding-left: 24px;
    color: #4b6b61;
    font-size: 0.95rem;
    line-height: 1.5;
}

.guideline-item::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4fd18b;
    font-weight: bold;
}

/* Stats Counter Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1.2rem 0.5rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 16px;
    border: 1px solid rgba(79, 209, 139, 0.15);
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.stat-val {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2e7a6a;
    line-height: 1;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 0.85rem;
    color: #779c90;
    font-weight: 500;
    white-space: nowrap;
}

/* Deviation indicator */
.delta-val {
    font-size: 0.75rem;
    font-weight: bold;
    margin-left: 5px;
    padding: 2px 6px;
    border-radius: 4px;
}

.delta-val.good {
    background-color: #d1fae5;
    color: #065f46;
}

.delta-val.warning {
    background-color: #fffbeb;
    color: #beb305;
}

.delta-val.bad {
    background-color: #fee2e2;
    color: #991b1b;
}

/* Print styles */
@media print {
    .main-header, .form-actions, .circles-container, .wave-bottom, .image-slot input, .slot-remove-btn {
        display: none !important;
    }
    body {
        background: white !important;
        background-image: none !important;
        color: black !important;
    }
    .app-container {
        margin: 0 !important;
        padding: 0 !important;
    }
    .glass-card {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-bottom: 2cm !important;
        page-break-inside: avoid;
    }
    .form-input {
        border: none !important;
        border-bottom: 1px solid #333 !important;
        border-radius: 0 !important;
        background: transparent !important;
        padding: 2px !important;
    }
    .pass-fail-btn {
        border: 1px solid #333 !important;
    }
    .pass-fail-btn:not(.selected) {
        display: none !important;
    }
}

/* Responsive Styling for Mobile Devices */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .dashboard-grid > * {
        min-width: 0;
    }
    .glass-card {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .header-container {
        padding: 0.8rem 1.2rem;
    }
    .mobile-nav-toggle {
        display: block;
        margin-left: auto;
    }
    .nav-menu {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 60px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
        gap: 1.5rem;
        transition: left 0.3s ease;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
        border-top: 1px solid rgba(79, 209, 139, 0.2);
        overflow-y: auto;
    }
    .nav-menu.active {
        left: 0;
    }
    .nav-link {
        width: 100%;
        font-size: 1.15rem;
        padding: 0.8rem 1.2rem;
    }
    .stats-row {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
    }
    .stat-item {
        padding: 0.8rem 0.3rem;
    }
    .stat-val {
        font-size: 1.6rem;
    }
    .stat-label {
        font-size: 0.75rem;
    }
    .page-title {
        font-size: 1.8rem;
    }
    
    /* Records table mobile styles */
    .records-table th, .records-table td {
        padding: 0.6rem 0.4rem;
        font-size: 0.85rem;
    }
    .action-icon-btn {
        padding: 4px 6px;
        font-size: 0.8rem;
    }
    .btn-app {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    /* T/S parameters table mobile alignment */
    .ts-table th, .ts-table td {
        padding: 0.5rem 0.4rem;
    }
    .ts-table th:nth-child(5),
    .ts-table td.parameter-desc {
        display: none !important; /* Hide description column header and cells on mobile */
    }
    .ts-table th:nth-child(1),
    .ts-table td.parameter-name {
        width: 20% !important;
    }
    .ts-table th:nth-child(2),
    .ts-table td.parameter-target {
        width: 20% !important;
    }
    .ts-table th:nth-child(3),
    .ts-table td.parameter-input {
        width: 45% !important;
    }
    .ts-table th:nth-child(4),
    .ts-table td.parameter-unit {
        width: 15% !important;
    }
    .ts-table .input-with-unit {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    .ts-table .input-with-unit .form-input {
        padding: 0.4rem !important;
        text-align: center;
    }
    .ts-table .delta-val {
        margin-left: 0 !important;
        margin-top: 2px;
        align-self: center;
        font-size: 0.7rem;
        padding: 2px 4px;
    }

    /* Modal adjustments on mobile */
    .modal-content {
        height: 85vh !important;
        max-height: 85vh !important;
    }
    .modal-header {
        padding: 1rem 1.25rem;
    }
    .modal-header h2 {
        font-size: 1.15rem;
    }
    .modal-close-btn {
        width: 30px;
        height: 30px;
        font-size: 0.95rem;
    }
    .modal-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        width: 100% !important;
        -webkit-overflow-scrolling: touch;
        padding: 0 0.5rem;
    }
    .modal-tab-btn {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
    .modal-body {
        padding: 1.25rem 1rem;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    .modal-body .glass-card {
        padding: 1rem !important;
    }
    .modal-footer {
        padding: 1rem;
    }
    .form-grid, .form-grid-3 {
        grid-template-columns: 1fr !important;
    }

    /* Manage Models Modal mobile adjustments */
    #manage-models-modal .modal-content {
        height: 85vh !important;
        max-height: 85vh !important;
    }
    #manage-models-modal .modal-body {
        grid-template-columns: 1fr !important;
        overflow-y: auto !important;
        flex: 1 !important;
        height: auto !important;
    }
    #manage-models-modal .modal-body > div:first-child {
        border-right: none !important;
        border-bottom: 1px solid rgba(79, 209, 139, 0.2) !important;
        padding-right: 0 !important;
        padding-bottom: 1.5rem !important;
        margin-bottom: 1.5rem !important;
        overflow-y: visible !important;
    }
    #manage-models-modal .modal-body > div:nth-child(2) {
        padding-left: 0 !important;
        overflow-y: visible !important;
    }
    #model-params-inputs-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    #model-params-inputs-grid .form-input {
        padding: 0.4rem 0.3rem !important;
        font-size: 0.8rem !important;
    }
}

/* Specific mobile layout optimization */
@media (max-width: 600px) {
    /* Hide model and date columns on small screens to fit content neatly without scrolling */
    .records-table th:nth-child(3),
    .records-table td:nth-child(3),
    .records-table th:nth-child(4),
    .records-table td:nth-child(4) {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .stat-label {
        font-size: 0.65rem;
        white-space: normal;
    }
    .stat-val {
        font-size: 1.3rem;
    }
}

/* ========================================== */
/* EDIT RECORD MODAL STYLING                 */
/* ========================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(46, 122, 106, 0.35);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    width: 92%;
    max-width: 1100px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    padding: 0 !important;
    overflow: hidden;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: rgba(255, 255, 255, 0.88) !important;
    border: 1px solid rgba(79, 209, 139, 0.3) !important;
    box-shadow: 0 25px 50px -12px rgba(46, 122, 106, 0.25) !important;
}

.modal-backdrop.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(79, 209, 139, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.5);
}

.modal-header h2 {
    color: #2e7a6a;
    font-size: 1.4rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close-btn {
    background: rgba(248, 113, 113, 0.1);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.1rem;
    color: #dc2626;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: #dc2626;
    color: white;
    transform: rotate(90deg);
}

.modal-tabs {
    display: flex;
    background: rgba(238, 251, 243, 0.55);
    border-bottom: 1px solid rgba(79, 209, 139, 0.15);
    padding: 0 1rem;
    gap: 0.5rem;
}

.modal-tab-btn {
    background: none;
    border: none;
    padding: 1.1rem 1.4rem;
    font-family: 'Kanit', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    color: #557a70;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.modal-tab-btn:hover {
    color: #2e7a6a;
    background: rgba(79, 209, 139, 0.08);
    border-radius: 8px 8px 0 0;
}

.modal-tab-btn.active {
    color: #2e7a6a;
    font-weight: 600;
}

.modal-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #2e7a6a;
    border-radius: 3px 3px 0 0;
}

.modal-body {
    padding: 2.2rem 2rem;
    overflow-y: auto;
    flex: 1;
    background: rgba(255, 255, 255, 0.3);
}

.modal-tab-content {
    display: none;
}

.modal-tab-content.active {
    display: block;
    animation: modalTabFadeIn 0.3s ease-out;
}

@keyframes modalTabFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-footer {
    padding: 1.2rem 2rem;
    border-top: 1px solid rgba(79, 209, 139, 0.2);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.85);
}

.modal-body .glass-card {
    background: rgba(255, 255, 255, 0.9) !important;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.02) !important;
    border: 1px solid rgba(79, 209, 139, 0.15) !important;
}

.modal-body .ts-table-container {
    background: white;
}

/* Custom Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    width: 90%;
    pointer-events: none;
}

.toast {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: 0 10px 30px rgba(46, 122, 106, 0.12);
    border-left: 5px solid #2e7a6a;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    cursor: pointer;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}

.toast-success {
    border-left-color: #10b981;
}
.toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.toast-error {
    border-left-color: #ef4444;
}
.toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.toast-warning {
    border-left-color: #f59e0b;
}
.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.toast-info {
    border-left-color: #3b82f6;
}
.toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.toast-content {
    flex: 1;
    font-family: 'Kanit', sans-serif;
    font-size: 0.9rem;
    color: #333;
    font-weight: 500;
}

.toast-close {
    background: none;
    border: none;
    color: #999;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.toast-close:hover {
    color: #333;
}

/* Custom Confirm Dialog Modal */
.confirm-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(46, 122, 106, 0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.confirm-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

.confirm-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    border: 1px solid rgba(79, 209, 139, 0.35);
    box-shadow: 0 25px 60px rgba(46, 122, 106, 0.2);
    width: 90%;
    max-width: 440px;
    padding: 2rem;
    text-align: center;
    transform: scale(0.9) translateY(15px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-backdrop.active .confirm-card {
    transform: scale(1) translateY(0);
}

.confirm-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.confirm-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2e7a6a;
    margin-bottom: 0.75rem;
    font-family: 'Kanit', sans-serif;
}

.confirm-message {
    font-size: 0.95rem;
    color: #557a70;
    margin-bottom: 1.75rem;
    line-height: 1.5;
    font-family: 'Kanit', sans-serif;
}

.confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.confirm-actions button {
    padding: 0.7rem 1.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: 'Kanit', sans-serif;
    transition: all 0.2s ease;
}

.confirm-btn-cancel {
    background: #eefbf3;
    border: 1px solid rgba(79, 209, 139, 0.4);
    color: #2e7a6a;
}

.confirm-btn-cancel:hover {
    background: #dcf7e6;
    border-color: #2e7a6a;
}

.confirm-btn-confirm {
    background: linear-gradient(135deg, #4fd18b 0%, #2e7a6a 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(46, 122, 106, 0.15);
}

.confirm-btn-confirm:hover {
    background: linear-gradient(135deg, #3ab776 0%, #226456 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(46, 122, 106, 0.2);
}
