/* TCMS Frontend Styles */
.tcms-portal-container {
    max-width: 1200px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #1e293b;
}

/* Header */
.tcms-portal-header {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}
.tcms-header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}
.tcms-center-avatar {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: #2563eb;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
}
.tcms-header-info h2 {
    margin: 0 0 4px 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}
.tcms-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tcms-welcome-user {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

/* Navigation Tabs */
.tcms-nav-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.tcms-nav-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -6px;
    white-space: nowrap;
}
.tcms-nav-tab:hover {
    color: #2563eb;
    background: #f8fafc;
}
.tcms-nav-tab.active {
    color: #2563eb;
    border-bottom: 2px solid #2563eb;
    background: #ffffff;
}
.tcms-tab-badge {
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 9999px;
    font-weight: bold;
}

/* Stats Cards */
.tcms-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.tcms-stat-card {
    padding: 20px;
    border-radius: 12px;
    color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}
.tcms-card-blue { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); }
.tcms-card-indigo { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); }
.tcms-card-amber { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.tcms-card-emerald { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.tcms-stat-number {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}
.tcms-stat-label {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.9;
}

/* Card */
.tcms-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 24px;
}
.tcms-card-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}
.tcms-card-header h3 {
    margin: 0 0 4px 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}
.tcms-card-header p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}
.tcms-flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tcms-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
@media(max-width: 768px) {
    .tcms-grid-2 { grid-template-columns: 1fr; }
}

/* Forms */
.tcms-form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
}
.tcms-col-2 { flex: 1 1 calc(16.666% - 16px); min-width: 140px; }
.tcms-col-4 { flex: 1 1 calc(33.333% - 16px); min-width: 200px; }
.tcms-col-6 { flex: 1 1 calc(50% - 16px); min-width: 240px; }
.tcms-form-group {
    margin-bottom: 16px;
}
.tcms-form-group label, .tcms-form-row label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}
.tcms-form-control {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    color: #0f172a;
    background-color: #ffffff;
    box-sizing: border-box;
}
.tcms-form-control:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.tcms-form-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e3a8a;
    margin: 20px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}
.tcms-form-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

/* Tables */
.tcms-table-responsive {
    overflow-x: auto;
}
.tcms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}
.tcms-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 12px 14px;
    border-bottom: 2px solid #e2e8f0;
}
.tcms-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.tcms-table tr:hover {
    background-color: #f8fafc;
}
.tcms-student-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}
.tcms-avatar-img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}
.tcms-avatar-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

