/* ============================================
   SKALA SISTEMA - ADMIN PANEL CSS
   Design system matching Flutter app identity
   ============================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ---- CSS Variables ---- */
:root {
    /* Core palette */
    --primary: #0084ff;
    --primary-light: #339dff;
    --primary-hover: #0070d6;
    --green: #4CAF50;
    --orange: #FF7043;
    --red: #EF5350;
    --blue: #42A5F5;
    --purple: #AB47BC;
    --amber: #FFC107;

    /* Text */
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;

    /* Backgrounds */
    --bg-page: #0a0a0a;
    --bg-card: #141414;
    --bg-input: #1a1a1a;
    --bg-sidebar: #111111;
    --bg-disabled: #1e1e1e;

    /* Greys (inverted for dark theme) */
    --grey-100: #1a1a1a;
    --grey-200: #222222;
    --grey-300: #333333;
    --grey-400: #555555;
    --grey-500: #888888;
    --grey-600: #aaaaaa;
    --grey-700: #cccccc;

    /* Layout */
    --sidebar-width: 260px;
    --topbar-height: 64px;

    /* Border radius */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-top: 0 -4px 16px rgba(0, 0, 0, 0.3);

    /* Font */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    border: none;
    outline: none;
    background: none;
}

button {
    cursor: pointer;
}

/* ---- Layout ---- */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--grey-200);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform 0.3s ease;
}

.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--grey-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    z-index: 50;
}

.admin-content {
    flex: 1;
    padding: 28px;
}

/* ---- Sidebar ---- */
.sidebar-logo {
    padding: 24px 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--grey-200);
}

.sidebar-logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.sidebar-logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.sidebar-section {
    margin-bottom: 8px;
}

.sidebar-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--grey-500);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 12px 12px 8px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--grey-600);
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.sidebar-item:hover {
    background: var(--grey-100);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: var(--primary);
    color: #fff;
}

.sidebar-item .icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
}

.sidebar-item .badge-count {
    margin-left: auto;
    background: var(--orange);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-item.active .badge-count {
    background: rgba(255, 255, 255, 0.25);
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--grey-200);
}

/* ---- Topbar ---- */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--grey-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey-500);
    font-size: 18px;
}

.topbar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.topbar-user-role {
    font-size: 11px;
    color: var(--grey-500);
}

.hamburger-btn {
    display: none;
    font-size: 22px;
    color: var(--text-primary);
    padding: 4px;
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ---- Stat Cards ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.stat-card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 14px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--grey-500);
}

/* ---- Tables ---- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--grey-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--grey-200);
}

.admin-table td {
    padding: 14px 16px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--grey-100);
    vertical-align: middle;
}

.admin-table tr:hover td {
    background: var(--grey-100);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.table-cell-main {
    font-weight: 600;
    color: var(--text-primary);
}

.table-cell-sub {
    font-size: 12px;
    color: var(--grey-500);
    margin-top: 2px;
}

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-sm {
    padding: 2px 8px;
    font-size: 11px;
    border-radius: var(--radius-xs);
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.badge-dark {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.badge-green {
    background: rgba(46, 125, 50, 0.1);
    color: var(--green);
}

.badge-orange {
    background: rgba(230, 81, 0, 0.1);
    color: var(--orange);
}

.badge-red {
    background: rgba(198, 40, 40, 0.1);
    color: var(--red);
}

.badge-blue {
    background: rgba(21, 101, 192, 0.1);
    color: var(--blue);
}

.badge-purple {
    background: rgba(106, 27, 154, 0.1);
    color: var(--purple);
}

.badge-grey {
    background: var(--grey-200);
    color: var(--grey-600);
}

/* ---- Progress Bars ---- */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--grey-200);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-bar-fill.dark { background: var(--primary); }
.progress-bar-fill.green { background: var(--green); }
.progress-bar-fill.orange { background: var(--orange); }
.progress-bar-fill.red { background: var(--red); }

