/* EYEQ Ophthalmology Clinic — shared app stylesheet
   Consolidated from the approved wireframes; same class names/behavior. */

*{box-sizing:border-box;}
html,body{margin:0;height:100%;}
body{font-family:'IBM Plex Sans',system-ui,-apple-system,sans-serif;background:#F2F5F7;color:#20242B;}
body.rtl{font-family:'IBM Plex Sans Arabic',Tahoma,system-ui,sans-serif;}
a{color:#1E7F7A;text-decoration:none;}
a:hover{color:#173B5E;}

.app{display:flex;min-height:100vh;background:#F2F5F7;}
.app.rtl{direction:rtl;}

/* ---------- sidebar ---------- */
.sidebar{width:240px;flex-shrink:0;background:#173B5E;display:flex;flex-direction:column;padding:24px 0;}
.brand{padding:0 24px 18px 24px;border-bottom:1px solid rgba(255,255,255,0.14);margin-bottom:14px;display:flex;align-items:center;gap:10px;}
.brand-mark{width:32px;height:32px;border-radius:8px;background:#1E7F7A;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.brand-name{color:#fff;font-weight:700;font-size:14px;line-height:1.3;}
.brand-sub{color:rgba(255,255,255,0.5);font-size:10.5px;}
.role-chip{display:inline-flex;align-items:center;gap:6px;padding:5px 12px;border-radius:12px;font-size:10.5px;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;margin:14px 24px 22px 24px;width:fit-content;background:#1E7F7A;color:#fff;}
.role-chip.secretary{background:#C79A3D;color:#173B5E;text-transform:none;letter-spacing:normal;font-size:11px;}
.navlist{display:flex;flex-direction:column;gap:3px;padding:0 12px;flex-grow:1;}
.navitem{display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:6px;color:rgba(255,255,255,0.68);font-size:13px;font-weight:500;}
.navitem svg{width:17px;height:17px;flex-shrink:0;}
.navitem.active{background:rgba(255,255,255,0.13);color:#fff;}
.navitem:hover{color:#fff;}
.nav-badge{margin-inline-start:auto;background:#D64545;color:#fff;font-size:10px;font-weight:700;min-width:18px;height:18px;border-radius:9px;display:flex;align-items:center;justify-content:center;padding:0 5px;flex-shrink:0;}
.navfoot-spacer{margin-top:auto;}

/* ---------- main/topbar ---------- */
.main{flex-grow:1;display:flex;flex-direction:column;min-width:0;}
.topbar{display:flex;align-items:center;justify-content:space-between;padding:20px 32px;background:#fff;border-bottom:1px solid #D6DEE4;flex-shrink:0;}
.page-title{font-size:19px;font-weight:700;color:#173B5E;margin:0;display:flex;align-items:center;gap:10px;}
.page-sub{font-size:12px;color:#5A6672;margin-top:3px;}
.user-chip{display:flex;align-items:center;gap:10px;}
.avatar{width:34px;height:34px;border-radius:50%;background:#E4F2F1;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;color:#173B5E;flex-shrink:0;}
.avatar.secretary{background:#F8EFDC;color:#8A6A22;}
.user-meta{font-size:12px;line-height:1.4;}
.user-meta .name{font-weight:600;color:#20242B;}
.user-meta .role{color:#5A6672;}
.content{flex-grow:1;padding:26px 32px;overflow:auto;}

/* ---------- cards / sections ---------- */
.card{background:#fff;border:1px solid #D6DEE4;border-radius:9px;padding:20px;margin-bottom:16px;}
.section-title{font-size:12.5px;font-weight:700;color:#173B5E;text-transform:uppercase;letter-spacing:0.05em;margin:0 0 14px 0;display:flex;align-items:center;gap:8px;}
.section-title svg{width:14px;height:14px;}

/* ---------- stat cards / grids ---------- */
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:16px;}
.grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin-bottom:20px;}
.stat-card{background:#fff;border:1px solid #D6DEE4;border-radius:9px;padding:16px 18px;}
.stat-num{font-size:24px;font-weight:700;color:#173B5E;}
.stat-label{font-size:11px;color:#5A6672;margin-top:4px;text-transform:uppercase;letter-spacing:0.03em;}

/* ---------- forms ---------- */
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:16px;}
.field-label{font-size:10.5px;font-weight:700;color:#5A6672;text-transform:uppercase;letter-spacing:0.04em;}
.field-box{border:1px solid #D6DEE4;border-radius:5px;padding:10px 12px;font-size:13px;color:#20242B;width:100%;font-family:inherit;}
.field-box::placeholder{color:#93A4B0;}
textarea.field-box{min-height:64px;resize:vertical;}
.select-wrap{position:relative;}
.select-native{width:100%;border:1px solid #D6DEE4;border-radius:6px;padding:12px 34px 12px 14px;font-size:13.5px;color:#20242B;font-weight:600;appearance:none;-webkit-appearance:none;background:#fff;font-family:inherit;}
.select-chevron{position:absolute;inset-inline-end:14px;top:50%;transform:translateY(-50%);width:14px;height:14px;color:#5A6672;pointer-events:none;}

/* ---------- buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;padding:10px 18px;border-radius:6px;font-size:12.5px;font-weight:600;border:none;gap:7px;cursor:pointer;font-family:inherit;}
.btn svg{width:14px;height:14px;}
.btn-primary{background:#1E7F7A;color:#fff;}
.btn-primary:hover{background:#186863;}
.btn-secondary{background:#fff;color:#173B5E;border:1px solid #173B5E;}
.btn-ghost{background:transparent;color:#5A6672;border:1px solid #D6DEE4;}
.btn-row{display:flex;gap:10px;margin-bottom:22px;}
.btn:disabled{opacity:0.5;cursor:not-allowed;}

/* ---------- tables ---------- */
table{width:100%;border-collapse:collapse;}
th{text-align:left;font-size:10.5px;font-weight:700;color:#5A6672;text-transform:uppercase;letter-spacing:0.03em;padding:0 10px 10px 10px;border-bottom:1px solid #D6DEE4;}
.app.rtl th{text-align:right;}
td{padding:12px 10px;font-size:13px;border-bottom:1px solid #EEF1F3;color:#20242B;}

/* ---------- badges ---------- */
.badge{display:inline-flex;align-items:center;padding:3px 9px;border-radius:10px;font-size:10px;font-weight:700;text-transform:uppercase;}
.badge-teal{background:#E4F2F1;color:#1E7F7A;}
.badge-gold{background:#F8EFDC;color:#8A6A22;}
.badge-gray{background:#EEF1F3;color:#5A6672;}
.badge-navy{background:#E4EAF0;color:#173B5E;}
.badge-alert{background:#FBE9E9;color:#B23B3B;}
.link-btn{font-size:12px;font-weight:600;color:#1E7F7A;border:1px solid #1E7F7A;border-radius:5px;padding:6px 12px;background:#fff;cursor:pointer;font-family:inherit;}
.link-btn.ghost{color:#5A6672;border-color:#D6DEE4;}

/* ---------- patient summary / kv rows ---------- */
.kv{display:flex;justify-content:space-between;font-size:12.5px;padding:7px 0;border-bottom:1px solid #EEF1F3;gap:12px;}
.kv:last-child{border-bottom:none;}
.kv .k{color:#5A6672;flex-shrink:0;}
.kv .v{font-weight:600;text-align:right;}
.app.rtl .kv .v{text-align:left;}

/* ---------- exam / prescription grids ---------- */
.eyegrid{display:grid;grid-template-columns:120px 1fr 1fr;gap:10px 16px;align-items:center;}
.eyegrid .h{font-size:10px;font-weight:700;color:#5A6672;text-transform:uppercase;text-align:center;}
.eyegrid .rowlabel{font-size:11.5px;font-weight:600;color:#5A6672;}
.mini-box{border:1px solid #D6DEE4;border-radius:5px;padding:8px 6px;font-size:12px;text-align:center;color:#20242B;width:100%;font-family:inherit;}
.toggle{display:inline-flex;border:1px solid #D6DEE4;border-radius:6px;overflow:hidden;margin-bottom:16px;}
.toggle label{padding:8px 16px;font-size:12px;font-weight:600;color:#5A6672;cursor:pointer;}
.toggle input{display:none;}
.toggle input:checked + label{background:#1E7F7A;color:#fff;}

/* ---------- diagnosis chips ---------- */
.diag-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:10px;}
.diag-chip{display:flex;align-items:center;gap:6px;background:#E4EAF0;color:#173B5E;font-size:12px;font-weight:600;padding:6px 12px;border-radius:14px;}
.diag-chip button{background:none;border:none;color:#173B5E;cursor:pointer;font-size:14px;line-height:1;padding:0;}
.add-chip{display:inline-flex;align-items:center;gap:6px;border:1px dashed #D6DEE4;color:#5A6672;font-size:12px;font-weight:600;padding:6px 12px;border-radius:14px;background:#fff;cursor:pointer;font-family:inherit;}
.add-chip svg{width:12px;height:12px;}

/* ---------- chat ---------- */
.chat-shell{display:flex;flex-direction:column;height:100%;}
.chat-scroll{flex-grow:1;padding:24px 32px;overflow-y:auto;}
.day-sep{text-align:center;font-size:11px;color:#93A4B0;margin-bottom:16px;}
.msg-row{display:flex;margin-bottom:18px;}
.msg-row.own{justify-content:flex-end;}
.msg-row.other{justify-content:flex-start;}
.msg-block{max-width:60%;}
.msg-sender{font-size:11px;color:#93A4B0;margin-bottom:4px;}
.msg-row.own .msg-sender{text-align:right;}
.app.rtl .msg-row.own .msg-sender{text-align:left;}
.bubble{padding:10px 14px;border-radius:14px;font-size:13px;line-height:1.5;}
.bubble.own{background:#1E7F7A;color:#fff;border-bottom-right-radius:4px;}
.bubble.other{background:#fff;border:1px solid #D6DEE4;color:#20242B;border-bottom-left-radius:4px;}
.msg-time{font-size:10px;color:#93A4B0;margin-top:4px;}
.msg-row.own .msg-time{text-align:right;}
.app.rtl .msg-row.own .msg-time{text-align:left;}
.input-bar{display:flex;gap:10px;padding:16px 32px;border-top:1px solid #D6DEE4;background:#fff;}
.input-bar .field-box{flex-grow:1;}

/* ---------- login ---------- */
.login-frame{width:100%;min-height:100vh;background:#173B5E;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden;}
.login-corner{position:absolute;top:0;left:0;width:100%;height:6px;background:#C79A3D;}
.login-card{width:420px;background:#fff;border-radius:12px;padding:40px 36px 32px 36px;box-shadow:0 20px 50px rgba(0,0,0,0.25);}
.login-mark{width:52px;height:52px;border-radius:12px;background:#1E7F7A;display:flex;align-items:center;justify-content:center;margin:0 auto 18px auto;}
.login-title{font-size:19px;font-weight:700;color:#173B5E;text-align:center;}
.login-sub{font-size:12.5px;color:#5A6672;text-align:center;margin-top:4px;margin-bottom:28px;}
.login-note{display:flex;gap:10px;background:#F2F5F7;border-radius:8px;padding:12px 14px;margin-top:22px;font-size:11.5px;color:#5A6672;line-height:1.5;}
.login-note svg{width:16px;height:16px;flex-shrink:0;color:#1E7F7A;margin-top:1px;}
.login-footer{text-align:center;font-size:10.5px;color:rgba(255,255,255,0.45);margin-top:24px;}
.login-error{background:#FBE9E9;color:#B23B3B;border-radius:8px;padding:10px 14px;font-size:12.5px;margin-bottom:16px;}
.login-flash{background:#E4F2F1;color:#1E7F7A;border-radius:8px;padding:10px 14px;font-size:12.5px;margin-bottom:16px;}

/* ---------- misc ---------- */
.hint{font-size:11px;color:#5A6672;margin-top:-8px;margin-bottom:16px;}
.visit-item{display:flex;gap:14px;padding:16px 0;border-bottom:1px solid #EEF1F3;}
.visit-item:last-child{border-bottom:none;}
.visit-dot{width:9px;height:9px;border-radius:50%;background:#1E7F7A;margin-top:5px;flex-shrink:0;}
.visit-date{font-size:12.5px;font-weight:700;color:#173B5E;}
.visit-detail{font-size:12px;color:#20242B;margin-top:4px;}
.visit-tags{display:flex;gap:6px;margin-top:8px;flex-wrap:wrap;}
.surg-row{font-size:12px;padding:8px 0;border-bottom:1px solid #EEF1F3;}
.surg-row:last-child{border-bottom:none;}
.surg-row .proc{font-weight:600;}
.surg-row .meta{color:#5A6672;margin-top:2px;}
.confirm-box{display:flex;gap:14px;background:#FBF6EA;border:1px solid #EAD9A8;border-radius:9px;padding:18px 20px;align-items:flex-start;}
.confirm-box svg{width:20px;height:20px;color:#8A6A22;flex-shrink:0;margin-top:1px;}
.confirm-box .t{font-size:13px;font-weight:700;color:#8A6A22;margin-bottom:4px;}
.confirm-box .d{font-size:12px;color:#6b5a30;line-height:1.6;}
.col2{display:flex;gap:20px;align-items:flex-start;}
.col-side{flex:1;}
.col-main{flex:2;min-width:0;}
.empty-state{text-align:center;padding:40px 20px;color:#93A4B0;font-size:13px;}