/* Badges */
.tcms-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
}
.tcms-badge-info { background: #dbeafe; color: #1e40af; }
.tcms-badge-success { background: #dcfce7; color: #166534; }
.tcms-badge-warning { background: #fef3c7; color: #92400e; }
.tcms-badge-danger { background: #fee2e2; color: #991b1b; }
.tcms-badge-purple { background: #f3e8ff; color: #6b21a8; }
.tcms-badge-secondary { background: #f1f5f9; color: #475569; }
.tcms-code-badge {
    display: inline-block;
    font-family: monospace;
    background: #f1f5f9;
    color: #334155;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* Buttons */
.tcms-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.15s ease;
}
.tcms-btn-primary { background: #2563eb; color: #ffffff; }
.tcms-btn-primary:hover { background: #1d4ed8; color: #ffffff; }
.tcms-btn-danger { background: #dc2626; color: #ffffff; }
.tcms-btn-danger:hover { background: #b91c1c; color: #ffffff; }
.tcms-btn-warning { background: #d97706; color: #ffffff; }
.tcms-btn-warning:hover { background: #b45309; color: #ffffff; }
.tcms-btn-purple { background: #7c3aed; color: #ffffff; }
.tcms-btn-purple:hover { background: #6d28d9; color: #ffffff; }
.tcms-btn-success { background: #16a34a; color: #ffffff; }
.tcms-btn-success:hover { background: #15803d; color: #ffffff; }
.tcms-btn-outline { background: #ffffff; border-color: #cbd5e1; color: #334155; }
.tcms-btn-outline:hover { background: #f8fafc; border-color: #94a3b8; }
.tcms-btn-link { background: none; color: #2563eb; text-decoration: underline; padding: 6px 10px; }
.tcms-btn-sm { padding: 6px 12px; font-size: 12px; }
.tcms-btn-xs { padding: 4px 8px; font-size: 11px; }
.tcms-btn-lg { padding: 12px 24px; font-size: 16px; }
.tcms-btn-block { width: 100%; }
.tcms-btn-group { display: flex; gap: 4px; flex-wrap: wrap; }

/* Filter Bar */
.tcms-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
    align-items: center;
}
.tcms-filter-item {
    flex: 1;
    min-width: 180px;
}

/* Workflow Stepper */
.tcms-workflow-stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 24px;
}
.tcms-step-box {
    text-align: center;
    flex: 1;
}
.tcms-step-num {
    display: inline-flex;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2563eb;
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}
.tcms-step-box strong {
    display: block;
    font-size: 13px;
    color: #0f172a;
}
.tcms-step-box p {
    margin: 2px 0 0 0;
    font-size: 11px;
    color: #64748b;
}
.tcms-step-arrow {
    font-size: 18px;
    color: #94a3b8;
    font-weight: bold;
    padding: 0 10px;
}

/* Alerts */
.tcms-alert {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 20px;
}
.tcms-alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.tcms-alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; }
.tcms-alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #b45309; }
.tcms-alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }

/* Modals */
.tcms-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tcms-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
}
.tcms-modal-dialog {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 500px;
}
.tcms-modal-content {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2);
    overflow: hidden;
}
.tcms-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.tcms-modal-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}
.tcms-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
}
.tcms-modal-body {
    padding: 20px;
}
.tcms-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

/* Login Panel */
.tcms-login-wrapper {
    max-width: 440px;
    margin: 40px auto;
}
.tcms-login-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05);
}
.tcms-login-header {
    text-align: center;
    margin-bottom: 24px;
}
.tcms-login-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
}
.tcms-login-header h2 {
    margin: 0 0 6px 0;
    font-size: 22px;
    color: #0f172a;
}
.tcms-login-header p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
}
.tcms-form-check {
    margin: 14px 0 20px 0;
}

/* Certificate Verification Component */
.tcms-verify-container {
    max-width: 750px;
    margin: 30px auto;
    font-family: inherit;
}
.tcms-verify-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}
.tcms-verify-header {
    text-align: center;
    margin-bottom: 28px;
}
.tcms-verify-icon {
    width: 72px;
    height: 72px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px auto;
}
.tcms-verify-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
}
.tcms-verify-input-group {
    display: flex;
    gap: 10px;
}
.tcms-verify-input {
    font-size: 16px;
    padding: 12px 16px;
}
.tcms-verify-btn {
    white-space: nowrap;
    padding: 12px 24px;
}
.tcms-verify-result {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}
.tcms-verify-badge-box {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}
.tcms-verify-status-icon {
    font-size: 32px;
    font-weight: bold;
}
.tcms-verify-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}
.tcms-verify-table th {
    width: 35%;
    padding: 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    color: #475569;
    font-size: 14px;
}
.tcms-verify-table td {
    padding: 10px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 14px;
    color: #0f172a;
}
.tcms-text-center { text-align: center; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.text-success { color: #16a34a !important; }
.text-danger { color: #dc2626 !important; }
.text-warning { color: #d97706 !important; }
.text-muted { color: #64748b !important; }

/* Login Tabs */
.tcms-login-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 20px;
    gap: 4px;
}
.tcms-login-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}
.tcms-login-tab-btn:hover {
    color: #0f172a;
}
.tcms-login-tab-btn.active {
    background: #ffffff;
    color: #2563eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
