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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #0a1929;
    min-height: 100vh;
    color: #e2e8f0;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
}

/* Main Wrapper - para trabajar con el sidebar */
.main-wrapper {
    margin-left: 280px;
    padding: 20px;
    min-height: 100vh;
    width: calc(100% - 280px);
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
    box-sizing: border-box;
}

/* API Docs Section */
.api-docs {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.api-title {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.endpoint {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    border-left: 4px solid #3b82f6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.endpoint-method {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 10px;
}

.method-post {
    background: #10b981;
    color: #fff;
}

.method-get {
    background: #3b82f6;
    color: #fff;
}

.endpoint-path {
    color: #60a5fa;
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
}

.endpoint-desc {
    color: #cbd5e1;
    margin: 12px 0;
    font-size: 14px;
}

.code-example {
    background: #0f172a;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
}

.code-example code {
    color: #10b981;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Responsive para el main wrapper */
@media (max-width: 768px) {
    .main-wrapper {
        margin-left: 0;
        padding: 10px;
        width: 100%;
    }
    
    .api-docs {
        padding: 10px;
    }
}

.dashboard {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.header {
    background: linear-gradient(135deg, #073f68, #0a1929);
    padding: 40px 30px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(7, 63, 104, .6);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/images/Drago%20Whatsap.png') left center no-repeat, url('/images/Logo%20sdrimsac%20(2).png') right center no-repeat;
    background-size: 180px auto, 180px auto;
    opacity: 0.15;
    pointer-events: none
}

.header-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px
}

.header-logos {
    display: flex;
    align-items: center;
    gap: 30px;
    flex: 1
}

.logo-img {
    height: 80px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(255, 255, 255, .3))
}

.header-title {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    text-align: center
}

.header-title h1 {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .3)
}

.header-title p {
    color: #94e9ff;
    font-size: 15px;
    font-weight: 500;
    margin: 0
}

.status-badge {
    padding: 10px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .3)
}

.status-badge.connected {
    background: #10b981;
    color: #fff;
    border: 2px solid #34d399;
    animation: pulse 2s infinite
}

.status-badge.disconnected {
    background: #ef4444;
    color: #fff;
    border: 2px solid #f87171
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .7
    }
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px
}

