:root {
    --primary: #2563eb;
    --bg-dark: #1e293b;
    --bg-light: #f1f5f9;
    --border: #e2e8f0;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100%;
}

/* SIDEBAR STYLES */
.app-sidebar {
    width: 350px;
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: 4px 0 15px rgba(0,0,0,0.05);
}

.sidebar-header {
    padding: 20px;
    background: var(--bg-dark);
    color: white;
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-header h2 { margin: 0; font-size: 1.1rem; }

.sidebar-controls, .category-filter {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

/* Dropdown Styling */
#categorySelect {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 0.95rem;
    cursor: pointer;
}

.template-list-wrapper {
    flex: 1;
    overflow-y: auto;
}

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

/* Template Item */
.t-item {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.t-item:hover {
    background: #eff6ff;
    padding-left: 25px;
    border-left: 4px solid var(--primary);
}

.t-cat {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 700;
    display: block;
    margin-bottom: 4px;
}

.t-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
}

/* EDITOR AREA */
.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #cbd5e1;
}

.editor-toolbar {
    background: white;
    padding: 12px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ccc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.btn {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #1d4ed8; }
.btn-secondary { background: #e2e8f0; color: #333; }
.btn-secondary:hover { background: #cbd5e1; }

/* PAPER */
.document-stage {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    justify-content: center;
}

.paper {
    width: 8.5in;
    min-height: 11in;
    background: white;
    padding: 1in;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    outline: none;
    margin-bottom: 50px;
}

.doc-header { text-align: center; color: #2c3e50; }
.doc-header h1 { margin: 0; font-size: 24pt; text-transform: uppercase; font-family: 'Times New Roman', serif; }
.doc-header p { margin: 5px 0 0; font-size: 11pt; color: #555; }

.doc-line {
    border: 0;
    border-top: 2px solid #2c3e50;
    margin: 20px 0 30px 0;
}

.doc-body {
    font-family: 'Times New Roman', Times, serif;
    font-size: 12pt;
    line-height: 1.6;
    color: #111;
    white-space: pre-wrap; /* Preserves formatting */
}

.placeholder-text {
    color: #94a3b8;
    font-style: italic;
    font-family: 'Segoe UI', sans-serif;
    font-size: 1rem;
}
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 14px;
  z-index: 1000;
}

body .app-container {
  padding-top: 48px;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-divider {
  color: #9ca3af;
}

.app-tool {
  font-weight: 600;
  color: #2563eb;
}

.exit-btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  background: #2563eb;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
}

.exit-btn:hover {
  background: #1d4ed8;
}

@media (max-width: 768px) {
  .app-tool {
    display: none;
  }
}
