/* ==========================================
   CALENDAR MODULE STYLES
   ========================================== */

/* Calendar Page Layout */
.calendar-page {
    padding: 24px;
    background: #f5f7fa;
    height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Calendar Header */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.calendar-title h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-title h1 i {
    color: #2d5a27;
}

.btn-add-event {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #2d5a27 0%, #4a7c43 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(45, 90, 39, 0.3);
}

.btn-add-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 90, 39, 0.4);
}

/* Calendar Container */
.calendar-container {
    display: grid;
    grid-template-columns: 350px 1fr 350px;
    gap: 24px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Main Calendar Area */
.calendar-main {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Calendar Navigation */
.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eef2f7;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-today {
    padding: 8px 16px;
    background: #f0f4f8;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-today:hover {
    background: #e2e8f0;
    color: #2d5a27;
}

.nav-arrows {
    display: flex;
    gap: 4px;
}

.btn-nav {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f4f8;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-nav:hover {
    background: #2d5a27;
    border-color: #2d5a27;
    color: white;
}

.current-period {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a2e;
    min-width: 200px;
}

/* View Switcher */
.view-switcher {
    display: flex;
    background: #f0f4f8;
    border-radius: 10px;
    padding: 4px;
}

.view-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-btn:hover {
    color: #2d5a27;
}

.view-btn.active {
    background: white;
    color: #2d5a27;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Calendar Grid Wrapper */
.calendar-grid-wrapper {
    padding: 0;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   MONTH VIEW
   ========================================== */
.month-view {
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.month-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: #f8fafc;
    border-bottom: 1px solid #eef2f7;
}

.weekday {
    padding: 12px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.weekday.weekend {
    color: #e53e3e;
}

.month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(6, 1fr);
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.day-cell {
    border-right: 1px solid #eef2f7;
    border-bottom: 1px solid #eef2f7;
    padding: 8px;
    min-height: 0;
    cursor: pointer;
    transition: background 0.2s ease;
    position: relative;
    overflow: hidden;
}

.day-cell:hover {
    background: #f8fafc;
}

.day-cell:nth-child(7n) {
    border-right: none;
}

.day-cell.other-month {
    background: #fafbfc;
}

.day-cell.other-month .day-number {
    color: #cbd5e0;
}

.day-cell.today {
    background: rgba(45, 90, 39, 0.05);
}

.day-cell.today .day-number {
    background: transparent;
    color: #2d5a27;
    border: 2px solid #2d5a27;
    font-weight: 600;
}

.day-cell.selected {
    background: rgba(45, 90, 39, 0.1);
}

.day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a1a2e;
    border-radius: 50%;
    margin-bottom: 4px;
}

.day-cell.weekend .day-number {
    color: #e53e3e;
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.day-event {
    padding: 2px 6px;
    font-size: 0.75rem;
    border-radius: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.day-event:hover {
    transform: translateX(2px);
}

.day-event.transport {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
    border-left: 3px solid #3b82f6;
}

.day-event.meeting {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
    border-left: 3px solid #10b981;
}

.day-event.deadline {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
    border-left: 3px solid #ef4444;
}

.day-event.other {
    background: rgba(139, 92, 246, 0.15);
    color: #7c3aed;
    border-left: 3px solid #8b5cf6;
}

.more-events {
    font-size: 0.7rem;
    color: #64748b;
    padding: 2px 6px;
    cursor: pointer;
}

.more-events:hover {
    color: #2d5a27;
}

/* ==========================================
   WEEK VIEW
   ========================================== */
.week-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.week-header {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    background: #f8fafc;
    border-bottom: 1px solid #eef2f7;
}

.week-header-cell {
    padding: 12px 8px;
    text-align: center;
    border-right: 1px solid #eef2f7;
}

.week-header-cell:last-child {
    border-right: none;
}

.week-header-cell.time-gutter {
    background: #f0f4f8;
}

.week-day-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.week-day-number {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-top: 4px;
}

.week-header-cell.today .week-day-number {
    background: transparent;
    color: #2d5a27;
    border: 2px solid #2d5a27;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.week-timeline {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
}

.time-slot {
    height: 60px;
    border-bottom: 1px solid #eef2f7;
    border-right: 1px solid #eef2f7;
    position: relative;
}

.time-slot:last-child {
    border-right: none;
}

.time-label {
    font-size: 0.75rem;
    color: #94a3b8;
    text-align: right;
    padding-right: 8px;
    position: relative;
    top: -8px;
}

.week-event {
    position: absolute;
    left: 2px;
    right: 2px;
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    z-index: 1;
}

/* Week All-Day Row */
.week-all-day-row {
    display: flex;
    align-items: stretch;
    background: #fefce8;
    border-bottom: 2px solid #eef2f7;
    min-height: 36px;
}

.week-all-day-label {
    width: 60px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    border-right: 1px solid #eef2f7;
    background: #f0f4f8;
}

.week-all-day-cells {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    flex: 1;
}

.week-all-day-cell {
    padding: 4px;
    border-right: 1px solid #eef2f7;
    min-height: 32px;
}

.week-all-day-cell:last-child {
    border-right: none;
}

.week-all-day-cell .week-event {
    position: relative;
    left: auto;
    right: auto;
    margin-bottom: 2px;
}

/* ==========================================
   DAY VIEW
   ========================================== */
.day-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.day-header {
    padding: 20px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #eef2f7;
    text-align: center;
}

.day-header .day-name {
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.day-header .day-date {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-top: 4px;
}

/* Day All-Day Section */
.day-all-day-section {
    display: flex;
    align-items: stretch;
    background: #fefce8;
    border-bottom: 2px solid #eef2f7;
    min-height: 40px;
}

.day-all-day-label {
    width: 80px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    border-right: 1px solid #eef2f7;
}

.day-all-day-events {
    flex: 1;
    padding: 6px 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.day-all-day-events .day-event-item {
    margin-bottom: 0;
}

.day-timeline {
    flex: 1;
    overflow-y: auto;
}

.day-time-slot {
    display: flex;
    min-height: 60px;
    border-bottom: 1px solid #eef2f7;
}

.day-time-label {
    width: 80px;
    padding: 8px;
    font-size: 0.8rem;
    color: #94a3b8;
    text-align: right;
    border-right: 1px solid #eef2f7;
    flex-shrink: 0;
}

.day-time-content {
    flex: 1;
    padding: 4px 8px;
    position: relative;
}

.day-event-item {
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 4px;
    cursor: pointer;
}

/* ==========================================
   YEAR VIEW
   ========================================== */
.year-view {
    padding: 24px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.year-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.year-month {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.year-month:hover {
    background: #eef2f7;
    transform: translateY(-2px);
}

.year-month-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 12px;
    text-align: center;
}

.year-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    font-size: 0.7rem;
}

.year-day {
    text-align: center;
    padding: 4px 2px;
    color: #64748b;
    border-radius: 4px;
}

.year-day.today {
    background: transparent;
    color: #2d5a27;
    border: 2px solid #2d5a27;
    font-weight: 600;
}

.year-day.has-event {
    background: rgba(45, 90, 39, 0.2);
    color: #2d5a27;
    font-weight: 600;
}

.year-day.other-month {
    color: #e2e8f0;
}

/* ==========================================
   CALENDAR SIDEBAR
   ========================================== */
/* Left Sidebar - Empty */
.calendar-sidebar-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    max-height: 100%;
}

.calendar-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
    max-height: 100%;
}

/* Sidebar Event Form */
.sidebar-event-form {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    flex: 1 1 50%;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-form-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar-form-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.sidebar-form-header h3 i {
    color: #2d5a27;
}

.sidebar-event-form .form-group {
    margin-bottom: 12px;
}

.sidebar-event-form .form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 4px;
}

.sidebar-event-form .form-group input,
.sidebar-event-form .form-group select,
.sidebar-event-form .form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.sidebar-event-form .form-group input:focus,
.sidebar-event-form .form-group select:focus,
.sidebar-event-form .form-group textarea:focus {
    outline: none;
    border-color: #2d5a27;
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.1);
}

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

.sidebar-event-form .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: #475569;
}

.sidebar-event-form .checkbox-label input {
    width: auto;
}

.sidebar-event-form .form-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

.sidebar-event-form .btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.sidebar-event-form .btn-primary {
    background: linear-gradient(135deg, #2d5a27 0%, #4a9142 100%);
    color: white;
    border: none;
    margin-left: auto;
}

.sidebar-event-form .btn-primary:hover {
    background: linear-gradient(135deg, #1e3d1a 0%, #2d5a27 100%);
    box-shadow: 0 4px 12px rgba(45, 90, 39, 0.3);
}

.sidebar-event-form .btn-secondary {
    background: #f1f5f9;
    color: #64748b;
}

.sidebar-event-form .btn-secondary:hover {
    background: #e2e8f0;
}

.sidebar-event-form .btn-danger {
    background: #fee2e2;
    color: #dc2626;
}

.sidebar-event-form .btn-danger:hover {
    background: #fecaca;
}

/* Relation Search Field */
.relation-search-container {
    position: relative;
}

.relation-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.relation-icon {
    position: absolute;
    left: 12px;
    color: #94a3b8;
    font-size: 0.85rem;
    pointer-events: none;
}

.relation-input-wrapper input {
    padding-left: 34px !important;
    padding-right: 32px !important;
}

.relation-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    display: none;
    font-size: 0.8rem;
}

.relation-search-container.has-value .relation-clear {
    display: block;
}

.relation-clear:hover {
    color: #64748b;
}

.relation-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-height: 250px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.relation-results.active {
    display: block;
}

.relation-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f1f5f9;
}

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

.relation-result-item:hover {
    background: #f8fafc;
}

.relation-result-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.relation-result-icon.contractor {
    background: #dbeafe;
    color: #2563eb;
}

.relation-result-icon.agreement {
    background: #dcfce7;
    color: #16a34a;
}

.relation-result-icon.sales {
    background: #fef3c7;
    color: #d97706;
}

.relation-result-icon.transport-order {
    background: #f3e8ff;
    color: #9333ea;
}

.relation-result-icon.transport {
    background: #e0e7ff;
    color: #4f46e5;
}

.relation-result-content {
    flex: 1;
    min-width: 0;
}

.relation-result-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: #1a1a2e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.relation-result-subtitle {
    font-size: 0.75rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.relation-result-type {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #64748b;
    flex-shrink: 0;
}

.relation-no-results {
    padding: 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
}

.relation-selected {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    margin-top: 8px;
}

.relation-badge {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #166534;
}

.relation-badge i {
    font-size: 0.8rem;
}

.relation-remove {
    background: none;
    border: none;
    color: #dc2626;
    cursor: pointer;
    padding: 4px;
    font-size: 0.8rem;
}

.relation-remove:hover {
    color: #b91c1c;
}

/* Right Sidebar */
.calendar-sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    max-height: 100%;
}

.upcoming-events-list {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    flex: 1;
    max-height: 400px;
    overflow-y: auto;
}

.sidebar-section {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.sidebar-section h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.sidebar-section h3 i {
    color: #2d5a27;
}

.sidebar-subtitle {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 16px;
}

/* Upcoming Events */
.upcoming-events {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    flex: 1 1 50%;
    min-height: 0;
    overflow-y: auto;
}

.selected-date-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef2f7;
}

.selected-date-header h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.selected-date-header h4 i {
    color: #2d5a27;
}

.upcoming-event-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upcoming-event-item:hover {
    background: #eef2f7;
    transform: translateX(4px);
}

.upcoming-event-item:last-child {
    margin-bottom: 0;
}

.event-date-badge {
    flex-shrink: 0;
    width: 50px;
    text-align: center;
    padding: 8px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.event-date-badge .day {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
}

.event-date-badge .month {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
}

.event-details {
    flex: 1;
    min-width: 0;
}

.event-details h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-details .event-time {
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.event-category-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.event-category-dot.transport { background: #3b82f6; }
.event-category-dot.meeting { background: #10b981; }
.event-category-dot.deadline { background: #ef4444; }
.event-category-dot.other { background: #8b5cf6; }

.no-events {
    text-align: center;
    padding: 24px;
    color: #94a3b8;
}

.no-events i {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
}

/* Mini Calendar */
.mini-calendar-section {
    padding: 16px;
}

.mini-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mini-month {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1a1a2e;
}

.mini-nav {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f4f8;
    border: none;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mini-nav:hover {
    background: #2d5a27;
    color: white;
}

.mini-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.mini-calendar-weekdays span {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    padding: 4px;
}

.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.mini-day {
    text-align: center;
    font-size: 0.8rem;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #4a5568;
}

.mini-day:hover {
    background: #eef2f7;
}

.mini-day.other-month {
    color: #cbd5e0;
}

.mini-day.today {
    background: transparent;
    color: #2d5a27;
    border: 2px solid #2d5a27;
    font-weight: 600;
}

.mini-day.selected {
    background: rgba(45, 90, 39, 0.2);
    color: #2d5a27;
}

.mini-day.has-event::after {
    content: '';
    display: block;
    width: 4px;
    height: 4px;
    background: #2d5a27;
    border-radius: 50%;
    margin: 2px auto 0;
}

.mini-day.today.has-event::after {
    background: #2d5a27;
}

/* Event Categories */
.event-categories {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.category-item:hover {
    background: #f8fafc;
}

.category-item input[type="checkbox"] {
    display: none;
}

.category-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    position: relative;
}

.category-item input:checked + .category-color::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.6rem;
    color: white;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.category-color.transport { background: #3b82f6; }
.category-color.meeting { background: #10b981; }
.category-color.deadline { background: #ef4444; }
.category-color.other { background: #8b5cf6; }

.category-item span:last-child {
    font-size: 0.9rem;
    color: #4a5568;
}

/* ==========================================
   EVENT MODAL
   ========================================== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.event-modal {
    max-width: 500px;
    width: 90%;
}

.event-modal .modal-header {
    background: linear-gradient(135deg, #2d5a27 0%, #4a7c43 100%);
    color: white;
    padding: 20px 24px;
    border-radius: 16px 16px 0 0;
}

.event-modal .modal-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
}

.event-modal .modal-close {
    color: white;
    opacity: 0.8;
}

.event-modal .modal-close:hover {
    opacity: 1;
}

.event-modal .modal-body {
    padding: 24px;
}

.event-modal .form-group {
    margin-bottom: 16px;
}

.event-modal .form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 6px;
}

.event-modal .form-group input,
.event-modal .form-group select,
.event-modal .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.event-modal .form-group input:focus,
.event-modal .form-group select:focus,
.event-modal .form-group textarea:focus {
    border-color: #2d5a27;
    box-shadow: 0 0 0 3px rgba(45, 90, 39, 0.1);
    outline: none;
}

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

.event-modal .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.event-modal .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2d5a27;
}

.event-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #eef2f7;
}

.event-modal .btn-secondary {
    padding: 10px 20px;
    background: #f0f4f8;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.event-modal .btn-secondary:hover {
    background: #e2e8f0;
}

.event-modal .btn-primary {
    padding: 10px 20px;
    background: linear-gradient(135deg, #2d5a27 0%, #4a9142 100%);
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.event-modal .btn-primary:hover {
    background: linear-gradient(135deg, #1e3d1a 0%, #2d5a27 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 90, 39, 0.3);
}

.event-modal .btn-danger {
    padding: 10px 20px;
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #dc2626;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.event-modal .btn-danger:hover {
    background: #dc2626;
    color: white;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */
@media (max-width: 1400px) {
    .calendar-container {
        grid-template-columns: 300px 1fr 300px;
    }
}

@media (max-width: 1200px) {
    .calendar-container {
        grid-template-columns: 1fr 300px;
    }
    
    .calendar-sidebar-left {
        display: none;
    }
    
    .year-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .calendar-container {
        grid-template-columns: 1fr;
    }
    
    .calendar-sidebar {
        display: none;
    }
    
    .year-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .calendar-page {
        padding: 16px;
    }
    
    .calendar-header {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
    
    .calendar-nav {
        flex-direction: column;
        gap: 16px;
        padding: 16px;
    }
    
    .nav-left {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .current-period {
        min-width: auto;
        order: -1;
        width: 100%;
    }
    
    .view-switcher {
        width: 100%;
        justify-content: center;
    }
    
    .view-btn {
        flex: 1;
        text-align: center;
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .calendar-sidebar {
        grid-template-columns: 1fr;
    }
    
    .upcoming-events {
        grid-column: span 1;
    }
    
    .month-grid {
        grid-template-rows: repeat(6, minmax(80px, 1fr));
    }
    
    .day-cell {
        padding: 4px;
        min-height: 80px;
    }
    
    .day-number {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .day-event {
        font-size: 0.65rem;
        padding: 2px 4px;
    }
    
    .event-modal .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .year-grid {
        grid-template-columns: 1fr;
    }
    
    .weekday {
        font-size: 0.7rem;
        padding: 8px 4px;
    }
}