/* Circular Progress */
.progress-circle {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.progress-circle-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    z-index: 1;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 24px;
    font-size: 16px;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-green {
    background: var(--green);
    color: #fff;
}
.btn-green:hover {
    background: #256d2b;
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--grey-300);
    color: var(--grey-600);
}
.btn-outline:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.btn-outline-red {
    background: transparent;
    border: 1.5px solid var(--red);
    color: var(--red);
}
.btn-outline-red:hover {
    background: rgba(198, 40, 40, 0.05);
}

.btn-ghost {
    background: transparent;
    color: var(--grey-600);
    padding: 8px 12px;
}
.btn-ghost:hover {
    background: var(--grey-100);
    color: var(--text-primary);
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-primary);
    transition: border-color 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    border-width: 2px;
    padding: 11px 15px;
    background: var(--bg-card);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--grey-400);
}

.form-input:disabled {
    background: var(--bg-disabled);
    color: var(--grey-500);
    cursor: not-allowed;
}

/* Custom File Input */
.file-input-wrapper {
    position: relative;
    display: inline-flex;
    width: 100%;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-input-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-input);
    border: 1px dashed var(--grey-300);
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--grey-500);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    width: 100%;
    justify-content: center;
}

.file-input-wrapper:hover .file-input-btn {
    border-color: var(--primary);
    background: rgba(0, 132, 255, 0.1);
    color: var(--primary);
}

.file-input-btn .material-icons-outlined {
    font-size: 16px;
}

.file-input-btn .file-name {
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%239E9E9E' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-input-icon {
    position: relative;
}

.form-input-icon .icon-left {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--grey-500);
    font-size: 18px;
}

.form-input-icon .form-input {
    padding-left: 42px;
}

.form-input-icon .icon-right {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--grey-400);
    font-size: 18px;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* ---- Tabs ---- */
.tabs {
    display: flex;
    gap: 4px;
    background: var(--grey-200);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 20px;
}

.tab-item {
    flex: 1;
    padding: 8px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--grey-600);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all 0.15s ease;
}

.tab-item:hover {
    color: var(--text-primary);
}

.tab-item.active {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Underline tabs variant */
.tabs-underline {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--grey-200);
    margin-bottom: 20px;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.tabs-underline .tab-item {
    flex: none;
    padding: 10px 20px;
    border-radius: 0;
    position: relative;
    background: transparent;
}

.tabs-underline .tab-item.active {
    background: transparent;
    color: var(--text-primary);
}

.tabs-underline .tab-item.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2.5px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
}

/* ---- Filters ---- */
.filters-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--bg-card);
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--grey-600);
    cursor: pointer;
    transition: all 0.15s ease;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.filter-btn.active {
    background: rgba(0, 132, 255, 0.1);
    border-color: rgba(0, 132, 255, 0.3);
    color: var(--primary);
    font-weight: 600;
}

/* ---- Timeline ---- */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline-item {
    position: relative;
    padding-bottom: 24px;
    padding-left: 28px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 36px;
    bottom: 0;
    width: 2px;
    background: var(--grey-200);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-icon {
    position: absolute;
    left: -36px;
    top: 0;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.timeline-card {
    background: var(--bg-card);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-md);
    padding: 14px;
}

.timeline-card.pending {
    background: var(--grey-100);
}

.timeline-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.timeline-card.pending .timeline-title {
    color: var(--grey-400);
}

.timeline-desc {
    font-size: 13px;
    color: var(--grey-600);
    margin-bottom: 8px;
}

.timeline-card.pending .timeline-desc {
    color: var(--grey-400);
}

.timeline-meta {
    display: flex;
    gap: 16px;
    font-size: 11px;
    color: var(--grey-400);
}

.timeline-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ---- Chat ---- */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 0;
}

.chat-msg {
    display: flex;
    gap: 10px;
    max-width: 75%;
}

.chat-msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chat-msg-bubble {
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.4;
}

.chat-msg-author {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}

.chat-msg-time {
    font-size: 11px;
    margin-top: 6px;
}

