/* Sistema de Firmas Digitales - Diseño Minimalista */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #059669;
    --danger: #dc2626;
    --warning: #d97706;
    --dark: #111827;
    --gray-900: #1f2937;
    --gray-700: #374151;
    --gray-500: #6b7280;
    --gray-300: #d1d5db;
    --gray-100: #f3f4f6;
    --white: #ffffff;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.5;
}

.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 24px 16px;
    min-height: 100vh;
}

.screen {
    display: none;
    animation: fadeIn 0.2s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Header minimalista */
.header {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    text-align: center;
    border-left: 4px solid var(--primary);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.header p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.header-badge {
    display: none;
}

.admin-header {
    border-left-color: var(--gray-700);
}

/* Cards */
.glass-card,
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    border: 1px solid var(--gray-300);
}

.card-body {
    padding: 24px;
}

/* Forms */
.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 6px;
    display: block;
    font-size: 0.875rem;
}

.modern-input {
    display: flex;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
    transition: border-color 0.2s;
}

.modern-input:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.modern-input .input-group-text {
    background: var(--gray-100);
    border: none;
    color: var(--gray-500);
    padding: 12px 14px;
    display: flex;
    align-items: center;
}

.modern-input .form-control {
    border: none;
    padding: 12px 14px;
    font-size: 1rem;
    color: var(--dark);
    flex: 1;
}

.modern-input .form-control:focus {
    outline: none;
    box-shadow: none;
}

.modern-input .form-control::placeholder {
    color: var(--gray-500);
}

.form-control,
.form-select {
    background: var(--white);
    border: 1px solid var(--gray-300);
    color: var(--dark);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 0.95rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Signature Container */
.signature-container {
    background: var(--white);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    height: 200px;
    cursor: crosshair;
    position: relative;
    overflow: hidden;
}

.signature-container:hover {
    border-color: var(--primary);
}

.signature-container canvas {
    width: 100% !important;
    height: 100% !important;
    background: white;
}

.signature-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--gray-500);
    pointer-events: none;
}

.signature-placeholder i {
    font-size: 2rem;
    margin-bottom: 8px;
    color: var(--gray-300);
}

.signature-placeholder p {
    margin: 0;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-primary-gradient,
.btn-admin-gradient {
    background: var(--primary);
    color: var(--white);
}

.btn-primary-gradient:hover,
.btn-admin-gradient:hover {
    background: var(--primary-hover);
    color: var(--white);
}

.btn-glass {
    background: var(--gray-100);
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

.btn-glass:hover {
    background: var(--gray-200);
}

.btn-outline-secondary {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline-secondary:hover {
    background: var(--gray-100);
    color: var(--dark);
}

.btn-outline-light {
    background: transparent;
    border: 1px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline-light:hover {
    background: var(--gray-100);
}

.btn-outline-danger {
    background: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: var(--white);
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Floating Button */
.floating-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gray-700);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    border: none;
    z-index: 1000;
}

.floating-btn:hover {
    background: var(--dark);
}

/* Tables */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--gray-300);
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    vertical-align: middle;
}

.admin-table tbody tr:hover {
    background: var(--gray-50);
}

.admin-table img {
    height: 32px;
    border-radius: 4px;
    background: white;
    border: 1px solid var(--gray-200);
}

/* Tabs */
.nav-tabs-container {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--gray-300);
    padding-bottom: 12px;
}

.nav-tab {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--gray-500);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-tab:hover {
    color: var(--dark);
    background: var(--gray-100);
}

.nav-tab.active {
    background: var(--primary);
    color: var(--white);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Settings */
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    gap: 16px;
}

.setting-info h5 {
    margin-bottom: 2px;
    font-weight: 600;
    font-size: 0.95rem;
}

.setting-info p {
    color: var(--gray-500);
    font-size: 0.85rem;
}

.mode-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mode-label {
    font-weight: 500;
    font-size: 0.9rem;
    min-width: 60px;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gray-300);
    border-radius: 26px;
    transition: 0.2s;
}

.toggle-slider::before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: 0.2s;
}

.toggle-switch input:checked+.toggle-slider {
    background: var(--success);
}

.toggle-switch input:checked+.toggle-slider::before {
    transform: translateX(22px);
}

/* Private Screen */
.private-card {
    text-align: center;
    padding: 48px 32px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-top: 20vh;
}

.private-icon {
    width: 64px;
    height: 64px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 1.5rem;
    color: var(--gray-500);
}

.private-card h1 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.private-card p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* Success Animation */
.success-animation {
    font-size: 3rem;
    color: var(--success);
}

/* Admin Icon */
.admin-icon {
    width: 64px;
    height: 64px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.5rem;
    color: var(--gray-700);
}

/* Goodbye Icon */
.goodbye-icon {
    font-size: 3rem;
    color: var(--primary);
}

/* Login Card */
.login-card {
    max-width: 400px;
    margin: 24px auto;
}

/* Footer */
.footer {
    text-align: center;
    padding: 16px;
    color: var(--gray-500);
    font-size: 0.8rem;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.bg-primary-gradient {
    background: var(--primary);
    color: white;
}

.badge-admin {
    background: var(--gray-700);
    color: white;
}

.badge-manager {
    background: var(--primary);
    color: white;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 6px;
}

/* Alert */
.alert {
    border-radius: var(--radius);
    padding: 12px 16px;
    font-size: 0.9rem;
    border: none;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
}

.alert-danger {
    background: #fef2f2;
    color: #991b1b;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
}

.alert-warning {
    background: #fffbeb;
    color: #92400e;
}

/* Modal */
.glass-modal .modal-content {
    background: var(--white);
    border-radius: var(--radius);
    border: 1px solid var(--gray-300);
}

.glass-modal .modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 16px 20px;
}

.glass-modal .modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 16px 20px;
}

.modal-title {
    font-size: 1rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .app-container {
        padding: 16px 12px;
    }

    .header h1 {
        font-size: 1.25rem;
    }

    .setting-item {
        flex-direction: column;
        text-align: center;
    }

    .nav-tabs-container {
        overflow-x: auto;
    }
}