

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

        body {
            font-family: 'Courier New', monospace;
            background: var(--bg);
            color: var(--text);
            overflow: hidden;
        }

        .container {
            display: flex;
            height: 100vh;
        }

        /* SIDEBAR */
        .sidebar {
            width: 280px;
            background: var(--tag-bg);
            border-right: 4px solid var(--border);
            overflow-y: auto;
            flex-shrink: 0;
        }

        .sidebar-header {
            background: var(--bg);
            color: var(--text);
            padding: 20px;
            border-bottom: 4px solid var(--border);
        }

        .sidebar-header h1 {
            font-size: 24px;
            font-weight: bold;
            letter-spacing: 2px;
        }

        .tool-list {
            list-style: none;
        }

        .tool-item {
            padding: 16px 20px;
            border-bottom: 3px solid var(--border);
            cursor: pointer;
            background: var(--tag-bg);
            color: var(--text);
            transition: all 0.1s;
            font-weight: bold;
            position: relative;
        }

        .tool-item:hover {
            background: var(--bg);
            transform: translateX(4px);
        }

        .tool-item.active {
            background: var(--bg);
            color: var(--text);
            box-shadow: inset 4px 0 0 var(--border);
        }

        .tool-item::before {
            content: '►';
            margin-right: 10px;
            opacity: 0;
        }

        .tool-item.active::before {
            opacity: 1;
        }

        /* MAIN CONTENT */
        .main-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .header {
            background: var(--bg);
            border-bottom: 4px solid var(--border);
            padding: 20px 30px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .header h2 {
            font-size: 20px;
            letter-spacing: 1px;
        }

        .btn {
            background: var(--bg);
            color: var(--text);
            border: 3px solid var(--border);
            padding: 10px 20px;
            font-family: 'Courier New', monospace;
            font-weight: bold;
            cursor: pointer;
            box-shadow: 4px 4px 0 var(--border);
            transition: all 0.1s;
            font-size: 14px;
            margin-right: 120px;
        }

        .btn:hover {
            transform: translate(2px, 2px);
            box-shadow: 2px 2px 0 var(--border);
        }

        .btn:active {
            transform: translate(4px, 4px);
            box-shadow: 0 0 0 var(--border);
        }

        .btn-primary {
            background: var(--bg);
            color: var(--text);
            border: 3px solid var(--border);
            box-shadow: 4px 4px 0 var(--border);
        }

        .btn-primary:hover {
            box-shadow: 2px 2px 0 #fff;
        }

        .btn-danger {
            background: #ff0000;
            color: #fff;
            border: 3px solid var(--border);
            box-shadow: 4px 4px 0 var(--border);
        }

        input[type="file"] {
            display: none;
        }

        /* WORKSPACE */
        .workspace {
            flex: 1;
            display: flex;
            overflow: hidden;
            background: var(--bg);
        }

        .preview-area {
            flex: 1;
            padding: 20px;
            overflow-y: auto;
            border-right: 4px solid var(--border);
        }

        .tool-panel {
            width: 320px;
            background: var(--tag-bg);
            color: var(--text);
            padding: 20px;
            overflow-y: auto;
            border-left: 4px solid var(--border);
        }

        .tool-panel h3 {
            border-bottom: 3px solid var(--border);
            padding-bottom: 10px;
            margin-bottom: 20px;
            font-size: 18px;
        }

        .control-group {
            margin-bottom: 20px;
        }

        .control-group label {
            display: block;
            margin-bottom: 8px;
            font-weight: bold;
        }

        input[type="range"],
        input[type="text"],
        input[type="number"],
        select,
        textarea {
            width: 100%;
            padding: 8px;
            border: 3px solid var(--border);
            font-family: 'Courier New', monospace;
            background: var(--bg);
            font-size: 14px;
        }

        input[type="color"] {
            width: 100%;
            height: 40px;
            border: 3px solid var(--border);
            cursor: pointer;
        }

        /* PDF CANVAS */
        .pdf-canvas-container {
            background: var(--bg);
            border: 4px solid var(--border);
            margin-bottom: 20px;
            position: relative;
            box-shadow: 8px 8px 0 rgba(0,0,0,0.3);
        }

        canvas {
            display: block;
            max-width: 100%;
            height: auto;
        }

        /* PAGE THUMBNAILS */
        .thumbnails-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 20px;
        }

        .thumbnail {
            border: 4px solid var(--border);
            background: var(--bg);
            cursor: move;
            position: relative;
            box-shadow: 6px 6px 0 rgba(0,0,0,0.4);
            transition: transform 0.1s;
        }

        .thumbnail:hover {
            transform: scale(1.02);
        }

        .thumbnail.selected {
            border-color: #00ff00;
            box-shadow: 6px 6px 0 #00ff00;
        }

        .thumbnail img,
        .thumbnail canvas {
            width: 100%;
            display: block;
        }

        .thumbnail-controls {
            position: absolute;
            top: 8px;
            right: 8px;
            display: flex;
            gap: 5px;
        }

        .thumbnail-btn {
            width: 28px;
            height: 28px;
            border: 3px solid var(--border);
            background: var(--bg);
            cursor: pointer;
            font-size: 14px;
            font-weight: bold;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .thumbnail-btn:hover {
            background: var(--text);
            color: var(--bg);
        }

        .thumbnail-label {
            background: var(--text);
            color: var(--bg);
            padding: 6px 8px;
            font-size: 12px;
            text-align: center;
            font-weight: bold;
        }

        /* SIGNATURE PAD */
        .signature-pad {
            width: 100%;
            height: 200px;
            border: 3px solid var(--border);
            background: var(--bg);
            cursor: crosshair;
            display: block;
        }

        .signature-controls {
            display: flex;
            gap: 10px;
            margin-top: 10px;
        }

        /* WATERMARK PREVIEW */
        .watermark-preview {
            width: 100%;
            height: 150px;
            border: 3px solid var(--border);
            background: var(--bg);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-top: 10px;
            position: relative;
            overflow: hidden;
        }

        .watermark-text {
            font-size: 24px;
            font-weight: bold;
            opacity: 0.3;
            transform: rotate(-45deg);
            pointer-events: none;
        }

        /* STATUS MESSAGES */
        .status-message {
            padding: 12px;
            border: 3px solid var(--border);
            margin-bottom: 15px;
            background: var(--bg);
            color: var(--text);
            font-weight: bold;
        }

        .status-message.success {
            background: #4caf50;
            color: #fff;
            border-color: var(--text);
        }

        .status-message.error {
            background: #f44336;
            color: #fff;
            border-color: var(--text);
        }

        /* LOADING */
        .loading {
            text-align: center;
            padding: 40px;
            background: var(--text);
            color: var(--bg);
            font-size: 18px;
        }

        /* SCROLLBAR */
        ::-webkit-scrollbar {
            width: 12px;
            height: 12px;
        }

        ::-webkit-scrollbar-track {
            background: var(--tag-bg);
            border: 2px solid var(--border);
        }

        ::-webkit-scrollbar-thumb {
            background: #000;
            border: 2px solid #f5f5f5;
        }

        /* ANNOTATION OVERLAY */
        .annotation-overlay {
            position: absolute;
            top: 0;
            left: 0;
            cursor: crosshair;
            z-index: 10;
        }

        /* SIGNATURE ON PDF */
        .signature-on-pdf {
            position: absolute;
            border: 2px dashed #00ff00;
            cursor: move;
            z-index: 20;
        }

        .signature-on-pdf img {
            width: 100%;
            height: 100%;
            pointer-events: none;
        }

        .signature-resize-handle {
            width: 12px;
            height: 12px;
            background: #00ff00;
            border: 2px solid var(--border);
            position: absolute;
            bottom: -6px;
            right: -6px;
            cursor: nwse-resize;
        }

        .signature-delete {
            position: absolute;
            top: -12px;
            right: -12px;
            width: 24px;
            height: 24px;
            background: #ff0000;
            color: #fff;
            border: 2px solid var(--border);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
        }

        /* CROP OVERLAY */
        .crop-overlay {
            position: absolute;
            border: 3px solid #00ff00;
            background: rgba(0, 255, 0, 0.1);
            cursor: move;
            z-index: 10;
        }

        .crop-handle {
            width: 12px;
            height: 12px;
            background: #00ff00;
            border: 2px solid var(--border);
            position: absolute;
        }

        .crop-handle.nw { top: -6px; left: -6px; cursor: nw-resize; }
        .crop-handle.ne { top: -6px; right: -6px; cursor: ne-resize; }
        .crop-handle.sw { bottom: -6px; left: -6px; cursor: sw-resize; }
        .crop-handle.se { bottom: -6px; right: -6px; cursor: se-resize; }

        /* REDACTION BOX */
        .redaction-box {
            position: absolute;
            background: var(--text);
            color: var(--bg);
            border: 2px solid #fff;
            cursor: move;
            z-index: 10;
        }

        .redaction-delete {
            position: absolute;
            top: -12px;
            right: -12px;
            width: 24px;
            height: 24px;
            background: #ff0000;
            color: #fff;
            border: 2px solid var(--border);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
        }

        /* SINGLE PAGE VIEW */
        .single-page-view {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
        }

        .page-navigation {
            display: flex;
            gap: 10px;
            align-items: center;
        }

        .page-nav-btn {
            width: 40px;
            height: 40px;
            border: 3px solid #fff;
            background: var(--text);
            color: var(--bg);
            font-size: 18px;
            font-weight: bold;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .page-nav-btn:disabled {
            opacity: 0.3;
            cursor: not-allowed;
        }

        .page-info-display {
            background: var(--text);
            color: var(--bg);
            font-size: 16px;
            font-weight: bold;
            padding: 0 20px;
        }

        /* ZOOM CONTAINER */
        .zoom-container {
            overflow: auto;
            max-width: 100%;
            max-height: 100%;
            display: flex;
            justify-content: center;
            align-items: flex-start;
        }

        .zoomable {
            transform-origin: top center;
            transition: transform 0.2s ease;
        }
    
        .sidebar-footer {
            padding: 30px 20px;
            margin-top: 60px;
            border-radius: 12px 12px 0 0;
        }

        .sidebar-footer a {
            color: var(--text);
            text-decoration: none;
            font-weight: 900;
            border: 2px solid var(--border);
            padding: 8px 16px;
            display: inline-block;
            transition: all 0.2s ease;
        }

        .sidebar-footer a:hover {
            background: var(--text);
            color: var(--bg);
        }

        #themeBtn {
            top: 15px;
        }