
/* Basic RTL friendly styling */
:root{
  --bg:#fafafa;
  --card-radius:12px;
  --fab-size:64px;
}
*{box-sizing:border-box;font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Noto Naskh Arabic",sans-serif}
html,body{height:100%;margin:0;background:var(--bg);color:#222}
.app-header{
  height:56px;background:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 12px;border-bottom:1px solid #eee;
  position:sticky;top:0;z-index:50;
}
.app-header h1{font-size:18px;margin:0}
.app-header button{background:transparent;border:0;font-size:18px;padding:6px;cursor:pointer}
.view{padding:16px}
.hidden{display:none}
.materials-list{display:flex;flex-wrap:wrap;gap:12px}
.material-card{
  min-width:160px;flex:1 1 160px;padding:12px;border-radius:12px;color:#fff;display:flex;flex-direction:column;gap:8px;cursor:pointer;box-shadow:0 6px 12px rgba(0,0,0,0.06);
}
.material-meta{display:flex;align-items:center;gap:8px;justify-content:space-between}
.material-icon{font-size:28px}
.fab{position:fixed;bottom:18px;left:18px;background:#1976d2;color:#fff;border:0;width:var(--fab-size);height:var(--fab-size);border-radius:50%;font-size:28px;display:flex;align-items:center;justify-content:center;box-shadow:0 8px 18px rgba(0,0,0,0.15);cursor:pointer}
.fab.small{width:52px;height:52px;bottom:18px;left:18px}
.subject-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-bottom:8px}
.tabs{display:flex;gap:8px;margin-bottom:12px}
.tab{flex:1;padding:8px;border-radius:8px;color:#fff;border:0;cursor:pointer}
.tab.active{outline:3px solid rgba(0,0,0,0.05)}
.tab-contents{min-height:240px}
.grid{display:flex;flex-wrap:wrap;gap:10px}
.note-card, .pdf-card, .image-box, .audio-card{
  background:#fff;border-radius:10px;padding:10px;min-width:120px;flex:0 0 140px;box-shadow:0 4px 10px rgba(0,0,0,0.06);position:relative;cursor:pointer;
}
.note-title{font-weight:700;margin-bottom:6px}
.note-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dialogs{position:fixed;inset:0;display:grid;place-items:center;pointer-events:none}
.dialog{width:92%;max-width:520px;background:#fff;padding:14px;border-radius:12px;box-shadow:0 20px 60px rgba(0,0,0,0.2);pointer-events:auto}
.dialog label{display:block;margin:8px 0}
.dialog input, .dialog textarea, .dialog select{width:100%;padding:8px;border-radius:8px;border:1px solid #ddd}
.dialog-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:12px}
.small-icon{position:absolute;left:8px;top:8px;font-size:14px;opacity:0.9}
.long-press-hint{font-size:12px;color:#666;margin-top:6px}
.audio-time{font-size:12px;color:#333;margin-top:8px}
