/* Professional Compact Backend Theme - Microfixx Technologies */

:root {
    --primary: #1a365d;
    --primary-light: #2d3748;
    --secondary: #3182ce;
    --accent: #0ea5e9;
    --success: #16a34a;
    --warning: #ea580c;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
    --white: #ffffff;
    --radius: 6px;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    font-size: 14px;
}

/* Compact Layout */
.backend-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* Professional Header */
.backend-header {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.header-content {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-subtitle {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 2px;
    font-weight: 400;
}

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

/* Compact Cards */
.backend-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background: var(--primary);
    color: var(--white);
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 16px;
}

/* Compact Forms */
.form-group {
    margin-bottom: 16px;
}

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

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--white);
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgb(59 130 246 / 0.1);
}

.input-group {
    display: flex;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    overflow: hidden;
}

.input-group-text {
    background: var(--gray-100);
    border: none;
    padding: 8px 12px;
    color: var(--gray-600);
    font-size: 14px;
    display: flex;
    align-items: center;
}

.input-group .form-control {
    border: none;
    border-radius: 0;
}

/* Professional Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1.4;
}

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

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

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

.btn-success:hover {
    background: #15803d;
    border-color: #15803d;
}

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

.btn-warning:hover {
    background: #c2410c;
    border-color: #c2410c;
}

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

.btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.btn-outline {
    background: transparent;
    color: var(--secondary);
    border-color: var(--secondary);
}

.btn-outline:hover {
    background: var(--secondary);
    color: var(--white);
}

.btn-lg {
    padding: 10px 20px;
    font-size: 15px;
}

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

/* Clean Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.alert-warning {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

/* Compact Sidebar */
.sidebar {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.sidebar-header {
    background: var(--primary);
    color: var(--white);
    padding: 16px;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

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

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: var(--gray-700);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-nav-link:hover,
.sidebar-nav-link.active {
    background: var(--secondary);
    color: var(--white);
}

/* Clean Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 14px;
}

.table th {
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--gray-200);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
}

.table tr:hover {
    background: var(--gray-50);
}

/* Professional Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-online {
    background: #dcfce7;
    color: var(--success);
}

.status-offline {
    background: #fee2e2;
    color: var(--danger);
}

.status-pending {
    background: #fff7ed;
    color: var(--warning);
}

/* Grid Systems */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }

/* Icons */
.icon {
    width: 1.1em;
    height: 1.1em;
    display: inline-block;
}

/* Responsive */
@media (max-width: 768px) {
    .backend-container {
        padding: 12px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Loading state */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    border-right-color: var(--secondary);
    animation: spin 1s linear infinite;
}

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