/* ==========================================
   INTERNAL AUDIT MANAGEMENT SYSTEM - STYLES
   ========================================== */

/* === BASE STYLES === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* === LAYOUT === */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.content {
    padding: 30px;
}

/* === HEADER === */
.header {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

.org-info {
    font-size: 0.9em;
    opacity: 0.9;
    margin-top: 10px;
}

/* === TABS === */
.tabs {
    display: flex;
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
}

.tab {
    flex: 1;
    padding: 15px 20px;
    text-align: center;
    cursor: pointer;
    background: transparent;
    border: none;
    font-size: 1em;
    font-weight: 600;
    color: #4a5568;
    transition: all 0.3s;
}

.tab:hover {
    background: #edf2f7;
}

.tab.active {
    background: white;
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

/* === TAB CONTENT === */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

/* === CARDS === */
.card {
    background: #f7fafc;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.card h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* === FORMS === */
.form-group {
    margin-bottom: 20px;
}

/* Grid wrapper for two-column layout on larger screens */
.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* Tablet and up: two columns */
@media (min-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

label {
    display: block;
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: 600;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1em;
    transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* === BUTTONS === */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-right: 10px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
    transform: translateY(-2px);
}

/* Process buttons used in Checklists tab */
.process-btn {
    background: #edf2f7;
    color: #2d3748;
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.process-btn:hover {
    background: #e6eef9;
}

.process-btn-selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
    box-shadow: 0 6px 18px rgba(102,126,234,0.18);
}

.btn-danger {
    background: #f56565;
    color: white;
}

.btn-danger:hover {
    background: #e53e3e;
}

/* === PROCESS LIST === */
.process-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.process-item {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.process-item:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.process-item.selected {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* === CHECKLIST TABLE === */
.checklist-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.checklist-table th,
.checklist-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.checklist-table th {
    background: #2d3748;
    color: white;
    font-weight: 600;
}

.checklist-table tr:hover {
    background: #f7fafc;
}

/* === AUDIT CHECKLIST TABLE === */
.audit-checklist-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.audit-checklist-table th,
.audit-checklist-table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #e2e8f0;
}

.audit-checklist-table th {
    background: #2d3748;
    color: white;
    font-weight: 600;
    text-align: center;
}

.audit-checklist-table tbody tr:hover {
    background: #f7fafc;
}

.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

/* Table Input Styles */
.table-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.95em;
}

.table-input:focus {
    outline: none;
    border-color: #667eea;
}

.table-textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: inherit;
    resize: vertical;
}

.table-textarea:focus {
    outline: none;
    border-color: #667eea;
}

.btn-small {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

input[type="radio"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.evaluation-header {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 1.1em;
}

.evaluation-options {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 100%;
}

.evaluation-options label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    cursor: pointer;
}

.evaluation-options label span {
    font-size: 1.2em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6em;
}

.evaluation-options label input[type="radio"] {
    margin: 0;
}

.evaluation-options label span {
    font-size: 1.1em;
}

/* === CHECKLIST ITEMS === */
.checklist-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.checklist-item.editing {
    border-color: #667eea;
    background: #ebf4ff;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.checklist-item-content {
    flex: 1;
}

.checklist-item-actions {
    display: flex;
    gap: 10px;
}

/* === ALERTS === */
.alert {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #48bb78;
}

.alert-info {
    background: #bee3f8;
    color: #2c5282;
    border-left: 4px solid #4299e1;
}
