/**
 * NZABOGADOS Sidebar Layout
 * CSS for sidebar + main content layout
 */

/* Reset default margins and paddings */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* App Container - Flexbox layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    background-color: var(--bg-light);
    position: relative;
    margin: 0;
    padding: 0;
    gap: 0;
}

/* Sidebar - Fixed width on the left */
.sidebar {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    background-color: #ffffff;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    padding: 0;
    margin: 0;
}

/* Sidebar scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Main Content - Takes remaining space */
.main-content {
    flex: 1;
    margin-left: 280px; /* Same as sidebar width */
    width: calc(100% - 280px);
    min-height: 100vh;
    background-color: var(--bg-light);
    padding: 0;
    margin-top: 0;
    margin-right: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

/* Top bar styling */
.top-bar {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 30px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 14px;
}

/* Page content */
.page-content {
    padding: 0;
    flex: 1;
    background-color: #ffffff;
}

.page-header {
    margin-bottom: 0;
    padding: 20px 30px;
    background-color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.page-header > div:first-child {
    flex: 1;
}

.page-header h2 {
    margin: 0 0 5px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.page-header p {
    margin: 0;
    color: #999;
    font-size: 13px;
    font-weight: 400;
}

/* Table container */
.table-container {
    background-color: #ffffff;
    border-radius: 0;
    box-shadow: none;
    border: none;
    border-top: 1px solid #e5e5e5;
    overflow: hidden;
    margin: 0;
}

/* Data table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #ffffff;
}

.data-table thead {
    background-color: #fafafa;
    border-bottom: 1px solid #e5e5e5;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #e5e5e5;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    color: #333;
    vertical-align: middle;
}

.data-table tbody tr {
    background-color: #ffffff;
    transition: background-color 0.15s ease;
}

.data-table tbody tr:hover {
    background-color: #fafafa;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Loading/Empty/Error states */
.loading, .empty, .error {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 13px;
}

.error {
    color: #dc3545;
}

/* Badges - Status indicators */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 12px;
    text-transform: capitalize;
}

.badge-success {
    background-color: #d4edda;
    color: #155724;
}

.badge-warning {
    background-color: #fff3cd;
    color: #856404;
}

.badge-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.badge-secondary {
    background-color: #e2e3e5;
    color: #383d41;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    color: #666;
    transition: color 0.2s ease;
}

.btn-icon:hover {
    color: #333;
}

/* Ensure sidebar container doesn't interfere */
#sidebar-container {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

/* Buttons */
.btn-primary {
    background-color: #2D5F3F;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: #1f4a2d;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background-color: #e8e8e8;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.modal-close:hover {
    background-color: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

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

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

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2D5F3F;
}

.form-group input::placeholder {
    color: #999;
}

/* Responsive: Hide sidebar on mobile */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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

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

    .page-content {
        padding: 15px;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

