/* ========================================
   PROGRAMS PAGE CONTAINER
======================================== */

.fms-programs-page {
    display: grid;
    gap: 30px;
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px 40px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ========================================
   CARD STYLING
======================================== */

.fms-card {
    background: #ffffff;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.3s ease;
}

.fms-card:hover {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.fms-card h2 {
    margin: 0 0 22px 0;
    font-size: 22px;
    color: #0f172a;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fms-card h2::before {
    content: "📋";
    font-size: 24px;
}

/* ========================================
   FORM STYLING
======================================== */

.fms-form-group {
    margin-bottom: 20px;
}

.fms-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 14px;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fms-form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    color: #334155;
    background: #f8fafc;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.fms-form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.fms-form-group input::placeholder {
    color: #94a3b8;
}

/* ========================================
   BUTTONS
======================================== */

.fms-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    letter-spacing: 0.3px;
}

.fms-btn:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.fms-btn:active {
    transform: translateY(0);
}

/* Cancel/Secondary Button */
.fms-btn-cancel {
    background: #e2e8f0;
    color: #475569;
    margin-left: 10px;
}

.fms-btn-cancel:hover {
    background: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========================================
   TABLE STYLING
======================================== */

.fms-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.fms-table thead {
    background: #f1f5f9;
}

.fms-table th {
    padding: 16px 18px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #e2e8f0;
}

.fms-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #475569;
    vertical-align: middle;
}

.fms-table tbody tr {
    transition: background 0.2s ease;
}

.fms-table tbody tr:hover {
    background: #f8fafc;
}

.fms-table tbody tr:last-child td {
    border-bottom: none;
}

/* ID Column */
.fms-table td:first-child {
    font-weight: 700;
    color: #3b82f6;
    width: 60px;
    text-align: center;
}

/* Program Name Column */
.fms-table td:nth-child(2) {
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
}

/* Action Column */
.fms-table td:last-child {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
}

/* ========================================
   ACTION BUTTONS
======================================== */

.fms-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #3b82f6;
    color: #ffffff;
    padding: 8px 14px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.fms-edit-btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
}

.fms-edit-btn::before {
    content: "✏️";
    font-size: 12px;
}

.fms-delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #ef4444;
    color: #ffffff;
    padding: 8px 14px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.fms-delete-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.3);
}

.fms-delete-btn::before {
    content: "🗑️";
    font-size: 12px;
}

/* ========================================
   ALERT MESSAGES
======================================== */

.fms-alert {
    padding: 16px 18px;
    margin-bottom: 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 4px solid;
}

.fms-alert.success {
    background: #f0fdf4;
    color: #166534;
    border-left-color: #22c55e;
}

.fms-alert.warning {
    background: #fefce8;
    color: #854d0e;
    border-left-color: #eab308;
}

.fms-alert::before {
    font-size: 18px;
}

.fms-alert.success::before {
    content: "✅";
}

.fms-alert.warning::before {
    content: "⚠️";
}

/* ========================================
   EMPTY STATE
======================================== */

.fms-table td[colspan] {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 15px;
    font-style: italic;
}

/* ========================================
   EDIT MODE
======================================== */

.fms-card form .fms-btn {
    width: auto;
    min-width: 180px;
}

/* ========================================
   MOBILE RESPONSIVE
======================================== */

@media (max-width: 768px) {
    .fms-programs-page {
        padding: 15px 10px 30px;
        gap: 20px;
    }

    .fms-card {
        padding: 20px 16px;
    }

    .fms-card h2 {
        font-size: 19px;
    }

    .fms-form-group input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .fms-btn {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
        font-size: 14px;
    }

    .fms-btn-cancel {
        margin-left: 0;
        margin-top: 10px;
    }

    .fms-table th,
    .fms-table td {
        padding: 12px 10px;
        font-size: 12px;
    }

    .fms-table td:last-child {
        flex-direction: column;
        gap: 6px;
    }

    .fms-edit-btn,
    .fms-delete-btn {
        width: 100%;
        justify-content: center;
        padding: 8px 10px;
        font-size: 12px;
    }

    .fms-table td:first-child {
        width: 40px;
    }
}

/* ========================================
   PRINT STYLES
======================================== */

@media print {
    .fms-programs-page {
        max-width: 100%;
        padding: 10px;
    }

    .fms-card {
        box-shadow: none;
        border: 1px solid #ccc;
        break-inside: avoid;
    }

    .fms-btn,
    .fms-edit-btn,
    .fms-delete-btn {
        background: #e2e8f0 !important;
        color: #000 !important;
        box-shadow: none !important;
    }

    .fms-form-group input {
        border: 1px solid #999;
        background: #fff;
    }
}