/* TeamTransit.app — app.css */
*{margin:0;padding:0;box-sizing:border-box}
body{font-family:'Inter',system-ui,sans-serif;color:#0f172a;background:#f8fafc}
a{color:#0ea5e9;text-decoration:none}

/* Sidebar */
.tt-sidebar{position:fixed;top:0;left:0;width:220px;height:100vh;background:#0f172a;color:#fff;display:flex;flex-direction:column;z-index:100}
.tt-sidebar-logo{padding:1.2rem 1rem;font-size:1.2rem;font-weight:900;border-bottom:1px solid #1e293b}
.tt-sidebar-logo a{color:#fff}
.tt-sidebar-logo span{color:#0ea5e9}
.tt-sidebar-nav{flex:1;padding:.5rem 0}
.tt-nav-item{display:flex;align-items:center;gap:.6rem;padding:.6rem 1rem;font-size:.85rem;font-weight:600;color:#94a3b8;transition:all .15s;border-left:3px solid transparent}
.tt-nav-item:hover{color:#fff;background:#1e293b}
.tt-nav-item.active{color:#0ea5e9;border-left-color:#0ea5e9;background:#1e293b}
.tt-nav-icon{font-size:1.1rem;width:22px;text-align:center}
.tt-sidebar-bottom{padding:.75rem 1rem;border-top:1px solid #1e293b}
.tt-sidebar-user{display:flex;align-items:center;gap:.5rem;margin-bottom:.5rem}
.tt-user-avatar{width:28px;height:28px;border-radius:50%;background:#0ea5e9;color:#fff;display:flex;align-items:center;justify-content:center;font-size:.75rem;font-weight:800}
.tt-user-name{font-size:.78rem;font-weight:600;color:#e2e8f0}
.tt-nav-logout{font-size:.78rem;color:#ef4444!important;padding:.4rem 1rem}

/* Main */
.tt-main{margin-left:220px;min-height:100vh}
.tt-topbar{display:flex;align-items:center;gap:1rem;padding:1rem 1.5rem;background:#fff;border-bottom:1px solid #e2e8f0}
.tt-page-title{font-size:1.1rem;font-weight:800}
.tt-hamburger{display:none;background:none;border:none;font-size:1.5rem;cursor:pointer;color:#0f172a}
.tt-content{padding:1.5rem}
.tt-overlay{display:none}

/* Stats */
.tt-stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:1rem;margin-bottom:1.5rem}
.tt-stat-card{background:#fff;border:1.5px solid #e2e8f0;border-radius:.5rem;padding:1rem 1.2rem;text-align:center}
.tt-stat-val{font-size:2rem;font-weight:900;color:#0f172a}
.tt-stat-lbl{font-size:.7rem;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:.04em;margin-top:.2rem}

/* Panel */
.tt-panel{background:#fff;border:1.5px solid #e2e8f0;border-radius:.5rem;overflow:hidden;margin-bottom:1.5rem}
.tt-panel-head{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1rem;border-bottom:1px solid #f1f5f9}
.tt-panel-head h2{font-size:.9rem;font-weight:800}
.tt-panel-footer{padding:.75rem 1rem;border-top:1px solid #f1f5f9;background:#fafbfc}
.tt-empty{padding:2rem;text-align:center;color:#94a3b8;font-size:.88rem}

/* Table */
.tt-table{width:100%;border-collapse:collapse}
.tt-table th{background:#f8fafc;font-size:.7rem;font-weight:700;color:#64748b;text-transform:uppercase;letter-spacing:.04em;padding:.5rem .75rem;text-align:left;border-bottom:1.5px solid #e2e8f0}
.tt-table td{padding:.5rem .75rem;font-size:.85rem;border-bottom:1px solid #f1f5f9;vertical-align:middle}
.tt-table tr:hover{background:#f8fafc}

/* Badge */
.tt-badge{display:inline-block;font-size:.65rem;font-weight:800;padding:.1rem .4rem;border-radius:.2rem;text-transform:uppercase}
.tt-badge-scheduled{background:#dbeafe;color:#1d4ed8}
.tt-badge-in_progress{background:#fef3c7;color:#b45309}
.tt-badge-completed{background:#dcfce7;color:#15803d}
.tt-badge-cancelled{background:#fef2f2;color:#dc2626}
.tt-badge-draft{background:#f1f5f9;color:#64748b}

/* Buttons */
.tt-btn{display:inline-flex;align-items:center;padding:.5rem 1.2rem;border-radius:.4rem;font-size:.82rem;font-weight:700;border:none;cursor:pointer;font-family:inherit;transition:all .15s}
.tt-btn-sm{padding:.35rem .8rem;font-size:.78rem}
.tt-btn-primary{background:#0ea5e9;color:#fff}
.tt-btn-primary:hover{background:#0284c7}
.tt-btn-outline{border:1.5px solid #e2e8f0;color:#0f172a;background:#fff}
.tt-btn-outline:hover{border-color:#0ea5e9;color:#0ea5e9}
.tt-btn-link{background:none;border:none;color:#0ea5e9;cursor:pointer;font-size:.8rem;font-weight:600;padding:0;font-family:inherit}

/* Forms */
.tt-form{padding:1rem}
.tt-form-row{display:flex;gap:.75rem;margin-bottom:.75rem}
.tt-form-group{flex:1;display:flex;flex-direction:column}
.tt-form-group label{font-size:.72rem;font-weight:700;color:#64748b;margin-bottom:.2rem;text-transform:uppercase;letter-spacing:.04em}
.tt-form-group input,.tt-form-group select,.tt-form-group textarea{padding:.5rem .6rem;border:1.5px solid #e2e8f0;border-radius:.35rem;font-size:.85rem;font-family:inherit;transition:border-color .15s}
.tt-form-group input:focus,.tt-form-group select:focus,.tt-form-group textarea:focus{outline:none;border-color:#0ea5e9}
.tt-form-actions{display:flex;gap:.5rem;align-items:center;padding-top:.75rem;border-top:1px solid #f1f5f9;margin-top:.5rem}

/* Flash */
.tt-flash{padding:.6rem 1.5rem;font-size:.85rem;font-weight:600}
.tt-flash-success{background:#f0fdf4;color:#16a34a;border-bottom:1px solid #bbf7d0}
.tt-flash-error{background:#fef2f2;color:#dc2626;border-bottom:1px solid #fecaca}

/* Mobile */
@media(max-width:768px){
  .tt-sidebar{left:-220px;transition:left .25s}
  body.sidebar-open .tt-sidebar{left:0}
  body.sidebar-open .tt-overlay{display:block;position:fixed;inset:0;background:rgba(0,0,0,.4);z-index:99}
  .tt-main{margin-left:0}
  .tt-hamburger{display:block}
  .tt-stats-grid{grid-template-columns:repeat(2,1fr)}
  .tt-form-row{flex-direction:column}
}

/* Nav groups with tree connector lines (S116) */
.tt-nav-group-label{display:flex;align-items:center;gap:.5rem;font-size:.65rem;font-weight:800;color:#64748b;text-transform:uppercase;letter-spacing:.08em;padding:.85rem 1rem .3rem}
.tt-nav-group-label svg{opacity:.5;flex-shrink:0}
.tt-nav-group-items{position:relative;margin-left:1.45rem;border-left:1px solid #334155;margin-bottom:.15rem}
.tt-nav-nested{display:flex;align-items:center;padding:.45rem 1rem .45rem 1.4rem!important;font-size:.82rem;position:relative}
.tt-nav-nested::before{content:'';position:absolute;left:0;top:50%;width:.7rem;height:0;border-top:1px solid #334155}
.tt-nav-nested svg{display:none}
.tt-nav-group-items .tt-nav-nested:last-child{position:relative}
.tt-nav-group-items .tt-nav-nested:last-child::after{content:'';position:absolute;left:-1px;top:50%;bottom:-1px;width:1px;background:#0f172a}

/* User profile link (S116) */
.tt-user-link{text-decoration:none;cursor:pointer;border-radius:.4rem;padding:.4rem .5rem!important;transition:background .15s}
.tt-user-link:hover{background:#1e293b}
.tt-user-link .tt-user-name{color:#e2e8f0}
.tt-user-link:hover .tt-user-name{color:#fff}

/* Avatar image (S116) */
.tt-user-avatar-img{width:28px;height:28px;border-radius:50%;object-fit:cover;flex-shrink:0}
.tt-profile-avatar-img{width:56px;height:56px;border-radius:50%;object-fit:cover;flex-shrink:0;border:2px solid #e2e8f0}

/* Profile page (S116) */
.tt-profile-header{display:flex;align-items:center;gap:1rem;margin-bottom:1.5rem}
.tt-profile-avatar{width:56px;height:56px;border-radius:50%;background:#0ea5e9;color:#fff;display:flex;align-items:center;justify-content:center;font-size:1.5rem;font-weight:900;flex-shrink:0}
.tt-profile-name{font-size:1.1rem;font-weight:800}
.tt-profile-email{font-size:.85rem;color:#64748b}

/* Avatar upload (S116) */
.tt-avatar-upload{display:flex;align-items:center;gap:1rem;padding:1rem}
.tt-avatar-preview{width:80px;height:80px;border-radius:50%;object-fit:cover;border:2px solid #e2e8f0;flex-shrink:0}
.tt-avatar-placeholder{width:80px;height:80px;border-radius:50%;background:#0ea5e9;color:#fff;display:flex;align-items:center;justify-content:center;font-size:2rem;font-weight:900;flex-shrink:0}
.tt-file-input{font-size:.82rem;font-family:inherit}
.tt-file-hint{font-size:.75rem;color:#94a3b8;margin-top:.25rem}

/* Logo images (S102) */
.tt-logo img{height:36px;width:auto}
.tt-sidebar-logo img{height:32px;width:auto}
.auth-logo img{height:56px;width:auto}

/* S128: Trip status badge styles */
.tt-badge-pending{background:#fef3c7;color:#92400e;border:1px solid #f59e0b}
.tt-badge-approved{background:#d1fae5;color:#065f46;border:1px solid #10b981}
.tt-badge-rejected{background:#fee2e2;color:#991b1b;border:1px solid #ef4444}
.tt-badge-scheduled{background:#dbeafe;color:#1e40af;border:1px solid #3b82f6}
.tt-badge-in_progress{background:#e0e7ff;color:#3730a3;border:1px solid #6366f1}
.tt-badge-completed{background:#f1f5f9;color:#475569;border:1px solid #94a3b8}
.tt-badge-cancelled{background:#fef2f2;color:#dc2626;border:1px solid #fca5a5}

/* S128: Pending request highlight row */
tr.tt-pending-row{background:#fffbeb}
tr.tt-pending-row:hover{background:#fef3c7}

/* S128: Approval action buttons */
.tt-btn-approve{background:#059669;color:#fff;border:none;padding:.3rem .7rem;border-radius:.375rem;font-size:.78rem;font-weight:600;cursor:pointer}
.tt-btn-approve:hover{background:#047857}
.tt-btn-reject{background:#dc2626;color:#fff;border:none;padding:.3rem .7rem;border-radius:.375rem;font-size:.78rem;font-weight:600;cursor:pointer}
.tt-btn-reject:hover{background:#b91c1c}

/* S128: Template card */
.tt-template-card{border:1.5px solid #e2e8f0;border-radius:.55rem;padding:1rem 1.25rem;background:#fff;transition:border-color .15s}
.tt-template-card:hover{border-color:#93c5fd}
.tt-template-card-name{font-weight:700;font-size:.95rem;color:#1e293b;margin-bottom:.35rem}
.tt-template-card-meta{font-size:.78rem;color:#64748b}