/* Supplier Company Profile Management - Mobile Optimized */
:root {
    --primary: #0B4F6C;
    --primary-dark: #083b4f;
    --primary-light: #1a6b8a;
    --secondary: #10B981;
    --accent: #F59E0B;
    --danger: #EF4444;
    --warning: #F59E0B;
    --dark: #1F2937;
    --gray-800: #1F2937;
    --gray-700: #374151;
    --gray-600: #4B5563;
    --gray-500: #6B7280;
    --gray-400: #9CA3AF;
    --gray-300: #D1D5DB;
    --gray-200: #E5E7EB;
    --gray-100: #F3F4F6;
    --white: #FFFFFF;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-xl: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--gray-100);
    color: var(--dark);
    line-height: 1.5;
}

/* Dashboard Container */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--gray-200);
}

.sidebar-header h2 {
    color: var(--primary);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.sidebar-header p {
    color: var(--gray-500);
    font-size: 13px;
}

.sidebar-nav {
    padding: 16px 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--gray-600);
    text-decoration: none;
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.nav-item i {
    width: 20px;
    font-size: 16px;
}

hr {
    margin: 16px 0;
    border: none;
    border-top: 1px solid var(--gray-200);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 24px;
    max-width: calc(100vw - 280px);
}

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background: var(--white);
    padding: 20px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.header-title h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 4px;
}

.header-title p {
    color: var(--gray-500);
    font-size: 14px;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: white;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
    background: var(--gray-100);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

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

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--gray-200);
    background: var(--white);
    color: var(--gray-600);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-icon.btn-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

/* Section Cards */
.section-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.section-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-card h3 i {
    color: var(--primary);
}

.section-card h4 {
    font-size: 16px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 12px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.card-header h3, .card-header h4 {
    margin-bottom: 0;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--gray-700);
}

.form-group .required {
    color: var(--danger);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(11, 79, 108, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group input[type="number"] {
    -moz-appearance: textfield;
}

.form-group input[type="number"]::-webkit-outer-spin-button,
.form-group input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* Image Upload */
.image-upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 16px;
    background: var(--gray-50);
}

.image-upload-area:hover {
    border-color: var(--primary);
    background: var(--gray-100);
}

.image-upload-area i {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 8px;
}

.image-upload-area p {
    color: var(--gray-700);
    margin-bottom: 4px;
}

.image-upload-area p span {
    color: var(--primary);
    font-weight: 600;
}

.image-upload-area small {
    color: var(--gray-500);
    font-size: 11px;
}

.upload-preview {
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.upload-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

/* Certification Items */
.certifications-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.certification-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
}

.certification-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.certification-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
}

.certification-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.certification-info {
    flex: 1;
}

.certification-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--dark);
    margin-bottom: 4px;
}

.certification-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--gray-500);
}

.certification-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Timeline Items */
.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.timeline-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-200);
    position: relative;
}

.timeline-year {
    font-weight: 700;
    color: var(--primary);
    min-width: 70px;
    font-size: 16px;
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--dark);
    margin-bottom: 4px;
}

.timeline-description {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.5;
}

.timeline-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* Checkbox */
.form-check {
    margin: 16px 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideUp 0.3s ease;
}

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

.modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-500);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--gray-100);
    color: var(--danger);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    background: white;
}

/* Certification Modal */
.certification-image-preview {
    margin: 16px 0;
    text-align: center;
}

.certification-image-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

/* Delete Modal */
.delete-icon {
    text-align: center;
    margin-bottom: 20px;
}

.delete-icon i {
    font-size: 48px;
    color: var(--danger);
}

.delete-message {
    text-align: center;
    font-size: 16px;
    margin-bottom: 8px;
}

.delete-warning {
    text-align: center;
    font-size: 13px;
    color: var(--danger);
    margin-bottom: 20px;
}

/* Success Modal */
.modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.modal-icon.success {
    background: #E7F5E8;
    color: var(--secondary);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 14px 24px;
    border-radius: 30px;
    font-size: 14px;
    z-index: 3000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s;
    max-width: 400px;
    box-shadow: var(--shadow-xl);
}

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

.toast.success {
    background: var(--secondary);
}

.toast.error {
    background: var(--danger);
}

.toast.info {
    background: var(--primary);
}

.toast.warning {
    background: var(--accent);
    color: var(--dark);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-state {
    text-align: center;
    padding: 40px;
    color: var(--gray-500);
}

/* Text Utilities */
.text-muted {
    color: var(--gray-500);
    font-size: 14px;
    padding: 20px;
    text-align: center;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
}

/* Responsive - Mobile First */
@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-left: 240px;
        max-width: calc(100vw - 240px);
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid var(--gray-200);
    }
    
    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 12px;
        gap: 4px;
        -webkit-overflow-scrolling: touch;
    }
    
    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }
    
    .sidebar-nav .nav-item {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 16px;
    }
    
    .content-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .header-actions {
        width: 100%;
    }
    
    .header-actions .btn {
        flex: 1;
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .certification-item {
        flex-wrap: wrap;
    }
    
    .certification-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .timeline-item {
        flex-wrap: wrap;
    }
    
    .timeline-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .toast {
        left: 16px;
        right: 16px;
        max-width: none;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .section-card {
        padding: 16px;
    }
    
    .certification-meta {
        flex-direction: column;
        gap: 4px;
    }
    
    .certification-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .timeline-year {
        min-width: 60px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .btn-icon {
        width: 36px;
        height: 36px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}

/* Print Styles */
@media print {
    .sidebar,
    .header-actions,
    .btn,
    .modal-close {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        max-width: 100%;
    }
    
    .section-card {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #000;
        box-shadow: none;
    }
}

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in-right {
    animation: slideInRight 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* Helper Classes */
.text-success { color: var(--secondary); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--accent); }
.text-primary { color: var(--primary); }

.bg-success-light { background: #E7F5E8; }
.bg-danger-light { background: #FEE2E2; }
.bg-warning-light { background: #FEF3C7; }
.bg-primary-light { background: #EFF6FF; }

.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }

.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: var(--radius-sm); }

.shadow { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.border { border: 1px solid var(--gray-200); }
.border-top { border-top: 1px solid var(--gray-200); }
.border-bottom { border-bottom: 1px solid var(--gray-200); }