body {
            background-color: #f8f9fa;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            overflow: hidden;
        }


        .toolbar {
            background: #4472C4;
            color: white;
            padding: 8px 16px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 50px;
        }

        .toolbar h5 {
            margin: 0;
            color: white;
        }

        .btn-save {
            background: #FFD83B;
            color: #333;
            border: none;
            padding: 8px 20px;
            font-weight: 600;
            border-radius: 4px;
        }

        .main-container {
            display: flex;
            height: calc(100vh - 50px);
        }

        .sidebar {
            width: 300px;
            background: white;
            border-right: 1px solid #dee2e6;
            overflow-y: auto;
            flex-shrink: 0;
        }

        .content-area {
            flex: 1;
            background: #e9ecef;
            display: flex;
            justify-content: center;
            align-items: flex-start;
            padding: 20px;
            overflow-y: auto;
            position: relative;
        }

        .properties-panel {
            width: 300px;
            background: #f8f9fa;
            border-left: 1px solid #dee2e6;
            overflow-y: auto;
            flex-shrink: 0;
        }

        .tool-item {
            display: flex;
            align-items: center;
            padding: 12px 16px;
            margin: 4px 8px;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
            border: 1px solid transparent;
        }

        .tool-item:hover {
            background-color: #f8f9fa;
        }

        .tool-item.active {
            background-color: #e3f2fd;
            border-color: #2196f3;
            color: #1976d2;
        }

        .tool-icon {
            width: 20px;
            height: 20px;
            margin-right: 12px;
        }

        #doc-viewer {
            background: white;
            box-shadow: 0 4px 20px rgba(0,0,0,0.1);
            border-radius: 8px;
            padding: 0;
            position: relative;
            max-width: none;
            width: auto;
        }

        .pdf-page {
            position: relative;
            margin: 0;
            background: white;
            border-bottom: 1px solid #eee;
        }

        .pdf-page:last-child {
            border-bottom: none;
        }

        .pdf-canvas {
            display: block;
            width: 100%;
            height: auto;
            pointer-events: none;
        }

        .page-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
        }

        .field-element {
            position: absolute;
            border: 2px solid #2196f3;
            background: rgba(33, 150, 243, 0.1);
            cursor: move;
            min-width: 80px;
            min-height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 11px;
            color: #1976d2;
            z-index: 10;
            user-select: none;
            box-sizing: border-box;
        }

        .field-element.selected {
            border-color: #f44336;
            background: rgba(244, 67, 54, 0.1);
            box-shadow: 0 0 0 2px rgba(244, 67, 54, 0.3);
        }

        .field-element.signature-field {
            background: rgba(255, 152, 0, 0.1);
            border-color: #ff9800;
            color: #f57c00;
        }

        .field-element.text-field {
            background: rgba(76, 175, 80, 0.1);
            border-color: #4caf50;
            color: #388e3c;
        }

        .field-element.date-field {
            background: rgba(156, 39, 176, 0.1);
            border-color: #9c27b0;
            color: #7b1fa2;
        }

        .field-element.checkbox-field {
            background: rgba(233, 30, 99, 0.1);
            border-color: #e91e63;
            color: #c2185b;
        }

        .field-element input, .field-element select {
            border: none;
            background: transparent;
            width: 100%;
            height: 100%;
            font-size: 11px;
            padding: 2px 4px;
            pointer-events: auto;
        }

        .loading {
            text-align: center;
            padding: 40px;
            color: #666;
        }

        .section-title {
            font-size: 12px;
            font-weight: 600;
            color: #666;
            margin-bottom: 8px;
            padding: 12px 16px 0;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .tools-section {
            padding-bottom: 16px;
            border-bottom: 1px solid #eee;
            margin-bottom: 16px;
        }

        /* Properties Panel Styles */
        .properties-container {
            padding: 16px;
            height: 100%;
        }

        .property-section {
            margin-bottom: 20px;
            border: 1px solid #dee2e6;
            border-radius: 6px;
            overflow: hidden;
        }

        .property-header {
            background: #f8f9fa;
            padding: 12px 16px;
            border-bottom: 1px solid #dee2e6;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-weight: 600;
            font-size: 14px;
        }

        .property-header:hover {
            background: #e9ecef;
        }

        .property-content {
            padding: 16px;
            background: white;
        }

        .property-content.collapsed {
            display: none;
        }

        .form-group {
            margin-bottom: 16px;
        }

        .form-group:last-child {
            margin-bottom: 0;
        }

        .form-label {
            font-weight: 600;
            margin-bottom: 6px;
            display: block;
            font-size: 13px;
            color: #333;
        }

        .form-control, .form-select {
            border-radius: 4px;
            border: 1px solid #ced4da;
            font-size: 13px;
            padding: 8px 12px;
        }

        .form-control:focus, .form-select:focus {
            border-color: #4472C4;
            box-shadow: 0 0 0 0.2rem rgba(68, 114, 196, 0.25);
        }

        .form-check {
            margin-bottom: 8px;
        }

        .form-check-input {
            margin-top: 0.1em;
        }

        .form-check-label {
            font-size: 13px;
            margin-left: 6px;
        }

        .btn-group-vertical {
            width: 100%;
        }

        .btn-outline-primary {
            border-color: #4472C4;
            color: #4472C4;
        }

        .btn-outline-primary:hover {
            background-color: #4472C4;
            border-color: #4472C4;
        }

        .btn-danger {
            background-color: #dc3545;
            border-color: #dc3545;
        }

        .character-count {
            font-size: 11px;
            color: #666;
            text-align: right;
            margin-top: 4px;
        }

        .recipient-badge {
            background: #fff3cd;
            color: #856404;
            padding: 4px 8px;
            border-radius: 12px;
            font-size: 11px;
            display: inline-flex;
            align-items: center;
        }

        .recipient-badge::before {
            content: "●";
            margin-right: 6px;
        }

        .signature-pad {
            border: 1px solid #dee2e6;
            border-radius: 4px;
            cursor: crosshair;
            background: white;
        }

        .ui-resizable-handle {
            background: #4472C4;
        }

        .ui-resizable-se {
            width: 10px;
            height: 10px;
            right: 0;
            bottom: 0;
            background: #4472C4;
            border-radius: 2px;
        }

        .collapse-icon {
            transition: transform 0.2s ease;
        }

        .collapsed .collapse-icon {
            transform: rotate(-90deg);
        }

        #field-properties.hidden {
            display: none;
        }

        .no-selection {
            text-align: center;
            color: #666;
            padding: 40px 20px;
            font-style: italic;
        }