.card {
    background: linear-gradient(135deg, #1e293b, #0f1e2e);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
    border: 1px solid #073f68;
    transition: all .3s
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(7, 63, 104, .4);
    border-color: #0a5a99
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px
}

.card-icon.blue {
    background: linear-gradient(135deg, #073f68, #0a5a99);
    box-shadow: 0 4px 12px rgba(7, 63, 104, .5)
}

.card-icon.green {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 12px rgba(16, 185, 129, .5)
}

.card-icon.purple {
    background: linear-gradient(135deg, #073f68, #3b82f6);
    box-shadow: 0 4px 12px rgba(59, 130, 246, .5)
}

.card-icon.orange {
    background: linear-gradient(135deg, #0a5a99, #3b82f6);
    box-shadow: 0 4px 12px rgba(10, 90, 153, .5)
}

.card-title {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px
}

.card-value {
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    margin-top: 8px
}

.card-subtitle {
    color: #64748b;
    font-size: 12px;
    margin-top: 8px
}

.qr-section {
    background: linear-gradient(135deg, #1e293b, #0f1e2e);
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid #073f68;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(7, 63, 104, .3)
}

.qr-container {
    display: inline-block;
    padding: 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .3);
    margin: 20px 0
}

.qr-container img {
    display: block;
    width: 280px;
    height: 280px;
    border-radius: 8px
}

.qr-instructions {
    color: #94a3b8;
    font-size: 14px;
    line-height: 1.6;
    max-width: 480px;
    margin: 20px auto
}

.api-docs {
    background: linear-gradient(135deg, #1e293b, #0f1e2e);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #073f68;
    box-shadow: 0 4px 16px rgba(7, 63, 104, .3)
}

.api-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px
}

.endpoint {
    background: #0f172a;
    padding: 18px;
    border-radius: 8px;
    margin-bottom: 14px;
    border-left: 4px solid #073f68;
    transition: transform .2s
}

.endpoint:hover {
    transform: translateX(4px)
}

.endpoint-method {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 11px;
    margin-right: 10px
}

.method-post {
    background: #3b82f6;
    color: #fff
}

.method-get {
    background: #10b981;
    color: #fff
}

.endpoint-path {
    font-family: 'Courier New', monospace;
    color: #073f68;
    font-size: 13px;
    font-weight: 600
}

.endpoint-desc {
    color: #94a3b8;
    font-size: 12px;
    margin-top: 8px
}

.code-example {
    background: #0f172a;
    padding: 14px;
    border-radius: 6px;
    margin-top: 10px;
    overflow-x: auto
}

.code-example code {
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.5;
    white-space: pre
}

.btn {
    background: linear-gradient(135deg, #073f68, #051f36);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: transform .2s;
    display: inline-flex;
    align-items: center;
    gap: 8px
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(7, 63, 104, .5)
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    margin-left: 10px
}

.btn-danger:hover {
    box-shadow: 0 8px 20px rgba(239, 68, 68, .4)
}

.btn-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px
}

.success-message {
    background: rgba(16, 185, 129, .1);
    border: 1px solid #10b981;
    color: #10b981;
    padding: 16px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, .3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite
}

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

.form-section {
    background: linear-gradient(135deg, #1e293b, #0f1e2e);
    padding: 30px;
    border-radius: 12px;
    border: 1px solid #073f68;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(7, 63, 104, .3)
}

.form-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px
}

.form-group {
    margin-bottom: 20px
}

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

.form-input,
.form-textarea,
.form-file {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 2px solid #334155;
    background: #0a1929;
    color: #e2e8f0;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    transition: all .3s
}

.form-input:focus,
.form-textarea:focus,
.form-file:focus {
    outline: none;
    border-color: #073f68;
    box-shadow: 0 0 0 3px rgba(7, 63, 104, .2)
}

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

.form-file {
    padding: 10px;
    cursor: pointer
}

.form-submit {
    width: 100%;
    background: linear-gradient(135deg, #073f68, #051f36);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .2s
}

.form-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(7, 63, 104, .5)
}

.form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none
}

.alert {
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none
}

.alert.show {
    display: block
}

.alert-success {
    background: rgba(16, 185, 129, .1);
    border: 1px solid #10b981;
    color: #10b981
}

.alert-error {
    background: rgba(239, 68, 68, .1);
    border: 1px solid #ef4444;
    color: #ef4444
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #334155
}

.tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all .2s
}

.tab:hover {
    color: #e2e8f0
}

.tab.active {
    color: #3b9eff;
    border-bottom-color: #073f68;
    background: rgba(7, 63, 104, .1)
}

.tab-content {
    display: none
}

.tab-content.active {
    display: block
}

@media (max-width:768px) {
    .header {
        padding: 30px 20px
    }

    .header::before {
        background-size: 120px auto, 120px auto;
        opacity: 0.1
    }

    .header-content {
        flex-direction: column;
        text-align: center
    }

    .header-logos {
        flex-direction: column;
        gap: 20px
    }

    .logo-img {
        height: 60px
    }

    .header-title h1 {
        font-size: 24px
    }

    .qr-container img {
        width: 240px;
        height: 240px
    }

    .grid {
        grid-template-columns: 1fr
    }
}

/* Layout principal con sidebar */
body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.layout-container {
    display: flex;
    min-height: 100vh;
}

.main-wrapper {
    margin-left: 280px;
    flex: 1;
    display: flex;
    flex-direction: column;
    width: calc(100% - 280px);
}

.dashboard {
    flex: 1;
    padding: 20px;
}

/* Ajustes responsivos */
@media (max-width: 768px) {
    .main-wrapper {
        margin-left: 0;
        width: 100%;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

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