/* Client message - left aligned, neutral bg (they are the other party) */
.chat-msg-client {
    align-self: flex-start;
}

.chat-msg-client .chat-msg-avatar {
    background: var(--grey-200);
    color: var(--grey-600);
}

.chat-msg-client .chat-msg-bubble {
    background: var(--bg-card);
    border: 1px solid var(--grey-200);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-msg-client .chat-msg-time {
    color: var(--grey-400);
}

/* Dev/Admin message - right aligned, primary bg (this is "us") */
.chat-msg-dev {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg-dev .chat-msg-avatar {
    background: var(--primary);
    color: #fff;
}

.chat-msg-dev .chat-msg-bubble {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-msg-dev .chat-msg-author {
    opacity: 0.7;
}

.chat-msg-dev .chat-msg-time {
    opacity: 0.5;
}

/* Internal notes */
.chat-msg-internal {
    align-self: flex-start;
    max-width: 100%;
}

/* Chat input */
.chat-input-area {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    padding: 16px 0;
    border-top: 1px solid var(--grey-200);
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    background: var(--grey-100);
    border-radius: 24px;
    font-size: 14px;
    color: var(--text-primary);
    border: none;
    resize: none;
    min-height: 44px;
    max-height: 120px;
}

.chat-input::placeholder {
    color: var(--grey-400);
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    transition: background 0.15s ease;
}

.chat-send-btn:hover {
    background: var(--primary-hover);
}

/* ---- Credential Cards ---- */
.cred-card {
    background: var(--bg-card);
    border: 1px solid var(--grey-200);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.cred-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.cred-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.cred-env {
    font-size: 15px;
    font-weight: 700;
}

.cred-field {
    margin-bottom: 12px;
}

.cred-field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--grey-400);
    margin-bottom: 4px;
}

.cred-field-value {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--grey-100);
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.cred-field-value .copy-btn {
    color: var(--grey-500);
    font-size: 16px;
    cursor: pointer;
    transition: color 0.15s;
}

.cred-field-value .copy-btn:hover {
    color: var(--text-primary);
}

/* ---- Warning/Info Banners ---- */
.banner-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(249, 168, 37, 0.1);
    border: 1px solid rgba(249, 168, 37, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.banner-warning .icon {
    color: var(--amber);
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.banner-warning .text {
    font-size: 13px;
    font-weight: 500;
    color: var(--amber);
    line-height: 1.4;
}

.banner-info {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(249, 168, 37, 0.1);
    border: 1px solid rgba(249, 168, 37, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.banner-info .icon {
    color: var(--amber);
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.banner-info .text {
    font-size: 13px;
    color: var(--orange);
    line-height: 1.5;
}

/* ---- Avatar ---- */
.avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--grey-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--grey-500);
    font-size: 18px;
    flex-shrink: 0;
}

.avatar-lg {
    width: 112px;
    height: 112px;
    font-size: 48px;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.avatar-initials {
    font-weight: 600;
    font-size: 16px;
    color: var(--grey-600);
}

/* ---- Section Headers ---- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 13px;
    color: var(--grey-500);
    margin-top: 2px;
}

/* ---- Page Headers ---- */
.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 14px;
    color: var(--grey-500);
}

.page-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

/* ---- Document/File Items ---- */
.file-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--grey-100);
}

.file-item:last-child {
    border-bottom: none;
}

.file-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.file-info {
    flex: 1;
}

.file-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.file-meta {
    font-size: 12px;
    color: var(--grey-400);
    margin-top: 2px;
}

.file-actions {
    display: flex;
    gap: 8px;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state .icon {
    font-size: 48px;
    color: var(--grey-300);
    margin-bottom: 12px;
}

.empty-state .text {
    font-size: 15px;
    color: var(--grey-400);
}

/* ---- Priority Icons ---- */
.priority-alta {
    color: var(--red);
}

.priority-media {
    color: var(--orange);
}

.priority-baixa {
    color: var(--grey-500);
}

/* ---- Utility Classes ---- */
.text-primary { color: var(--text-primary); }
.text-green { color: var(--green); }
.text-orange { color: var(--orange); }
.text-red { color: var(--red); }
.text-blue { color: var(--blue); }
.text-purple { color: var(--purple); }
.text-grey { color: var(--grey-500); }

.bg-green-light { background: rgba(46, 125, 50, 0.1); }
.bg-orange-light { background: rgba(230, 81, 0, 0.1); }
.bg-red-light { background: rgba(198, 40, 40, 0.1); }
.bg-blue-light { background: rgba(21, 101, 192, 0.1); }
.bg-purple-light { background: rgba(106, 27, 154, 0.1); }
.bg-dark-light { background: rgba(255, 255, 255, 0.06); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-4 { gap: 4px; }
.gap-6 { gap: 6px; }
.gap-8 { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-28 { margin-top: 28px; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-28 { margin-bottom: 28px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-500 { font-weight: 500; }
.font-600 { font-weight: 600; }
.font-700 { font-weight: 700; }
.text-xs { font-size: 11px; }
.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-page);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.login-logo-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.login-logo-text {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 14px;
    color: var(--grey-500);
    text-align: center;
    margin-bottom: 32px;
}

/* ---- Profile Page ---- */
.profile-section {
    max-width: 560px;
    margin: 0 auto;
}

.profile-avatar-wrapper {
    position: relative;
    display: inline-block;
}

.profile-avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: var(--primary);
    border: 3px solid var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.profile-section-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--grey-500);
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

/* ---- Responsive ---- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
}

@media (max-width: 1024px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .admin-main {
        margin-left: 0;
    }

    .hamburger-btn {
        display: flex;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .admin-content {
        padding: 20px 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-header-row {
        flex-direction: column;
        gap: 12px;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .chat-msg {
        max-width: 90%;
    }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--grey-300);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--grey-400);
}

/* ---- Modal Alert ---- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalFadeIn 200ms ease-out;
}

.modal-overlay.closing {
    animation: modalFadeOut 150ms ease-in forwards;
}

.modal-alert {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: modalScaleIn 200ms ease-out;
}

.modal-overlay.closing .modal-alert {
    animation: modalScaleOut 150ms ease-in forwards;
}

.modal-alert-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.modal-alert-icon .material-icons-outlined {
    font-size: 28px;
}

.modal-alert-icon.icon-success {
    background: rgba(46, 125, 50, 0.1);
    color: var(--green);
}

.modal-alert-icon.icon-error {
    background: rgba(198, 40, 40, 0.1);
    color: var(--red);
}

.modal-alert-icon.icon-confirm {
    background: rgba(249, 168, 37, 0.1);
    color: var(--amber);
}

.modal-alert-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.modal-alert-message {
    font-size: 14px;
    color: var(--grey-600);
    line-height: 1.5;
    margin-bottom: 24px;
}

.modal-alert-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.modal-alert-actions .btn {
    min-width: 120px;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes modalScaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes modalScaleOut {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(0.9); opacity: 0; }
}

/* ---- Pagination ---- */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
}

.pagination-info {
    font-size: 13px;
    color: var(--grey-500);
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-nav .page-item {
    display: inline-flex;
}

.pagination-nav .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--grey-300);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    color: var(--grey-600);
    background: var(--bg-card);
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
}

.pagination-nav .page-link:hover {
    border-color: var(--primary);
    color: var(--text-primary);
    background: var(--grey-100);
}

.pagination-nav .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.pagination-nav .page-item.active .page-link:hover {
    background: var(--primary-hover);
}

.pagination-nav .page-item.disabled .page-link {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-nav .page-link .material-icons-outlined {
    font-size: 18px;
}

.pagination-nav .page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    font-size: 13px;
    color: var(--grey-400);
}

@media (max-width: 640px) {
    .pagination-wrapper {
        flex-direction: column;
        gap: 12px;
    }
}
