/* Kenno Business App - Core Styles */

:root {
    --color-cream: #F4EEE5;
    --color-green-dark: #1a5c3e;
    --color-green-light: #2d8659;
    --color-navy: #1e3a5f;
    --color-navy-dark: #0f2744;
    --color-navy-light: #2d4a6f;
    --color-border: #e0d5c7;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;
    --sidebar-width: 260px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f8fafc;
    color: #1a1a1a;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== STATUS BANNERS ===== */
.status-banner {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 14px;
    font-weight: 500;
}

.status-banner i {
    font-size: 18px;
    margin-right: 8px;
}

.status-banner--warning {
    background: linear-gradient(90deg, #fef3c7, #fde68a);
    color: #92400e;
    border-bottom: 1px solid #fcd34d;
}

.status-banner--error {
    background: linear-gradient(90deg, #fee2e2, #fecaca);
    color: #991b1b;
    border-bottom: 1px solid #fca5a5;
}

.status-banner--info {
    background: linear-gradient(90deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border-bottom: 1px solid #93c5fd;
}

.status-banner--success {
    background: linear-gradient(90deg, #d1fae5, #a7f3d0);
    color: #065f46;
    border-bottom: 1px solid #6ee7b7;
}

.status-banner__content {
    display: flex;
    align-items: center;
}

.status-banner__action {
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.status-banner--warning .status-banner__action {
    background: #92400e;
    color: white;
}

.status-banner--error .status-banner__action {
    background: #991b1b;
    color: white;
}

/* ===== APP LAYOUT ===== */
.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-layout {
    display: flex;
    flex: 1;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid #e5e7eb;
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 60;
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: #374151;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sidebar-toggle:hover {
    background: #f3f4f6;
    color: var(--color-navy);
}

.sidebar:not(.collapsed) ~ .sidebar-toggle {
    left: calc(var(--sidebar-width) + 16px);
}

.sidebar:not(.collapsed) ~ .sidebar-toggle .toggle-open {
    display: none;
}

.sidebar:not(.collapsed) ~ .sidebar-toggle .toggle-close {
    display: block;
}

.sidebar.collapsed ~ .sidebar-toggle .toggle-open {
    display: block;
}

.sidebar.collapsed ~ .sidebar-toggle .toggle-close {
    display: none;
}

/* Sidebar Overlay for Mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
}

.sidebar-overlay.active {
    display: block;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

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

.sidebar-logo .logo-icon-sloth {
    width: 36px;
    height: 36px;
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.sidebar-logo-text span:first-child {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 800;
    color: #1a1a1a;
}

.sidebar-logo-text span:last-child {
    font-size: 10px;
    font-weight: 600;
    color: var(--color-navy);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: #4b5563;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar-link:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.sidebar-link.active {
    background: linear-gradient(135deg, rgba(26, 92, 62, 0.1), rgba(45, 134, 89, 0.05));
    color: var(--color-green-dark);
}

.sidebar-link i {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.sidebar-link.disabled {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.sidebar-lock {
    margin-left: auto;
    font-size: 14px;
    color: #9ca3af;
}

.sidebar-link .badge,
.sidebar-badge {
    margin-left: auto;
    background: var(--color-error);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
}

.sidebar-org {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.sidebar-org:hover {
    background: #f3f4f6;
}

.sidebar-org-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-navy), var(--color-navy-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.sidebar-org-info {
    flex: 1;
    min-width: 0;
}

.sidebar-org-name {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-org-status {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sidebar-org-status.active {
    color: var(--color-success);
}

.sidebar-org-status.pending {
    color: var(--color-warning);
}

.sidebar-org-status.inactive {
    color: var(--color-error);
}

.sidebar-org-status i {
    font-size: 14px;
}

.sidebar-org-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-org-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-footer {
    position: relative;
}

.sidebar-org-dropdown {
    position: absolute;
    bottom: 100%;
    left: 12px;
    right: 12px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px;
    margin-bottom: 8px;
    display: none;
    z-index: 100;
}

.sidebar-org-dropdown.open {
    display: block;
}

.sidebar-org-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
}

.sidebar-org-dropdown-item:hover {
    background: #f3f4f6;
}

.sidebar-org-dropdown-item i {
    font-size: 18px;
    color: #6b7280;
}

.sidebar-org-dropdown-item.logout {
    color: var(--color-error);
}

.sidebar-org-dropdown-item.logout i {
    color: var(--color-error);
}

.sidebar-org-dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 8px 0;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
    max-width: calc(100% - var(--sidebar-width));
    overflow-x: hidden;
    min-width: 0;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 0;
    max-width: 100%;
}

.main-header {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.main-header-left {
    min-width: 0;
    flex: 1;
}

.main-header-left h1 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.main-header-left p {
    font-size: 14px;
    color: #6b7280;
    margin-top: 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.main-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.notification-btn {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc2626;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.main-body {
    flex: 1;
    padding: 32px;
    overflow-x: hidden;
    max-width: 100%;
    min-width: 0;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title i {
    color: var(--color-green-dark);
}

.card-body {
    padding: 24px;
}

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

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

.btn-primary:hover {
    background: var(--color-navy-dark);
    transform: translateY(-1px);
}

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

.btn-success:hover {
    background: #059669;
}

.btn-outline {
    background: white;
    border: 2px solid #e5e7eb;
    color: #374151;
}

.btn-outline:hover {
    border-color: var(--color-navy);
    color: var(--color-navy);
}

.btn-ghost {
    background: transparent;
    color: #6b7280;
}

.btn-ghost:hover {
    background: #f3f4f6;
    color: #1f2937;
}

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

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.form-label .required {
    color: var(--color-error);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 15px;
    color: #1f2937;
    transition: all 0.2s;
    background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-navy);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-input::placeholder {
    color: #9ca3af;
}

.form-hint {
    font-size: 13px;
    color: #6b7280;
    margin-top: 6px;
}

.form-error {
    font-size: 13px;
    color: var(--color-error);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* ===== CHECKLIST ===== */
.checklist {
    list-style: none;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.2s;
}

.checklist-item:last-child {
    border-bottom: none;
}

.checklist-item:hover {
    background: #f9fafb;
}

.checklist-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.checklist-icon.completed {
    background: var(--color-success);
    color: white;
}

.checklist-icon.pending {
    background: #e5e7eb;
    color: #9ca3af;
}

.checklist-icon.current {
    background: var(--color-navy);
    color: white;
}

.checklist-icon i {
    font-size: 16px;
}

.checklist-content {
    flex: 1;
}

.checklist-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.checklist-desc {
    font-size: 13px;
    color: #6b7280;
}

.checklist-action {
    margin-left: auto;
}

/* ===== STEPS INDICATOR ===== */
.steps-indicator {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
}

.step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e5e7eb;
    transition: all 0.3s;
}

.step-dot.active {
    background: var(--color-navy);
    transform: scale(1.2);
}

.step-dot.completed {
    background: var(--color-success);
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-green-dark), var(--color-green-light));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ===== TABLES ===== */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.table th {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    background: #f9fafb;
}

.table td {
    font-size: 14px;
    color: #374151;
}

.table tbody tr:hover {
    background: #f9fafb;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

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

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

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

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

.badge-gray {
    background: #f3f4f6;
    color: #4b5563;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state-icon i {
    font-size: 36px;
    color: #9ca3af;
}

.empty-state h3 {
    font-size: 18px;
    color: #1f2937;
    margin-bottom: 8px;
}

.empty-state p {
    color: #6b7280;
    margin-bottom: 24px;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.open {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.25s ease-out;
}

.modal-lg {
    max-width: 700px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0 !important;
        max-width: 100% !important;
    }

    .sidebar-toggle {
        left: 16px !important;
    }

    .sidebar.open ~ .sidebar-toggle {
        left: calc(var(--sidebar-width) + 16px) !important;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .main-header {
        padding: 16px 24px;
    }

    .main-body {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .main-header {
        padding: 16px 20px;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .main-header-left {
        text-align: left;
    }

    .main-header-left h1 {
        font-size: 20px;
    }

    .main-header-actions {
        justify-content: flex-start;
    }

    .main-body {
        padding: 16px;
    }

    .status-banner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .main-header {
        padding: 12px 16px;
    }

    .main-header-left h1 {
        font-size: 18px;
    }

    .main-header-left p {
        font-size: 13px;
    }

    .main-body {
        padding: 12px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }

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