/* ============================================
   8ledger Accountant Portal - Stylesheet
   ============================================ */

/* ---- Reset & Variables ---- */
*{margin:0;padding:0;box-sizing:border-box}
:root{--gold:#C9A03D;--gold-light:#F5ECD7;--gold-dark:#A68430;--blue:#2C5F8A;--blue-light:#E8F0F8;--jade:#4A8B71;--jade-light:#E6F2EC;--red:#C0392B;--red-light:#FDECEA;--orange:#E67E22;--orange-light:#FEF4E8;--gray-50:#F9FAFB;--gray-100:#F3F4F6;--gray-200:#E5E7EB;--gray-300:#D1D5DB;--gray-400:#9CA3AF;--gray-500:#6B7280;--gray-600:#4B5563;--gray-700:#374151;--gray-800:#1F2937;--sidebar-w:260px;--topbar-h:60px}
body{font-family:'Inter',sans-serif;background:var(--gray-50);color:var(--gray-800);line-height:1.5}
a{color:var(--blue);text-decoration:none}

/* LOGIN */
.login-screen{display:flex;align-items:center;justify-content:center;min-height:100vh;background:linear-gradient(135deg,#f8f6f0 0%,#f0ead6 100%)}
.login-card{background:#fff;border-radius:16px;padding:48px 40px;width:420px;max-width:95%;box-shadow:0 20px 60px rgba(0,0,0,.08);text-align:center}
.login-logo{width:72px;height:72px;margin:0 auto 12px}
.login-logo svg{width:100%;height:100%}
.login-title{font-size:24px;font-weight:700;color:var(--gray-800);margin-bottom:4px}
.login-subtitle{font-size:14px;color:var(--gold);font-weight:600;margin-bottom:32px;letter-spacing:1px;text-transform:uppercase}
.form-group{margin-bottom:20px;text-align:left}
.form-group label{display:block;font-size:13px;font-weight:500;color:var(--gray-600);margin-bottom:6px}
.input-wrap{position:relative}
.input-wrap svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);width:18px;height:18px;color:var(--gray-400)}
.input-wrap input{width:100%;padding:12px 12px 12px 40px;border:1.5px solid var(--gray-200);border-radius:10px;font-size:14px;font-family:inherit;transition:border .2s}
.input-wrap input:focus{outline:none;border-color:var(--gold)}
.login-btn{width:100%;padding:14px;background:var(--gold);color:#fff;border:none;border-radius:10px;font-size:15px;font-weight:600;cursor:pointer;transition:background .2s;font-family:inherit}
.login-btn:hover{background:var(--gold-dark)}
.login-hint{margin-top:20px;font-size:12px;color:var(--gray-400);background:var(--gray-50);border-radius:8px;padding:12px}
.login-hint strong{color:var(--gray-600)}
.login-back{display:inline-block;margin-top:20px;font-size:13px;color:var(--gray-400)}
.login-back:hover{color:var(--gold)}
.login-error{color:var(--red);font-size:13px;margin-bottom:12px;display:none}

/* PORTAL SHELL */
.portal{display:none;min-height:100vh}
.topbar{position:fixed;top:0;left:0;right:0;height:var(--topbar-h);background:#fff;border-bottom:1px solid var(--gray-200);display:flex;align-items:center;justify-content:space-between;padding:0 24px;z-index:100}
.topbar-left{display:flex;align-items:center;gap:16px}
.topbar-logo{width:32px;height:32px}
.topbar-firm{font-size:16px;font-weight:600;color:var(--gray-800)}
.sidebar-toggle{background:none;border:none;cursor:pointer;padding:4px;color:var(--gray-500)}
.sidebar-toggle svg{width:22px;height:22px}
.topbar-right{display:flex;align-items:center;gap:16px}
.lang-toggle{padding:6px 12px;border:1px solid var(--gray-200);border-radius:8px;font-size:12px;font-weight:500;cursor:pointer;background:#fff;font-family:inherit;color:var(--gray-600)}
.lang-toggle:hover{border-color:var(--gold);color:var(--gold)}
.notif-btn{position:relative;background:none;border:none;cursor:pointer;color:var(--gray-500);padding:4px}
.notif-btn svg{width:22px;height:22px}
.notif-badge{position:absolute;top:-2px;right:-2px;width:16px;height:16px;background:var(--red);color:#fff;font-size:9px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700}
.user-avatar{width:36px;height:36px;border-radius:50%;background:var(--gold);color:#fff;display:flex;align-items:center;justify-content:center;font-weight:600;font-size:14px;cursor:pointer;position:relative}
.user-dropdown{position:absolute;top:44px;right:0;background:#fff;border-radius:10px;box-shadow:0 10px 30px rgba(0,0,0,.12);padding:8px 0;min-width:180px;display:none;z-index:200}
.user-dropdown.show{display:block}
.user-dropdown a{display:block;padding:10px 20px;font-size:13px;color:var(--gray-700)}
.user-dropdown a:hover{background:var(--gray-50);color:var(--gold)}

/* SIDEBAR */
.sidebar{position:fixed;top:var(--topbar-h);left:0;bottom:0;width:var(--sidebar-w);background:#fff;border-right:1px solid var(--gray-200);overflow-y:auto;z-index:90;transition:transform .3s}
.sidebar.collapsed{transform:translateX(-100%)}
.sidebar::-webkit-scrollbar{width:4px}
.sidebar::-webkit-scrollbar-thumb{background:var(--gray-300);border-radius:4px}
.nav-group{padding:8px 0}
.nav-group-header{padding:8px 20px;font-size:10px;font-weight:700;color:var(--gray-400);text-transform:uppercase;letter-spacing:1.2px;cursor:pointer;display:flex;align-items:center;justify-content:space-between;user-select:none}
.nav-group-header:hover{color:var(--gold)}
.nav-group-header svg{width:14px;height:14px;transition:transform .2s}
.nav-group.collapsed .nav-group-header svg{transform:rotate(-90deg)}
.nav-group.collapsed .nav-items{display:none}
.nav-items{padding:0}
.nav-item{display:flex;align-items:center;gap:10px;padding:9px 20px;font-size:13px;color:var(--gray-600);cursor:pointer;transition:all .15s;border-left:3px solid transparent}
.nav-item:hover{background:var(--gold-light);color:var(--gold)}
.nav-item.active{background:var(--gold-light);color:var(--gold);border-left-color:var(--gold);font-weight:600}
.nav-item svg{width:16px;height:16px;flex-shrink:0}

/* MAIN CONTENT */
.main-content{margin-left:var(--sidebar-w);margin-top:var(--topbar-h);padding:28px;transition:margin-left .3s;min-height:calc(100vh - var(--topbar-h))}
.sidebar.collapsed~.main-content{margin-left:0}
.page-section{display:none}
.page-section.active{display:block}
.page-header{margin-bottom:24px}
.page-header h1{font-size:22px;font-weight:700;color:var(--gray-800)}
.page-header p{font-size:14px;color:var(--gray-500);margin-top:4px}

/* CARDS */
.stat-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:20px;margin-bottom:28px}
.stat-card{background:#fff;border-radius:12px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,.06);border:1px solid var(--gray-100)}
.stat-card .sc-icon{width:42px;height:42px;border-radius:10px;display:flex;align-items:center;justify-content:center;margin-bottom:14px}
.stat-card .sc-icon svg{width:20px;height:20px}
.stat-card .sc-icon.gold{background:var(--gold-light);color:var(--gold)}
.stat-card .sc-icon.blue{background:var(--blue-light);color:var(--blue)}
.stat-card .sc-icon.jade{background:var(--jade-light);color:var(--jade)}
.stat-card .sc-icon.red{background:var(--red-light);color:var(--red)}
.stat-card .sc-value{font-size:28px;font-weight:700;color:var(--gray-800)}
.stat-card .sc-label{font-size:13px;color:var(--gray-500);margin-top:4px}

/* TABLES */
.table-container{overflow-x:auto;background:#fff;border-radius:12px;box-shadow:0 1px 3px rgba(0,0,0,.06);border:1px solid var(--gray-100)}
.data-table{width:100%;border-collapse:collapse;font-size:13px}
.data-table th{padding:12px 16px;text-align:left;font-weight:600;color:var(--gray-500);border-bottom:2px solid var(--gray-100);white-space:nowrap;font-size:12px;text-transform:uppercase;letter-spacing:.5px}
.data-table td{padding:12px 16px;border-bottom:1px solid var(--gray-50);color:var(--gray-700)}
.data-table tr:hover{background:var(--gray-50)}
.data-table tr:last-child td{border-bottom:none}

/* BADGES */
.status-badge{display:inline-block;padding:4px 10px;border-radius:20px;font-size:11px;font-weight:600}
.badge-active,.badge-filed,.badge-paid,.badge-matched,.badge-done,.badge-resolved{background:#DEF7EC;color:#03543F}
.badge-pending,.badge-draft,.badge-invited,.badge-unmatched{background:var(--gold-light);color:var(--gold-dark)}
.badge-archived,.badge-overdue,.badge-paused{background:var(--red-light);color:var(--red)}
.badge-progress,.badge-sent,.badge-ready{background:var(--blue-light);color:var(--blue)}
.badge-new{background:#EDE9FE;color:#5B21B6}
.badge-review{background:var(--orange-light);color:var(--orange)}
.badge-high{background:var(--red-light);color:var(--red)}
.badge-medium{background:var(--orange-light);color:var(--orange)}
.badge-low{background:var(--jade-light);color:var(--jade)}

/* BUTTONS */
.action-btn{padding:8px 18px;border-radius:8px;font-size:13px;font-weight:500;cursor:pointer;border:none;font-family:inherit;transition:all .2s;display:inline-flex;align-items:center;gap:6px}
.btn-gold{background:var(--gold);color:#fff}.btn-gold:hover{background:var(--gold-dark)}
.btn-blue{background:var(--blue);color:#fff}.btn-blue:hover{background:#1E4A6F}
.btn-jade{background:var(--jade);color:#fff}.btn-jade:hover{background:#3A7660}
.btn-outline{background:#fff;color:var(--gray-600);border:1px solid var(--gray-200)}.btn-outline:hover{border-color:var(--gold);color:var(--gold)}
.btn-sm{padding:5px 12px;font-size:12px}
.btn-red{background:var(--red);color:#fff}.btn-red:hover{background:#A93226}
.btn-icon{background:none;border:none;color:var(--gray-400);cursor:pointer;padding:4px}.btn-icon:hover{color:var(--gold)}

/* PANELS */
.panel{background:#fff;border-radius:12px;padding:24px;box-shadow:0 1px 3px rgba(0,0,0,.06);border:1px solid var(--gray-100);margin-bottom:20px}
.panel-title{font-size:16px;font-weight:600;margin-bottom:16px;color:var(--gray-800);display:flex;align-items:center;justify-content:space-between}

/* SEARCH & FILTERS */
.search-bar{display:flex;gap:12px;margin-bottom:20px;flex-wrap:wrap;align-items:center}
.search-input{flex:1;min-width:200px;padding:10px 14px 10px 38px;border:1.5px solid var(--gray-200);border-radius:10px;font-size:13px;font-family:inherit;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239CA3AF' viewBox='0 0 24 24'%3E%3Cpath d='M21 21l-4.35-4.35M11 19a8 8 0 100-16 8 8 0 000 16z' stroke='%239CA3AF' stroke-width='2' fill='none'/%3E%3C/svg%3E") 12px center no-repeat}
.search-input:focus{outline:none;border-color:var(--gold)}
.filter-btn{padding:8px 16px;border:1px solid var(--gray-200);border-radius:8px;font-size:13px;background:#fff;cursor:pointer;font-family:inherit;color:var(--gray-600)}
.filter-btn:hover,.filter-btn.active{background:var(--gold);color:#fff;border-color:var(--gold)}

/* QUICK ACTIONS */
.quick-actions{display:flex;gap:12px;flex-wrap:wrap;margin-bottom:28px}

/* UPLOAD ZONE */
.upload-zone{border:2px dashed var(--gray-300);border-radius:12px;padding:48px;text-align:center;cursor:pointer;transition:all .2s;margin-bottom:20px}
.upload-zone:hover{border-color:var(--gold);background:var(--gold-light)}
.upload-zone svg{width:48px;height:48px;color:var(--gray-300);margin-bottom:12px}
.upload-zone p{color:var(--gray-500);font-size:14px}

/* TAGS */
.tag-pill{display:inline-block;padding:5px 14px;border-radius:20px;font-size:12px;font-weight:500;margin:3px}
.tag-gold{background:var(--gold-light);color:var(--gold-dark)}
.tag-blue{background:var(--blue-light);color:var(--blue)}
.tag-jade{background:var(--jade-light);color:var(--jade)}

/* KANBAN */
.kanban-board{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
.kanban-col{background:var(--gray-50);border-radius:12px;padding:16px;min-height:300px}
.kanban-col-header{font-size:14px;font-weight:600;margin-bottom:12px;display:flex;justify-content:space-between;align-items:center}
.kanban-col-header .count{background:var(--gray-200);color:var(--gray-600);font-size:11px;padding:2px 8px;border-radius:10px}
.kanban-card{background:#fff;border-radius:10px;padding:14px;margin-bottom:10px;box-shadow:0 1px 3px rgba(0,0,0,.06);border:1px solid var(--gray-100);cursor:pointer}
.kanban-card:hover{box-shadow:0 4px 12px rgba(0,0,0,.08)}
.kanban-card .kc-title{font-size:13px;font-weight:600;margin-bottom:6px}
.kanban-card .kc-client{font-size:11px;color:var(--gray-500)}
.kanban-card .kc-meta{display:flex;justify-content:space-between;align-items:center;margin-top:10px;font-size:11px;color:var(--gray-400)}
.kanban-card .kc-avatar{width:22px;height:22px;border-radius:50%;background:var(--blue);color:#fff;display:flex;align-items:center;justify-content:center;font-size:9px;font-weight:600}

/* CALENDAR */
.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px;background:var(--gray-200);border-radius:12px;overflow:hidden}
.cal-header{background:var(--gold);color:#fff;padding:10px;text-align:center;font-size:12px;font-weight:600}
.cal-day{background:#fff;min-height:80px;padding:6px;font-size:12px}
.cal-day .day-num{font-weight:600;color:var(--gray-700);margin-bottom:4px}
.cal-day.other-month{background:var(--gray-50)}
.cal-day.other-month .day-num{color:var(--gray-300)}
.cal-event{font-size:10px;padding:2px 4px;border-radius:4px;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cal-event.ev-gst{background:var(--gold-light);color:var(--gold-dark)}
.cal-event.ev-acra{background:var(--blue-light);color:var(--blue)}
.cal-event.ev-eci{background:var(--jade-light);color:var(--jade)}
.cal-event.ev-cs{background:var(--red-light);color:var(--red)}

/* CHAT */
.chat-container{display:grid;grid-template-columns:240px 1fr;gap:0;background:#fff;border-radius:12px;overflow:hidden;border:1px solid var(--gray-100);height:500px}
.chat-sidebar{border-right:1px solid var(--gray-100);overflow-y:auto}
.chat-member{display:flex;align-items:center;gap:10px;padding:14px 16px;cursor:pointer;transition:background .15s}
.chat-member:hover,.chat-member.active{background:var(--gold-light)}
.chat-member .cm-avatar{width:32px;height:32px;border-radius:50%;background:var(--blue);color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600;flex-shrink:0}
.chat-member .cm-info{flex:1}
.chat-member .cm-name{font-size:13px;font-weight:500}
.chat-member .cm-status{font-size:11px;color:var(--gray-400)}
.online-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
.online-dot.on{background:var(--jade)}.online-dot.off{background:var(--gray-300)}
.chat-main{display:flex;flex-direction:column}
.chat-messages{flex:1;padding:20px;overflow-y:auto}
.chat-msg{margin-bottom:16px;display:flex;gap:8px}
.chat-msg.sent{flex-direction:row-reverse}
.chat-msg .msg-avatar{width:28px;height:28px;border-radius:50%;background:var(--jade);color:#fff;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:600;flex-shrink:0}
.chat-msg.sent .msg-avatar{background:var(--gold)}
.msg-bubble{max-width:70%;padding:10px 14px;border-radius:12px;font-size:13px;line-height:1.5}
.chat-msg:not(.sent) .msg-bubble{background:var(--gray-100);color:var(--gray-700)}
.chat-msg.sent .msg-bubble{background:var(--gold);color:#fff}
.msg-time{font-size:10px;color:var(--gray-400);margin-top:4px}
.chat-input-wrap{border-top:1px solid var(--gray-100);padding:14px;display:flex;gap:10px}
.chat-input{flex:1;padding:10px 14px;border:1px solid var(--gray-200);border-radius:10px;font-size:13px;font-family:inherit}
.chat-input:focus{outline:none;border-color:var(--gold)}

/* TOGGLE */
.toggle-switch{position:relative;width:44px;height:24px;display:inline-block}
.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:24px;transition:.3s}
.toggle-slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background:#fff;border-radius:50%;transition:.3s}
.toggle-switch input:checked+.toggle-slider{background:var(--gold)}
.toggle-switch input:checked+.toggle-slider:before{transform:translateX(20px)}

/* FORM */
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:16px}
.form-field{margin-bottom:16px}
.form-field label{display:block;font-size:13px;font-weight:500;color:var(--gray-600);margin-bottom:6px}
.form-field input,.form-field select,.form-field textarea{width:100%;padding:10px 14px;border:1.5px solid var(--gray-200);border-radius:8px;font-size:13px;font-family:inherit}
.form-field input:focus,.form-field select:focus,.form-field textarea:focus{outline:none;border-color:var(--gold)}
.form-field textarea{min-height:100px;resize:vertical}

/* GRID CARDS */
.card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}
.grid-card{background:#fff;border-radius:12px;padding:20px;box-shadow:0 1px 3px rgba(0,0,0,.06);border:1px solid var(--gray-100);transition:box-shadow .2s}
.grid-card:hover{box-shadow:0 4px 16px rgba(0,0,0,.08)}
.grid-card .gc-icon{width:48px;height:48px;border-radius:10px;background:var(--gray-100);display:flex;align-items:center;justify-content:center;margin-bottom:14px;font-size:20px}
.grid-card .gc-title{font-size:15px;font-weight:600;margin-bottom:6px}
.grid-card .gc-desc{font-size:12px;color:var(--gray-500);line-height:1.5;margin-bottom:14px}

/* ANNOTATIONS */
.annotation-container{display:grid;grid-template-columns:1fr 320px;gap:0;background:#fff;border-radius:12px;overflow:hidden;border:1px solid var(--gray-100);height:500px}
.doc-viewer{background:var(--gray-100);display:flex;align-items:center;justify-content:center;color:var(--gray-400);font-size:14px}
.annotation-sidebar{border-left:1px solid var(--gray-100);overflow-y:auto;padding:16px}
.annotation-item{padding:14px;border-bottom:1px solid var(--gray-100)}
.annotation-item .ai-author{font-size:12px;font-weight:600;color:var(--gray-700)}
.annotation-item .ai-date{font-size:11px;color:var(--gray-400)}
.annotation-item .ai-text{font-size:13px;color:var(--gray-600);margin-top:6px}
.annotation-item .ai-ref{font-size:11px;color:var(--gold);margin-top:4px}

/* MODALS */
.modal{display:none;position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,.4);z-index:500;align-items:center;justify-content:center}
.modal.show{display:flex}
.modal-content{background:#fff;border-radius:16px;padding:32px;max-width:500px;width:95%;max-height:80vh;overflow-y:auto}
.modal-title{font-size:18px;font-weight:600;margin-bottom:20px}
.modal-close{float:right;background:none;border:none;font-size:20px;cursor:pointer;color:var(--gray-400)}

/* RESPONSIVE */
@media(max-width:1024px){.kanban-board{grid-template-columns:repeat(2,1fr)}}
@media(max-width:768px){
.sidebar{transform:translateX(-100%)}
.sidebar.mobile-open{transform:translateX(0)}
.main-content{margin-left:0!important}
.kanban-board{grid-template-columns:1fr}
.form-row{grid-template-columns:1fr}
.chat-container{grid-template-columns:1fr}
.chat-sidebar{display:none}
.stat-cards{grid-template-columns:1fr 1fr}
}

/* TIMELINE */
.timeline{position:relative;padding-left:24px}
.timeline::before{content:"";position:absolute;left:8px;top:0;bottom:0;width:2px;background:var(--gray-200)}
.timeline-item{position:relative;margin-bottom:24px}
.timeline-item::before{content:"";position:absolute;left:-20px;top:4px;width:10px;height:10px;border-radius:50%;background:var(--gold);border:2px solid #fff}
.timeline-item .ti-header{display:flex;justify-content:space-between;margin-bottom:4px}
.timeline-item .ti-author{font-size:13px;font-weight:600;color:var(--gray-700)}
.timeline-item .ti-date{font-size:12px;color:var(--gray-400)}
.timeline-item .ti-content{font-size:13px;color:var(--gray-600);line-height:1.6}

/* FOLDER TREE */
.folder-tree{list-style:none;padding:0}
.folder-tree li{padding:8px 12px;cursor:pointer;font-size:13px;color:var(--gray-600);border-radius:6px;display:flex;align-items:center;gap:8px}
.folder-tree li:hover,.folder-tree li.active{background:var(--gold-light);color:var(--gold)}
.folder-tree svg{width:16px;height:16px}

/* COLOR PICKER */
.color-row{display:flex;gap:12px;align-items:center;margin-bottom:12px}
.color-swatch{width:36px;height:36px;border-radius:8px;border:2px solid var(--gray-200);cursor:pointer}
.color-label{font-size:13px;color:var(--gray-600)}

/* PREVIEW */
.preview-box{border:1px solid var(--gray-200);border-radius:12px;padding:24px;background:var(--gray-50);min-height:200px}

/* MISC */
.section-grid{display:grid;grid-template-columns:280px 1fr;gap:20px}
.flex-between{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px}
.mb-20{margin-bottom:20px}
.mb-12{margin-bottom:12px}
.text-right{text-align:right}
.text-gold{color:var(--gold)}
.text-jade{color:var(--jade)}
.text-blue{color:var(--blue)}
.text-red{color:var(--red)}
.fw-600{font-weight:600}
.fs-12{font-size:12px}
.gap-8{gap:8px}
.d-flex{display:flex}
.align-center{align-items:center}

/* TIMER */
.timer-widget{display:flex;align-items:center;gap:16px;background:#fff;border-radius:12px;padding:20px;border:1px solid var(--gray-100);margin-bottom:20px}
.timer-display{font-size:32px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--gray-800);min-width:150px}
.timer-controls{display:flex;gap:8px}

/* ============================================
   ENHANCED STYLES
   ============================================ */

/* Smooth page section transitions */
.page-section.active {
  display: block;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Modal animation */
.modal.show {
  animation: modalFadeIn 0.2s ease;
}
.modal.show .modal-content {
  animation: modalSlideUp 0.25s ease;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Stat card gold accent */
.stat-card {
  border-top: 3px solid var(--gold);
}

/* Focus ring on inputs */
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus,
.input-wrap input:focus,
.search-input:focus,
.chat-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,160,61,0.12);
}

/* Custom scrollbar for sidebar and tables */
.sidebar::-webkit-scrollbar,
.table-container::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar,
.annotation-sidebar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.sidebar::-webkit-scrollbar-track,
.table-container::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track,
.annotation-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb,
.table-container::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb,
.annotation-sidebar::-webkit-scrollbar-thumb {
  background: rgba(201,160,61,0.3);
  border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover,
.table-container::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover,
.annotation-sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(201,160,61,0.5);
}

/* Profitability bar */
.profitability-bar {
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}
.profitability-bar .bar-fill {
  height: 100%;
  background: var(--jade);
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* Card component (generic) */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid var(--gray-100);
}
.card-header {
  border-bottom: 1px solid var(--gray-100);
  padding-bottom: 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-title {
  font-weight: 700;
  color: #1e293b;
}

/* Sidebar collapsed icon-only mode */
@media (min-width: 769px) {
  .sidebar.icon-only {
    width: 60px;
    overflow: hidden;
  }
  .sidebar.icon-only .nav-group-header span,
  .sidebar.icon-only .nav-item span {
    display: none;
  }
  .sidebar.icon-only .nav-item {
    justify-content: center;
    padding: 12px;
  }
  .sidebar.icon-only ~ .main-content {
    margin-left: 60px;
  }
}

/* Additional responsive rules */
@media (max-width: 480px) {
  .stat-cards {
    grid-template-columns: 1fr;
  }
  .page-header h1 {
    font-size: 18px;
  }
  .topbar-firm {
    display: none;
  }
  .annotation-container {
    grid-template-columns: 1fr;
    height: auto;
  }
  .section-grid {
    grid-template-columns: 1fr;
  }
}

/* Print styles */
@media print {
  .sidebar, .topbar, .search-bar, .action-btn, .quick-actions {
    display: none !important;
  }
  .main-content {
    margin: 0 !important;
    padding: 0 !important;
  }
  .page-section.active {
    display: block !important;
  }
}

/* Accessibility: focus visible */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Selection color */
::selection {
  background: var(--gold-light);
  color: var(--gray-800);
}
